9

After sending the BrokeredMessage to the queue, like below

BrokeredMessage msg = new BrokeredMessage(content);
client.Send(msg);

Is there any way to get the value of this msg.LockToken?

tso
  • 4,732
  • 2
  • 22
  • 32
Kim Hoang
  • 1,338
  • 9
  • 24
  • You need you get access to the locktoken from the sender ? – Thomas Dec 19 '16 at 09:12
  • @Thomas, actually i am trying to delete a specific message in the queue. But it seems it is impossible to do it. – Kim Hoang Dec 19 '16 at 13:55
  • Why do you need to delete this message ? Would you like to explain a little bit more ? – Thomas Dec 19 '16 at 18:37
  • @Thomas, I use Azure Queue to provide the job to multiple machines. In case user cancel the job, I need to make sure that the job will not be processed if it is still on the queue. First, I am thinking of deleting a specific message on the queue, but it seems to be impossible. I just use another way to handle that requirement. – Kim Hoang Dec 21 '16 at 15:46

1 Answers1

2

You can get LockToken from Message.SystemProperties.LockToken.

Saw
  • 6,199
  • 11
  • 53
  • 104