Hi All,
We use service bus 1.0 in our project as data exchange center. some times, some message will be put into deadletter queue because some reason. i hope this message in deadletter queue is deferred. so we use the defer() method in BrokeredMessage class to change the status.
but unfortunately, the status is not change. in my understand, the value of state field in MessagetTable table will became to 2, because before it change from 0 to 2 after we do defer for one message. but now it don't change, i don't know why, and there is not any exception been throw out, during do defer operation.
below are my simple code about how to defer a deadletter queue message:
QueueClient client = messagingFactory.CreateQueueClient(QueueClient.FormatDeadLetterPath(queueName));
bool canCountinue = false;do
{
BrokeredMessage message = client.Receive();
if (message != null)
{
message.Defer();
canCountinue = true;
}
else
{
canCountinue = false;
}
} while (canCountinue);
client.Close();
so, did any one know what's wrong in my code or there are some precondition need to note before do defer operate?