Beispiel #1
0
        //[Disable]
        public static void RunDLQ([ServiceBusTrigger("sent_transfer_connection_invitation", "RDS_SentTransferConnectionInvitiationProcessor/$DeadLetterQueue", AccessRights.Manage, Connection = "MessageBusConnectionString")] BrokeredMessage bMessage, ExecutionContext executionContext, TraceWriter log, [Inject] ITransferRelationshipService transferRelationshipMessageService, [Inject] ILog logger)
        {
            log.Info($"Processing messageId: {bMessage.MessageId} {{ID={executionContext.InvocationId}}}");

            SentTransferConnectionInvitationEvent messageBody = null;

            try
            {
                messageBody = bMessage.GetBody <SentTransferConnectionInvitationEvent>();
            }
            catch (Exception e)
            {
                log.Error($"Unable to deserialize message body for message queue sent_transfer_connection_invitation. messageId: {bMessage.MessageId} {{ID={executionContext.InvocationId}}}", e);
                bMessage.Defer();
            }

            if (messageBody != null)
            {
                try
                {
                    transferRelationshipMessageService.SaveSentMessage(messageBody);
                    log.Info($"Processing Completed for messageId: {bMessage.MessageId} {{ID={executionContext.InvocationId}}}");
                    bMessage.Complete();
                }
                catch (Exception e)
                {
                    log.Error($"Unable to save message for queue sent_transfer_connection_invitation DLQ. messageId: {bMessage.MessageId} {{ID={executionContext.InvocationId}}}", e);
                    bMessage.Defer();
                }
            }
        }
Beispiel #2
0
        //[Disable]
        public static void Run([ServiceBusTrigger("sent_transfer_connection_invitation", "RDS_SentTransferConnectionInvitiationProcessor", AccessRights.Manage, Connection = "MessageBusConnectionString")] SentTransferConnectionInvitationEvent message, ExecutionContext executionContext, TraceWriter log, [Inject] ITransferRelationshipService transferRelationshipMessageService, [Inject] ILog logger)
        {
            transferRelationshipMessageService.SaveSentMessage(message);

            logger.Info($"C# service bus trigger function executed at ProcessTransferRelationshipStartMessage: {DateTime.Now}");
        }