API Overview


Java applications use the javax.jms package to send or receive messages. This is a standard set of interfaces, specified by the JMS specification, for creating the connection to the EMS server, specifying the type of message to send, and creating the destination (topic or queue) to send to or receive from. You can find a description of the javax.jms package in TIBCO Enterprise Message Service Java API Reference included in the online documentation.

The JMS specification also allows vendor-specific implementations of several features. TIBCO Enterprise Message Service provides a package containing classes and constants for all TIBCO-specific aspects of TIBCO Enterprise Message Service. See the description of the com.tibco.tibems package in TIBCO Enterprise Message Service Java API Reference included in the online documentation.

C and C# Client APIs

TIBCO Enterprise Message Service includes parallel APIs for clients written in C or in C#. For details, see TIBCO Enterprise Message Service C & COBOL API Reference (online documentation), and TIBCO Enterprise Message Service .NET API Reference.

Programming Model

Figure 4 illustrates the interfaces involved in the EMS API.

Figure 4 JMS API programming model

Applications using the point to point (queues) or publish and subscribe (topics) models use the same interfaces to create objects. The JMS specification refers to these interfaces as common facilities because these interfaces create objects that can be used for either topics or queues.

Previous versions of the JMS specification defined specific interfaces for topics and for queues. While these interfaces continue to be supported, they may be deprecated in future releases of the JMS specification. You should use the common facilities in your new EMS applications and upgrade old applications to use the common facilities at your earliest convenience.

The JMS API interfaces prior to the JMS 1.1 specification have the same structure as the common facilities, but the interfaces are specific to topics or queues. Figure 5 illustrates the previous interface model used by the JMS API.

Figure 5 Specific interfaces for topics and queues

Table 3 summarizes the interfaces used in the JMS API.

Table 3 API object summary (Sheet 1 of 2)
Common Facilities Interfaces
Specific Interfaces
Description
ConnectionFactory
QueueConnectionFactory
TopicConnectionFactory
Object used to create connections to EMS server.
Connection
QueueConnection
TopicConnection
A connection encapsulates a physical connection with a provider (server). Connections are used to create sessions.
Session
QueueSession
TopicSession
A session is a single-threaded object that creates instances of message producers, message consumers, messages and transacted message groups.
Sessions can also be transacted. In a transacted session, a group of messages are sent and received in a single transaction.
MessageProducer
QueueSender
TopicPublisher
A message producer is an object created by a session that is used for sending messages to a destination.
MessageConsumer
QueueBrowser
QueueReceiver
TopicSubscriber
A message consumer is an object created by a session that receives messages sent to a destination.
MessageListener
 
A message listener is an object that acts as an asynchronous event handler for messages. Message listeners must be registered with a specific MessageConsumer.
MessageSelector
 
Message selectors are optional filters that can be used by the application. They transfer the filtering work to the message provider, rather than the message consumer.
A message selector is a String that contains an expression. The syntax of the expression is based on a subset of the SQL92 conditional expression syntax.
Message
 
Several types of message bodies are available for queues and topics.
Queue
Topic
Queue
Topic
The destination that messages can be sent to or received from.
Normally these are created and managed by the server, but clients can create destinations dynamically by using methods on the Session object.

The following sections describe many of the API interfaces. Queues and Topics are described in Chapter 3, Working With Destinations. Messages are described in Chapter 4, Working With Messages.


TIBCO Enterprise Message Service™ User’s Guide
Software Release 4.3, February 2006
Copyright © TIBCO Software Inc. All rights reserved
www.tibco.com