Beispiel #1
0
 /// <summary>
 /// UpdateCallContext
 /// </summary>
 /// <param name="correlationId"></param>
 private static void UpdateCallContext(string correlationId)
 {
     try
     {
         CorrelationDetails.UpdateCurrentActivityId(correlationId);
     }
     catch (Exception ex)
     {
         ServiceEventSource.Current.Message(ex?.InnerException?.ToString(), $"CorrelationId:{ correlationId }; {ex.StackTrace}");
     }
 }
Beispiel #2
0
        /// <summary>
        /// GetCurrentActivityId
        /// </summary>
        /// <returns></returns>
        public static string GetCurrentActivityId()
        {
            string currentActivityId = string.Empty;

            if (!CorrelationDetails.TryGetCurrentActivityId(out currentActivityId))
            {
                ServiceEventSource.Current.Message("GetCurrentActivityId", "Current USPCorrelationId not found!");
            }
            UpdateCallContext(currentActivityId);

            return(Task.FromResult(currentActivityId).Result);
        }
 public async Task <byte[]> RequestResponseAsync(
     IServiceRemotingRequestContext requestContext, ServiceRemotingMessageHeaders messageHeaders, byte[] requestBody)
 {
     try
     {
         CorrelationDetails.UpdateCurrentActivityId(messageHeaders);
         return(await _serviceRemotingMessageHandler.RequestResponseAsync(requestContext, messageHeaders, requestBody));
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
         throw;
     }
 }
 public void HandleOneWay(IServiceRemotingRequestContext requestContext, ServiceRemotingMessageHeaders messageHeaders, byte[] requestBody)
 {
     CorrelationDetails.UpdateCurrentActivityId(messageHeaders);
     _serviceRemotingMessageHandler.HandleOneWay(requestContext, messageHeaders, requestBody);
 }
Beispiel #5
0
 public void SendOneWay(ServiceRemotingMessageHeaders messageHeaders, byte[] requestBody)
 {
     CorrelationDetails.SetActivityIdHeader(messageHeaders);
     _serviceRemotingClient.SendOneWay(messageHeaders, requestBody);
 }
Beispiel #6
0
 public async Task <byte[]> RequestResponseAsync(ServiceRemotingMessageHeaders messageHeaders, byte[] requestBody)
 {
     CorrelationDetails.SetActivityIdHeader(messageHeaders);
     return(await _serviceRemotingClient.RequestResponseAsync(messageHeaders, requestBody));
 }