This document defines how to describe JMS-specific information on AsyncAPI.
The version of this bindings specification is 0.0.1
.
This is also the bindingVersion
for all binding objects defined by this specification.
In any given binding object, latest
MAY alternatively be used to refer to the currently latest published version of this bindings specification.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this bindings specification are to be interpreted as described in IETF RFC2119.
These bindings use the jms
protocol in AsyncAPI documents to denote connections to and interactions with JMS message brokers.
JMS is not technically a protocol, rather it is an API. A JMS Provider implements the JMS API and may define a protocol for implementing JMS API operations. Regardless, for the purposes of AsyncAPI we can treat it like a "protocol" to enable AsyncAPI definitions that are somewhat portable between various JMS Providers. If necessary, the user is free to combine this binding with other bindings that implement a JMS Provider (e.g. Apache Pulsar, Amazon SQS, IBM MQ, etc.) to detail JMS Provider specific configuration.
NOTE that from protocol version 3.0, this binding is compatible with Jakarta Messaging.
The fields of the standard Server Object are constrained and interpreted as follows:
The JMS Server Binding Object is defined by a JSON Schema, which defines these fields:
Field Name | Type | Description |
---|---|---|
jmsConnectionFactory |
string | REQUIRED. The classname of the ConnectionFactory implementation for the JMS Provider. |
properties |
Schema Array | OPTIONAL. Additional properties to set on the JMS ConnectionFactory implementation for the JMS Provider. |
clientID |
string | OPTIONAL. A client identifier for applications that use this JMS connection factory. If the Client ID Policy is set to 'Restricted' (the default), then configuring a Client ID on the ConnectionFactory prevents more than one JMS client from using a connection from this factory. |
bindingVersion |
string | OPTIONAL, defaults to latest . The version of this binding. |
The following example shows a servers
object with a server binding object for jms
with JMS specific properties:
servers:
production:
url: jms://my-activemq-broker:61616
protocol: jms
protocolVersion: '1.1'
description: The production ActiveMQ broker accessed via JMS.
bindings:
jms:
# JMS protocol specific server details
jmsConnectionFactory: org.apache.activemq.ActiveMQConnectionFactory
properties:
- name: disableTimeStampsByDefault
value: false
clientID: my-application-1
The JMS Channel Binding Object is defined by a JSON Schema, which defines these fields:
The following example shows a channels
object with two channels, the second having a channel binding object for jms
:
channels:
user.signup:
description: This application receives command messages from this channel about users to sign up.
bindings:
jms:
destination: user-sign-up
destinationType: fifo-queue
bindingVersion: '0.0.1'
publish:
#...
This object MUST NOT contain any properties. Its name is reserved for future use.
The JMS Message Binding Object is defined by a JSON Schema, which defines these fields:
Field Name | Type | Description |
---|---|---|
headers |
Schema Object | OPTIONAL. A Schema object containing the definitions for JMS specific headers (so-called protocol headers). This schema MUST be of type object and have a properties key. Examples of JMS protocol headers are JMSMessageID , JMSTimestamp , and JMSCorrelationID . |
bindingVersion |
string | OPTIONAL, defaults to latest . The version of this binding. |
Note that application headers must be specified in the headers
field of the standard Message Object and are set as Message Properties of the JMS Message; how they are transmitted is defined by the JMS Provider and need not be considered here.
In contrast, protocol headers such as JMSMessageID
must be specified in the headers
field of the message binding object and are transmitted in the headers
section of the JMS message.
The following example shows a message
object with both application specific headers, and a message binding object for jms
with JMS specific headers:
message:
messageId: my-message-1
bindings:
jms:
headers:
# JMS protocol specific message headers
required:
- JMSMessageID
properties:
JMSMessageID:
name: JMSMessageID
description: A unique message identifier. This may be set by your JMS Provider on your behalf.
type: string
JMSReplyTo:
name: JMSReplyTo
description: The queue or topic that the message sender expects replies to.
type: string
headers:
# Application specific message headers
required:
- MyToken
- MyOperationID
properties:
MyToken:
name: MyToken
description: Some sort of identificaton token for the publishing application.
type: string
MyOperationID:
name: MyOperationID
description: Some sort of unique identifier for the application operation to perform.
type: string