Is it posible to say NSB to copy all message headers from command message to reply? By default NSB copy its own headers NSwerviceBus.*, but not custom.
Here is my case: I have a saga and a set of workers. Saga sends messages to workers through distributor. For some reasons workers cannot process some messages. It doesn't fail and just reply to saga with specific reply: CannotProcessMessage.
What i want is to process each command 3 times (Saga should correlate this, not NSB retry mechanism). I see 3 solutions:
Hold a dictionary of attempt count for each message is SagaData. This solution is not very good because in case of mullions of messages sagadata will become very large
Add a property "AttemptCount" to my message and my reply. This will work, but will affect my workers interface. Workers should not know anything about attempt count
Add "AttemptCount" to command and reply headers. It will not affect workers interface, but stil we have to copy this header from command to reply in worker.
So, a found third is the best soulution, but can't find a way to say NSB to automatically copy headers from command to reply. Is it posible? Or maybe you can suggest other solutions?
Thanks.