/// <summary>
        /// The OnSubscriberReceived handler.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="args">
        /// The args.
        /// </param>
        private void OnSubscriberReceived(object sender, SubscriberReceivedEventArgs 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}] Received message {5} ({6:F6} seconds).",
                    this.MachineName,
                    this.DeploymentId,
                    this.RoleInstanceName,
                    this.RoleInstanceId,
                    name,
                    args.Message,
                    args.Elapsed.TotalSeconds);
            }
            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());
            }
        }
Exemple #2
0
        private void OnSubscriberReceived(object sender, SubscriberReceivedEventArgs args)
        {
            try
            {
                var subscriber = (ISubscriber)sender;
                var name       = subscriber.GetType().Name;

                this.subscriberEventWriter.Received(
                    this.MachineName,
                    this.DeploymentId,
                    this.RoleInstanceName,
                    this.RoleInstanceId,
                    name,
                    args.Message.MessageKey,
                    args.Elapsed.TotalSeconds.ToString(CultureInfo.InvariantCulture));
            }
            catch (Exception ex)
            {
                Trace.TraceError(ex.ToString());
            }
        }
        /// <summary>
        /// The OnSubscriberReceived handler.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="args">
        /// The args.
        /// </param>
        private void OnSubscriberReceived(object sender, SubscriberReceivedEventArgs 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}] Received message {5} ({6:F6} seconds).", 
                    this.MachineName, 
                    this.DeploymentId, 
                    this.RoleInstanceName, 
                    this.RoleInstanceId, 
                    name, 
                    args.Message.MessageKey, 
                    args.Elapsed.TotalSeconds);
            }
            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 OnSubscriberReceived(object sender, SubscriberReceivedEventArgs args)
        {
            try
            {
                var subscriber = (ISubscriber)sender;
                var name = subscriber.GetType().Name;

                this.subscriberEventWriter.Received(
                    this.MachineName, 
                    this.DeploymentId, 
                    this.RoleInstanceName, 
                    this.RoleInstanceId, 
                    name, 
                    args.Message.MessageKey, 
                    args.Elapsed.TotalSeconds.ToString(CultureInfo.InvariantCulture));
            }
            catch (Exception ex)
            {
                Trace.TraceError(ex.ToString());
            }
        }
 /// <summary>
 /// The OnSubscriberReceived handler.
 /// </summary>
 /// <param name="sender">
 /// The sender.
 /// </param>
 /// <param name="args">
 /// The args.
 /// </param>
 private void OnSubscriberReceived(object sender, SubscriberReceivedEventArgs args)
 {
     this.NumberEventsFired++;
 }
 /// <summary>
 /// The OnSubscriberReceived handler.
 /// </summary>
 /// <param name="sender">
 /// The sender.
 /// </param>
 /// <param name="args">
 /// The args.
 /// </param>
 private void OnSubscriberReceived(object sender, SubscriberReceivedEventArgs args)
 {
     this.NumberEventsFired++;
 }