Example #1
0
        public async Task Handle(UpdateCard message, IMessageHandlerContext context)
        {
            log.Error($"Received UpdateCard in subscriber, weight = {message.weight} ...");
            bool succeded        = false;
            var  successedUpdate = await _subscriberService.UpdateCard(message.cardId, message.weight);

            // var successedUpdate = 1;

            if (successedUpdate != -1)
            {
                succeded = true;
                AddTrack addTrack = new AddTrack()
                {
                    CardId    = message.cardId,
                    NewWeight = message.weight,
                };
                await context.Send(addTrack);
            }
            cardUpdated cardUpdated = new cardUpdated()
            {
                isSucceeded = succeded,
                measureId   = message.measureId
            };
            //await _endpointInstance.Send(cardUpdated)
            await context.Publish(cardUpdated)
            .ConfigureAwait(false);
        }
Example #2
0
        public async Task Handle(cardUpdated message, IMessageHandlerContext context)
        {
            log.Error("BMI updated, and Tracking added, yooooooo");
            await _measureService.UpdateStatus(message.measureId, message.isBMISucceeded&& message.isTrackingSucceeded);

            //return  Task.CompletedTask;
        }
 private async Task sendCompleteResponse(IMessageHandlerContext context)
 {
     if (Data.IsTrackingAdded && Data.IsBMIUpdated)
     {
         _log.Warn($"Complete saga for id {context.MessageId}------------------------------");
         cardUpdated card = new cardUpdated()
         {
             measureId           = Data.MeasureId,
             isBMISucceeded      = Data.BMISucceeded,
             isTrackingSucceeded = Data.TrackingSucceeded
         };
         await context.Publish(card);
     }
 }
Example #4
0
 public Task Handle(cardUpdated message, IMessageHandlerContext context)
 {
     throw new NotImplementedException();
 }
        public async Task Handle(cardUpdated message, IMessageHandlerContext context)
        {
            await _measureService.UpdateStatus(message.measureId, message.isSucceeded);

            //return  Task.CompletedTask;
        }