Move conversation

when you move a conversation to a conversation group, that conversation_group has to have been created previously, ie, you cant specify a non-existing conversation_group, right?

I ask because I am trying to develop an application where I use optimally one conversation related to many given conversation_groups, so that when I receive, I lock only a small determined subset of messages. What I could have used was a way to send messages on a conversation, specifying a conversation_group_id.

Any suggestions?

[531 byte] By [WilliamBushman] at [2008-2-27]
# 1

You're right, MOVE does not accept a non-existing conversation group. Note that BEGIN DIALOG ... WITH RELATED_CONVERSATION_GROUP accepts a arbitrarly conversation_group_id and it will create it if it doesn't exist.

I'm not sure I understand your plan to use one conversation to lock small determined subset of messages. Can you detail it how you plan to use it?

HTH,
~ Remus

RemusRusanu at 2007-9-8 > top of Msdn Tech,SQL Server,SQL Service Broker...
# 2
Sure.

Let me give a brief history of my application. I was initially beginning and ending a dialog whenever I had to send a message from one SSB server to another. To avoid the overhead of beginning and ending a conversation for each message, Roger Wolter advised me to reduce the number of conversations I used, so right now I use 10 per queue (Is it preferable to use 1 conversation per queue as opposed to a small set?). This works fine for my atomic messages; order doesnt matter and a message has no relation to any other message.

However, I am planning to expand the application to handle serialized messages, where order does matter, and also to support write coalescing, where only the last message of a set gets processed. To do this, I planned to group messages using specific conversation groups. Since the RECEIVE command locks on conversation group and not on conversation, grouping messages on one or a small set of conversationsthis would work. However, I have no way of creating these conversation groups, apart from using BEGIN DIALOG command, like you mentioned.

WilliamBushman at 2007-9-8 > top of Msdn Tech,SQL Server,SQL Service Broker...
# 3

Conversation groups are not meant for grouping messages like you describe. The primitive for communication is a conversation. You should use a conversation for a set of related messages.

Conversation group enables you to group conversations that may share state. The typical example is when a client service begins a dialog and sends a message to an aggregator service which in turn begins conversations to target services and waits for them to reply. It must relate the outbound conversations with the inbound one in order to serialize the replies.

In your application, you should use one conversation per set of serialized messages. That way you will get maximum concurrency yet maintain order within each set of related messages.

RushiDesai at 2007-9-8 > top of Msdn Tech,SQL Server,SQL Service Broker...

SQL Server

Site Classified