Same sql server instance, 2 different DB: messages are inserted into initiator's sys.transm

Hello,

I have a question..

I set-up my Service Broker comunication on the same SQL Server Instance beetween 2 different DBs.

One DB behave as Initiator and send messages to the SB service setup in the other DB.

I execute the SEND statement from the Initiator and if I count the messages on the sys.transmission_queue before to commit the transaction the count returns 0.

If I try to send a message not compliant with the message type, the count that runs after the SEND returns 1 - far enought.

I'm confused about the first behaviour because from what I understood the Acknolodgment and the removal of the message from the sys.trasmission queue should happen after the COMMIT.

Some expert can aswer to this direct quection?

Thank you

Marina B.

[793 byte] By [marinaB.] at [2008-1-4]
# 1
I'm not an expert by any means. However (at least it used to be like this), when you're sending messages within the same server instance, the messages does not go over sys.transmission_queue, but they'd be inserted directly into the other queue. When delivery fails for some reason, they'll be put on the sys.transmission_queue.

HTH

Niels

nielsb at 2007-10-3 > top of Msdn Tech,SQL Server,SQL Service Broker...
# 2

Does it make sense...

so the checks that SB does:

  • target queue exists and is enabled
  • message received by the target service on the target queue is compliant with the defined message type
  • Insert the conversation endpoints record into the Target DB
    and so on so forth till the message is added into the Target queue

before the COMMIT Transaction statement is executed?

Thx

Marina

marinaB. at 2007-10-3 > top of Msdn Tech,SQL Server,SQL Service Broker...
# 3
sounds OK to me.

Niels

nielsb at 2007-10-3 > top of Msdn Tech,SQL Server,SQL Service Broker...
# 4

Thankx ...

I have to write some technical docs and I'm trying to drawn in a diagram that shows what happens within SB related to "my" message flow.

I found documentation here and there in the network but sometimes it is not so very well explained what happens inside SB.

Thankx

Marina

marinaB. at 2007-10-3 > top of Msdn Tech,SQL Server,SQL Service Broker...
# 5
For a local message delivery (within the same SQL Server instance) Service Broker would try first to enqueue the message directly on the target queue, because that is a huge optimization. If that operation fails for whatever reason, then the message is inserted in the transmission queue and delivery is attempted again after the transaction commits.
RemusRusanu at 2007-10-3 > top of Msdn Tech,SQL Server,SQL Service Broker...

SQL Server

Site Classified