public async Task <string> Service1Method1(string param1)
        {
            try
            {
                var x = 1;
                var y = 0;

                if (y == 0)
                {
                    return((x / y).ToString());
                }

                var correlationId = TraceCorrelation.GetCurrentActivityId();
                ServiceEventSource.Current.ServiceRequestStart("Service1Method1", correlationId);
                ServiceEventSource.Current.ServiceRequestStart1(correlationId, "Service1Method1");
                var proxy  = _statelessService2ProxyFactory.CreateSingletonServiceProxy();
                var result = await proxy.Service2Method1(param1);

                ServiceEventSource.Current.ServiceRequestStop("Service1Method1", correlationId);
                return(result);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            }
        }
Exemple #2
0
        public async Task <string> Service2Method1(string param1)
        {
            var correlationId = TraceCorrelation.GetCurrentActivityId();

            ServiceEventSource.Current.ServiceRequestStart("Service2 Method1 - Start; PARAM1: " + param1 + "; " + correlationId, correlationId);
            await Service2PrivateMethod1();

            ServiceEventSource.Current.ServiceRequestStop("Service2 Method1 - End; PARAM1: " + param1 + "; " + correlationId, correlationId);
            return("Result from Service 2, Method 1");
        }
        public TK DoAction <T, TK>(T input)
        {
            var result        = default(TK);
            var correlationId = TraceCorrelation.GetCurrentActivityId();

            ServiceEventSource.Current.ServiceRequestStart("Handler1 - Start; " + correlationId, correlationId);
            Thread.Sleep(1000);
            ServiceEventSource.Current.ServiceRequestStop("Handler1 - Stop; " + correlationId, correlationId);

            return(result);
        }
Exemple #4
0
        private async Task <string> Service2PrivateMethod1()
        {
            var correlationId = TraceCorrelation.GetCurrentActivityId();

            ServiceEventSource.Current.ServiceRequestStart("Service2 Private Method1 - Start" + correlationId, correlationId);
            Thread.Sleep(2000);
            var result = Task.Run(
                () => _commandContext.DoAction <int, bool>("Handler1", 5));

            ServiceEventSource.Current.ServiceRequestStop("Service2 Private Method1 - End;" + correlationId, correlationId);

            return("Result from Service 2, Method 1");
        }