/// <summary>
        /// The OnSubscriberReceiving handler.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="args">
        /// The args.
        /// </param>
        private void OnSubscriberReceiving(object sender, SubscriberReceivingEventArgs args)
        {
            try
            {
                var subscriber = (ISubscriber)sender;
                var name       = subscriber.GetType().Name;

                Trace.TraceInformation(
                    "[Machine Name: {0}][DeploymentId: {1}][Role: {2}][Role Instance Id: {3}][Subscriber {4}] Receiving message {5}.",
                    this.MachineName,
                    this.DeploymentId,
                    this.RoleInstanceName,
                    this.RoleInstanceId,
                    name,
                    args.Message);
            }
            catch (InvalidCastException ex)
            {
                Trace.TraceError(ex.ToString());
            }
            catch (NullReferenceException ex)
            {
                Trace.TraceError(ex.ToString());
            }
            catch (ArgumentNullException ex)
            {
                Trace.TraceError(ex.ToString());
            }
            catch (FormatException ex)
            {
                Trace.TraceError(ex.ToString());
            }
        }
Exemplo n.º 2
0
        private void OnSubscriberReceiving(object sender, SubscriberReceivingEventArgs args)
        {
            try
            {
                var subscriber = (ISubscriber)sender;
                var name       = subscriber.GetType().Name;

                this.subscriberEventWriter.Receiving(
                    this.MachineName,
                    this.DeploymentId,
                    this.RoleInstanceName,
                    this.RoleInstanceId,
                    name,
                    args.Message.MessageKey);
            }
            catch (Exception ex)
            {
                Trace.TraceError(ex.ToString());
            }
        }
        /// <summary>
        /// The OnSubscriberReceiving handler.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="args">
        /// The args.
        /// </param>
        private void OnSubscriberReceiving(object sender, SubscriberReceivingEventArgs args)
        {
            try
            {
                var subscriber = (ISubscriber)sender;
                var name = subscriber.GetType().Name;

                Debug.Print(
                    "[Machine Name: {0}][DeploymentId: {1}][Role: {2}][Role Instance Id: {3}][Subscriber {4}] Receiving message {5}.", 
                    this.MachineName, 
                    this.DeploymentId, 
                    this.RoleInstanceName, 
                    this.RoleInstanceId, 
                    name, 
                    args.Message.MessageKey);
            }
            catch (InvalidCastException ex)
            {
                Debug.Print(ex.ToString());
            }
            catch (NullReferenceException ex)
            {
                Debug.Print(ex.ToString());
            }
            catch (ArgumentNullException ex)
            {
                Debug.Print(ex.ToString());
            }
            catch (FormatException ex)
            {
                Debug.Print(ex.ToString());
            }
        }
        private void OnSubscriberReceiving(object sender, SubscriberReceivingEventArgs args)
        {
            try
            {
                var subscriber = (ISubscriber)sender;
                var name = subscriber.GetType().Name;

                this.subscriberEventWriter.Receiving(
                    this.MachineName, 
                    this.DeploymentId, 
                    this.RoleInstanceName, 
                    this.RoleInstanceId, 
                    name, 
                    args.Message.MessageKey);
            }
            catch (Exception ex)
            {
                Trace.TraceError(ex.ToString());
            }
        }
 /// <summary>
 /// The OnSubscriberReceiving handler.
 /// </summary>
 /// <param name="sender">
 /// The sender.
 /// </param>
 /// <param name="args">
 /// The args.
 /// </param>
 private void OnSubscriberReceiving(object sender, SubscriberReceivingEventArgs args)
 {
     this.NumberEventsFired++;
 }
 /// <summary>
 /// The OnSubscriberReceiving handler.
 /// </summary>
 /// <param name="sender">
 /// The sender.
 /// </param>
 /// <param name="args">
 /// The args.
 /// </param>
 private void OnSubscriberReceiving(object sender, SubscriberReceivingEventArgs args)
 {
     this.NumberEventsFired++;
 }