Example #1
0
        public async Task NoeNegotiatedAsync(int noeId, Guid sagaId, int flag)
        {
            log.InfoFormat("NoeNegotiated - noeId {0}, flag {1}", noeId, flag);

            var message = new NoeNegotiationResponse()
            {
                NoeId         = noeId,
                SagaId        = sagaId,
                NoeNegotiated = (flag == 0 ? false : true)
            };

            //StartupAsync();
            var options = new SendOptions();

            options.SetDestination(Constants.ZSUS_NOE_SAGA_ENDPOINT);
            await endpointInstance.Send(message, options).ConfigureAwait(false);

            //ShutdownAsync();
        }
Example #2
0
 public async Task Handle(NoeNegotiationResponse message, IMessageHandlerContext context)
 {
     if (message.NoeNegotiated)
     {
         log.InfoFormat("Recieved NoeNegotiationResponse, NoeNegotiated flag TRUE, sending NoeOfferRequest for {0} ({1})",
                        message.NoeId, message.SagaId);
         Data.NoeNegotiated = message.NoeNegotiated;
         var request = new NoeOfferRequest(message);
         var options = new SendOptions();
         options.SetDestination(Constants.ZSUS_NOE_OFFER_REQUEST_ENDPOINT);
         await context.Send(request, options).ConfigureAwait(false);
     }
     else
     {
         log.InfoFormat("Recieved NoeNegotiationResponse, NoeNegotiated flag FALSE for {0} ({1}), sending NoeResponse",
                        message.NoeId, message.SagaId);
         Data.NoeNegotiated = message.NoeNegotiated;
         var request = new NoeResponse(message);
         request.Status = Constants.ZSUS_SAGA_MARKED_COMPLETE;
         var options = new SendOptions();
         options.SetDestination(Constants.ZSUS_NOE_RESPONSE_ENDPOINT);
         await context.Send(request, options).ConfigureAwait(false);
     }
 }