We want to be able to hold a property in a Service Bus Queue Brokered Message that stores the status of the item; so in the cases where an item is reprocessed for whatever reason we have a record indicating where in the process it had got to (improving our retry logic).
So we have the below code for picking up an item from a queue:
var brokeredMessage =
_queueClient.Receive(TimeSpan.FromSeconds(DEFAULT_WAIT_TIME_IN_SECONDS));
Then we want to adjust a property so it holds a status enum like so:
brokeredMessage.Properties.Add("Status", MessageStatusEnum.MessageReceived);
Is it possible to persist a new / update property within a Brokered Message like this, does an additional method have to be called, or will any changes made to the properties be lost after it has been received?