I have the following code:
WAITFOR(
RECEIVE TOP (100)
message_type_name,
CAST(message_body AS XML),
conversation_handle
FROM MyDemoQueue
INTO @ReceiveTable
), TIMEOUT 10000;
But I only get one entry even though there are 10 in the queue. I saw a lot of posts about this and i know that this is related to conversation groups and i should put the messages into one conversation group.
Service Broker only receiving one message at a time
All messages that are returned by a RECEIVE statement belong the same conversation group
But I can’t find any code examples on how exactly I should implement this. Only theory. I can’t even find it in the official documentation. Should this be on the sender’s or the reciever’s side? If anyone has ever done this before, please share code examples.