SQL server Service Broker -- Reading same Message by multiple Users in the queue

  • SQL server Service Broker -- Reading same Message by multiple Users in the queue

    Can a message in a queue can be read by multiple users?

    I have an Admin Role.

    Created three users with Admin Role.

    I m inserting a message into the queue.

    Is it possible to make the message read by all the three users?

  • Technically, yes, multiple users can "read" the same message, but this trick lacks queuing delivery and synchronization control and is almost certainly not what you want.

    If you want "guaranteed multiple delivery" to multiple receivers, then no that is not built-in to Service Broker, but it is not hard to implement it yourself. You have to first make three new copies of your delivery queue and attach your three receivers each to one of these. then you need to use your original delivery queue as an intermediate queue and service it with an activation procedure that receives a new message and then sends three copies of it, one to each of the new delivery queues. Finally, the receive-copy-send(x3) sequence of the intermediate activation procedure needs to be wrapped in a transaction to insure the multiple-delivery feature.

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • Hi everybody,

    I'm just starting with ServiceBroker and i'm looking for a solution to following problem:

    Is there a possibility, to create a new Service / Queue while a user login to the database? I need to send a message to this new connection if changes happens.

    How can I attach this to the existing conversations like described from RBarryYoung?

    Thanks in advance.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply