0

This is my perivous question. about how to push the data from database instead of application pull data.

After went through the link and the documents I come to know that I need to write a query in application side for notification request then the DB will register my request in subscription and If there is any change in the DB it will check subscription, if the request is there it will send the message to the client.

This para is from the above mentioned link

Along with the query submitted for the notification, the client submits a service name
and a broker instance. Each notification subscription begins a Service Broker dialog 
with this provided service and broker instance. When data is changed and the change 
would affect the result of the submitted query result, a message is sent on this   
dialog. By sending this message, the client is considered notified and the notification 
subscription is removed. If client desires to be notified on further changes, is  
supposed to subscribe again.

Now I don't know how to write a query in application side for notification request and I don't under stand submit a service and a broker instance from the above given para. I guess the service and broker instance needs to be created in application before query the database for notification request. If it is so how to create service and a broker instance?

I can check the DB server for subscription by select * from sys.dm_qn_subscriptions command. can anyone help me?

Community
  • 1
  • 1
niren
  • 2,693
  • 8
  • 34
  • 58

1 Answers1

0

Probably you didn't understand answer to your previous question completely, so I will try to clarify some things:

I guess the service and broker instance needs to be created in application before query the database for notification request. If it is so how to create service and a broker instance?

Service broker is a component of SQL Server, you don't instance nor create it. You enable it - it is a SQL Server admin task to do it.

To create a new service you have to first create queue for it and a contract to have a way of communication. Then you create your service.

When you create your service, instancing, activation and other related operations are handled by the Service Broker.

OzrenTkalcecKrznaric
  • 5,535
  • 4
  • 34
  • 57