Developing JMS applications

The Java™ Message Service (JMS) is a Java API that allows applications to create, send, receive, and read messages. The JMS API defines a common set of interfaces and associated semantics that allow programs that are written in the Java programming language to communicate with other messaging implementations.

For more information about downloading the JMS client, see the IBM Watson IoT Platform - Message Gateway page in IBM Developer.

Why use JMS?

There are benefits to using JMS as the API to write an IBM® IoT MessageSight ready application. Some advantages derive from JMS being an open standard with multiple implementations. Using an open standard provides the following benefits:

  • The protection of investment, both in skills and application code.
  • The availability of people skilled in JMS application programming.
  • The ability to plug in different JMS implementations to fit different requirements.
  • JMS can support more message types than MQTT. Additionally, JMS messages can be configured to include more information than MQTT messages by using message properties. This extra information can be useful when more complex business logic is required in enterprise messaging applications.
  • JMS supports message selectors. Message selectors enable JMS consumer applications to filter the messages that are received from a topic or a queue.

JMS applications that use IBM IoT MessageSight extensions to the JMS 1.1 specification can be compiled and run only with IBM IoT MessageSight JMS client implementations. For example, support in IBM IoT MessageSight for shared subscriptions is an extension to version 1.1 of the JMS specification. If you use this feature in your JMS applications, you will need to compile these applications using the IBM IoT MessageSight JMS client.

Note: When you develop your client applications, do not use the ${ClientID}, ${UserID}, or ${CommonName} keywords in your applications. These keywords are used in connection policies and messaging policies to control access to IBM IoT MessageSight. Using these keywords in your application can lead to policy validation failures.

In addition to support for stand-alone JMS client applications (Java SE applications), IBM IoT MessageSight provides a JMS resource adapter to support Java EE applications on WebSphere® Application Server. For more information about the JMS resource adapter, see IBM IoT MessageSight resource adapter.