Announcing Service Broker External Activator
The Microsoft SQL Server Service Broker External Activator (EA) is distributed in the Microsoft SQL Server 2008 Feature Pack. It is an extension of the internal activation feature and lets you move the logic for receiving and processing service broker messages from the database engine service to an application executable that runs outside the database engine service. This can provide a higher level of scale-out performance by moving processing loads from the database server to another computer. The activation application process can also run under a different windows account from the database engine process. This gives administrators additional control over the resources that the activation application can access. Installation packages for x86, x64, and ia64 architectures can be downloaded from here.
Specifically, here are a list of benefits a user can get from using EA:
· Access non-database resources such as files, network connections in their message processing applications
· Offload computation-intensive work out of SQL box and deploy it to a different machine
· Leverage legacy code libraries that are not accessible within T-SQL stored procedures
· Message processing solution that adapts and scales well by specifying the MIN and MAX number of instances of application processes to run
After installed, EA runs as a NT service. It watches the user configured notification queue for QUEUE_ACTIVATION events. As soon as a notification message is seen, it responds by launching an activation application specified in the configuration file to process messages received in the notification-related user queue. The notification queue, the user queue and the event notification associating them must be predefined before EA can run. A configuration file will tell EA which notification queue to watch on and what application to launch when a QUEUE_ACTIVATION event is received. In addition, a user can configure EA in a way that EA can launch enough number of application instances to consume messages from the user queue in a timely manner without a wasteful use of system resources.
In v1 release, EA only supports:
· Listening on a single notification service for queue activation events
· Only integrated security is allowed in notification database connection string. SQL login and password are not supported just yet.
· All user applications are launched under the same user credential as what EA is running under
Please check out more details on how to setup and start using EA by reading the installed user doc bin\<culture_code>\SSBEA.doc in your install folder (for example, the English culture code is EN).
We'll blog more about EA on topics such as configuration and deployment, tracing and trouble-shooting, some corner cases in our next several posts. Stay tuned! :-)
Please check out service broker team blog site for more technical articles http://blogs.msdn.com/sql_service_broker/.
All Replies
- so if i 'activate' a process on another machine...you know, scaling out...
how does EA know that it's running so it can control the Min/Max thresholds established in the number of instances allowed to run?
- Fastmike,
The EA service should be running on the machine in which a process is activated. However, SQL Server is not required on the machine running the service. The EA service controls the thresholds based on the configuration information which a user provides for concurrency min and max values.
Regards,
Jang - Fastmike,
Adding to Jang's reply, here's what happens between Sql Server instance and External Activator.
External Activator listens for event notifications that are sent by Sql Server when new messages get enqueued in an application queue and are ready to be received. Upon receiving such event notifications, External Activator will try to launch the configured application (it is launched on the same machine that External Activator runs on, but this doesn't have to be the Sql Server machine).
If the application is written properly, it will shortly proceed to receive some message(s) from the application queue. This receive is recognized by Sql Server, and based on the rate of incoming and received messages, Sql Server may send additional event notifications to External Activator if it assesses that your application is not keeping up. External Activator may in turn launch another instance of your application, but will make sure to keep the number of running applications within the range you defined in configuration file (min and max parameters). okay...thanks...
so i'm think'n of a situation where app's exist out there on my network'd world...and these app's all employee an atypical polling mechnizm to maintain a cache in their respective address spaces of some data pulled/polled from some sqlsrvr...
would EA be able to be configured to 1.) notify all my app's that the cache their using has changed...or 2.) would i have to write a specific app called by EA that would in turn perform the notification to app's that cache requires a refresh!? Again app's could be on a variety of machines...i'm envisioning somekind of broadcast employeed to notify app's of cache state change.- Hmm... sounds like what you're looking for is Query Notifications rather than External Activator. Let me know if I'm wrong.
- Hi Junan,
Is there a EA example or sample application, which I can download,
There are several downloads avaliable on the Microsoft SQL Server 2008 Feature Pack, October 2008
If I download "Microsoft SQL Service Broker External Activator", is that sufficient to test the EA
Please let me know.
Thanks in advance,
Regards- Edited byswordfish8 Monday, July 13, 2009 11:41 PM
- Edited byswordfish8 Monday, July 13, 2009 11:40 PM
Hi, Swordfish,
We don't have a sample application at hand. Check out this page http://blogs.msdn.com/sql_service_broker/archive/2009/05/18/get-started-with-using-external-activator.aspx, it should be fairly easy for you to ramp up. Let me know if you need more help.
thanks,
Jun


