/// <summary> /// Invokes the subscriber for processing of the message. /// </summary> /// <param name="msg">A reference to the subscribed message.</param> public override void Invoke(MultiPartMessage msg) { ContextTraceListener contextListener = ((ContextTraceListener)MessageEngine.Instance.Tracing.Listeners["ContextTraceListener"]); if (contextListener != null) { contextListener.ResetContext(); } }
private void MessageReceivedEventHandler(object sender, AdapterReceiveEventArgs e) { ContextTraceListener contextListener = ((ContextTraceListener)MessageEngine.Instance.Tracing.Listeners["ContextTraceListener"]); if (contextListener != null) { contextListener.ResetContext(); } }
protected void UnhandledExceptionEventHandler(object sender, UnhandledExceptionEventArgs e) { ContextTraceListener contextListener = ((ContextTraceListener)MessageEngine.Instance.Tracing.Listeners["ContextTraceListener"]); if (contextListener != null) { contextListener.ResetContext(); } if ((MessageEngine.Instance.Tracing.Switch.Level & SourceLevels.Critical) == SourceLevels.Critical) { MessageEngine.Instance.Tracing.TraceData(TraceEventType.Critical, 0, e.ExceptionObject); } }
/// <summary> /// Called by the pipeline to invoke the component. /// </summary> /// <param name="msg">The message to process.</param> /// <returns>A collection of messages produced by this component.</returns> public override Collection <MultiPartMessage> Invoke(MultiPartMessage msg) { string serialNumber = msg.Properties.ReadAsString("SerialNumber"); if (!CanProcess(msg)) { ContextTraceListener contextListener = ((ContextTraceListener)MessageEngine.Instance.Tracing.Listeners["ContextTraceListener"]); if (contextListener != null) { contextListener.ResetContext(); } return(null); } Collection <MultiPartMessage> resultCollection = new Collection <MultiPartMessage>(); resultCollection.Add(msg); return(resultCollection); }