Esempio n. 1
0
        internal static void ImportFromMessage(Message msg)
        {
            var values = new Dictionary <string, object>();

            msg.GetApplicationHeaders(values);

            if (PropagateActivityId)
            {
                object activityIdObj;
                if (!values.TryGetValue(E2_E_TRACING_ACTIVITY_ID_HEADER, out activityIdObj))
                {
                    activityIdObj = Guid.Empty;
                }
                Trace.CorrelationManager.ActivityId = (Guid)activityIdObj;
            }
            if (values.Count > 0)
            {
                // We have some data, so store RC data into LogicalCallContext
                SetContextData(values);
            }
            else
            {
                // Clear any previous RC data from LogicalCallContext.
                // MUST CLEAR the LLC, so that previous request LLC does not leak into this one.
                Clear();
            }
        }