Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 12 Developing an EMS Client Application : JMS Specification

JMS Specification
EMS implements the JMS 2.0 specification, which is backward compatible with earlier versions of the specification.
While the old JMS 1.0.2b interfaces are still supported, newly developed applications should use the JMS 2.0 or 1.1 interfaces instead. It is recommended to avoid using 1.0.2b interfaces, in particular due to their lack of flexibility. With these, an application initially written to work with topics has to be reworked if it needs to use queues, whereas an application based on the 1.1 or 2.0 APIs relies on a generic destination infrastructure that would not need to be altered significantly.
To get a better understanding and illustration of how the various JMS objects relate to each other, refer to the JMS Specification and to the samples client applications provided with EMS.
The code examples in this chapter illustrate the use of the JMS 2.0 interface.
JMS 2.0 Specification
The JMS 2.0 specification introduces several new features, including delivery delay, shared subscriptions, asynchronous sending and the Simplified API.
The Simplified API is offered in addition to the API originally provided with JMS 1.1, which is now called the Classic API. The Simplified API is less verbose than the Classic API, and introduces several important new objects:
JMSContext  is used to create messages, as well as JMS consumers and JMS producers. Each JMS context uses one session and one connection, but does not expose those. Additionally, multiple JMS context objects can share the same connection.
JMSConsumer  is a message consumer that has the ability to receive a message body without the need to use a Message object.
JMSProducer  is similar to an anonymous message producer, and provides a convenient API for configuring delivery options, message properties, and message headers.
Methods in the Simplified API throw unchecked exceptions rather than checked exceptions. For a sample showing the Simplified API in use, see the new Java sample file called tibjmsJMSContextSendRecv.java. This sample file demonstrates the Simplified API in the simplest possible way; for greater detail, refer to the Java API Reference Pages.
JMS 1.1 Specification
In the JMS 1.1 specification, 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.
JMS 1.0.2b Specification
The JMS 1.0.2b specification defined specific interfaces for topics and for queues.
The JMS 1.0.2b interfaces have the same structure as the JMS 1.1 common facilities, but the interfaces are specific to topics or queues.

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved