To create a message, you must first create an instance of either a queue or topic session. See “Creating sessions” for details. To create a text message, use this syntax:
// Create a text message using a QueueSession javax.jms.TextMessage queueTextMsg = queueSession.createTextMessage(“Text message”); // Create a text message using a TopicSession javax.jms.TextMessage topicTextMsg = topicSession.createTextMessage(“Text message”);
EAServer supports six message types that a message producer can send or publish. Table 31-1 describes the message types and the javax.jms.Session interface APIs used to create instances of each.
To improve interoperability with non-Java clients or components and to improve message receivers’ ability to filter messages, Sybase recommends that you use either plain messages or text messages. Selectors allow you to filter messages based on the text in the message properties. You cannot filter messages based on the text in the message body. Therefore, message text in the message properties, instead of the message body, enables the message receivers to filter messages more efficiently.
For more information about the message types, see the JMS API documentation.
Copyright © 2003. Sybase Inc. All rights reserved. |
![]() |