Transact-SQL applications can publish messages to – or consume messages from – a JMS topic with the msgpublish and msgconsume functions. You must first register a subscription with sp_msgadmin 'register', which creates a name that msgpublish, msgconsume, msgsubscribe, and msgunsubscribe can reference. A subscription can be registered as either durable or non-durable:
A durable subscription retains messages for the message consumer even when the message consumer application is not connected. The message provider, not Adaptive Server, retains the message
A nondurable subscription retains messages only when consumer applications are connected to the message provider.
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 inform the JMS provider to hold messages until the Adaptive Server application is ready to process them, and you can use msgunsubscribe to inform 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 messages that have been read can be individually processed by the application.
Copyright © 2004. Sybase Inc. All rights reserved. |
![]() |