NServiceBus SetHeader In Catch of Handler -
we using try catch in our message handler, realize against recommended best practices of not handling exceptions. said, have been asked identify last retry , send message queue in suppressed transaction. sending of message working however, calling message.setheader (also tried bus.currentmessagecontext.headers[esbservice.firstlevelretriesheader] = currentfirstlevelretryattempt.tostring();) implement own tracking of retry attempts. looking write incrementing number in header , see when reaches specific value trigger send of message queue. seems write it, when the message processed again, never present. using transactions, possible changes getting rolled when throw exception. tried writing header in suppressed transaction , did not work.
is there way update header while still letting exception bubble nsb.
Comments
Post a Comment