Message expiration in the MessagingBridge

We are using the MessagingBridge library to bridge between Azure ServiceBus and SQL Transports. We have ServiceControl running on the SQL Transport. I am setting the time to live on our audit messages on our ASB endpoints, but those expiration dates are not making it to the SQL tables when the messages are moved across the bridge. Is there a way to configure the messaging bridge to keep the expiration dates carry through? In the SQL, that is the Expires column and on ASB it is the Expires property. It doesn’t appear to copy the Expires property on the ASB message to the Expires column on the SQL table using our basic configuration. Thanks.

Hi @stevebering,

How are you specifying the time to live on the ASB messages? If you’re using the NServiceBus API, we actually set the value in the TimeToBeReceived header.

I can confirm that this header is indeed copied over to the SQL messages when using a bridge to move messages from ASB to SQL.

The Expires column is not populated though, which means we have a bug.

We’ve dug into it and found where we’re not setting the SQL Transport DiscardIfNotReceivedBefore property before doing the dispatch.

We’ll create a bug issue for this, and hopefully it will be fixed soon. We’ll keep you updated as we know more.

We are using the NServiceBus API when configuring our endpoint, as below:

configuration.AuditProcessedMessagesTo(auditQueue, TimeSpan.FromHours(4));

When viewing these messages within the ASB queue, I can see that the “Time to Live” and “Expires” properties are being set on the messages placed in the ASB audit queue. However, when that message gets picked up by our Messaging Bridge and the message gets shoveled over to our SQL table, the Expires column is not getting populated.