Sending and receiving messages from a queue  Working with message properties

Chapter 2: Overview of Real Time Messaging Services

Publishing and consuming messages from a topic

Using the built-in functions msgpublish and msgconsume, Transact-SQL applications can publish messages to, or consume messages from, a JMS topic.

First, you must register a subscription, using sp_msgadmin 'register'. Registering a subscription creates a name that msgpublish, msgconsume, msgsubscribe, and msgunsubscribe can reference. A subscription can be registered as a durable or nondurable subscription, and you can specify a message selector to control the messages that come in, ensuring that only messages of interest are read.

You can use msgsubscribe to tell the JMS provider to hold messages until the application logic is ready to process them. Use msgunsubscribe to tell the JMS provider that the application is no longer interested in messages on this subscription. msgunsubscribe can also delete durable subscriptions from the JMS provider.

Message properties in read messages can be individually processed by the application logic.





Copyright © 2004. Sybase Inc. All rights reserved. Working with message properties

View this book as PDF