specific client notify from service broker

Answered specific client notify from service broker

  • Tuesday, November 06, 2012 8:16 AM
     
     

    Hello all

    I have created a windows application with c#. This application get a series message from database and notify to users. all users get Service Broker notification and refer to database to get its information(If exist information for this client). This action causes traffic in my server. However some clients have any information but refer to database and get bandwidth.

    therefor How I can create a service broker or same service that notify some clients.

    Sincerely you M.Bagheri


    M.Bagheri

All Replies

  • Tuesday, November 06, 2012 9:52 AM
     
     
    Your question doesn't have sufficient information to give any sensible answer. Please provide more information.

    SQL expert for JF Hillebrand IT BV - The Netherlands.

  • Tuesday, November 06, 2012 10:47 AM
     
     

    Hi dear rrozema

    ok, I have a table that record input and output of persons. when a person input in my notify table create a new row and service broker notify my code to show related message to manager. but my system has many managers. in notify table I have a columns that called ToPersonID and I after receive notify from service broker get related information with this column. but all clients get service broker notification and try to get information. if ToPersonID was match get data and else nothing do. this action create traffic in my server. I want only related managers get notification depending on ToPersonID for example.

    Sincerely you M.Bagheri


    M.Bagheri

  • Tuesday, November 06, 2012 11:21 AM
     
     Answered

    Would it be possible to include the value(s) of the ToPersonID in the affected rows in the notification message you send to the clients? You would still send out a notification to all clients, but every client can then for themselves decide whether to follow up on the notification or not without having to do an additional call to the database.

    Even better, have each client send to the service as the very first message the personID(s) they have an interest in. Then, when a change is made, the service can determine which clients to notify based upon the personID in the changed rows plus the personID's the clients have subscribed to. In this situation you will only send out a notification to those clients who actually have an interest in the changes that were made. An example of such a publish-subscribe service was given by Remus Rusanu on his site in this post.


    SQL expert for JF Hillebrand IT BV - The Netherlands.