ActiveMQ Adapter
The Neuron ActiveMQ adapter can read messages from and write messages to Apache ActiveMQ.
Requirements
This adapter requires Apache ActiveMQ 5.x.
Adapter Modes
The adapter supports the following modes of operation.
Mode | Description |
Subscribe | Send a message from Neuron to ActiveMQ |
Publish | Publish a message from ActiveMQ to Neuron |
Subscribe Mode
When the adapter receives a message from Neuron, the headers and body of the message are sent to ActiveMQ.
Custom and other properties from the Neuron ESBMessage are stored as custom properties in the ActiveMQ message. These names of the properties will be prefixed with “Neuron.Message.Header”.
Publish Mode
When the adapter reads a message from the ActiveMQ destination, the contents of the message will be published to Neuron as an ESBMessage.
Any message received from Neuron will be discarded when the adapter is in publish mode.
Adapter Properties
Property Name | Description |
Destination | Sets the name of the ActiveMQ location to send to or receive messages from. |
Persistent | Subscribe mode only. Sets the JMS Persistent option. |
Priority | Subscribe mode only. Sets the JMS Priority level. |
Type | Sets the type (Queue or Topic) of the destination. |
URI | Sets the ActiveMQ URI. |
Publish Topic | Publish mode only. Sets the topic to publish the message to. |
When specifying the publish topic, ensure that the configured party for the adapter endpoint has a publish subscription to the topic.
Adapter Metadata
Subscribe Mode
When the Neuron adapter endpoint has the include metadata option set, then the adapter will look for the following properties in the ESBMessage received from Neuron. The adapter metadata must be specified in the custom properties of the message header.
The names of the properties are case sensitive.
All of the adapter metadata properties are optional even when the include metadata option is set.
Property Name | Description |
activemq_out.JMSReplyTo | Sets the queue or topic the sender expects replies to. The ReplyToType property must be set when using this property. |
activemq_out.ReplyToType | Sets the destination type when using the JMSReplyToProperty. Valid values: Queue, TemporaryQueue, Topic, TemporaryTopic. |
activemq_out.JMSType | Sets the type of message. |
activemq_out.JMSPriority | Sets the priority of the message. |
activemq_out.JMSDeliveryMode | Sets the delivery mode. |
activemq_out.JMSExpiration | Sets the message expiration. A value of zero means that the message does not expire. Any other value denotes the expiration time for when the message is removed from the destination. The value of this property is a 64-bit signed integer value which represents the number of 100-nanosecond intervals that have elapsed since 12:00:00 midnight, January 1, 0001. See the MSDN documentation for DateTime.Ticks. |
activemq_out.JMSCorrelationId | This header is set by the application for use by other applications. |
Publish Mode
When the Neuron adapter endpoint has the include metadata option set, the following properties will be added to the Neuron ESBMessage as custom properties in the message header.
Property Name | Description |
activemq_in.MessageType | The type of message: BytesMessage, TextMessage, MapMessage or ObjectMessage. If the type is not recognized, the value will be “Unknown”. |
activemq_out.MessageType | The type of message: BytesMessage, TextMessage, MapMessage or ObjectMessage. If the type is not recognized, the value will be “Unknown”. |
activemq_in.JMSCorrelationId | This header is set by the application for use by other applications. |
activemq_out.JMSCorrelationId | This header is set by the application for use by other applications. |
activemq_in.JMSDestination | The destination from which the message was received from. |
activemq_in.DestinationType | The type of the JMSDestination. |
activemq_in.JMSExpiration | The expiration time of the message. A value of zero means that the message does not expire. Any other value denotes the expiration time for when the message is removed from the destination. The value of this property is a 64-bit signed integer value which represents the number of 100-nanosecond intervals that have elapsed since 12:00:00 midnight, January 1, 0001. See the MSDN documentation for DateTime.Ticks. |
activemq_out.JMSExpiration | The expiration time of the message. A value of zero means that the message does not expire. Any other value denotes the expiration time for when the message is removed from the destination. The value of this property is a 64-bit signed integer value which represents the number of 100-nanosecond intervals that have elapsed since 12:00:00 midnight, January 1, 0001. See the MSDN documentation for DateTime.Ticks. |
activemq_in.JMSMessageId | The message ID. |
activemq_in.JMSDeliveryMode | The delivery mode. |
activemq_out.JMSDeliveryMode | The delivery mode. |
activemq_in.JMSPriority | The message priority. |
activemq_out.JMSPriority | The message priority. |
activemq_in.JMSRedelivered | Indicates the message is being redelivered. Set by the JMS provider. |
activemq_in.JMSReplyTo | The destination where a reply message should be sent. |
activemq_out.JMSReplyTo | The destination where a reply message should be sent. |
activemq_in.JMSTimestamp | The timestamp of the message. |
activemq_in.JMSType | The type of message. |
activemq_out.JMSType | The type of message. |
In addition to the properties above, all custom properties in the ActiveMQ message will be set as custom properties in the header of the ESBMessage. The names of the properties will be prefixed with “activemq_in.”
Message Format
Subscribe Mode
The body of the ESBMessage received from Neuron will become the body of the ActiveMQ message. If the Binary ESBMessage header is set, then the ActiveMQ message will be a BytesMessage. Otherwise, by default, the ActiveMQ message will be a TextMessage.
To explicitly set the type of ActiveMQ message, set the custom header “activemq_out.MessageType”. The supported values are:
- BytesMessage
- TextMessage
- MapMessage
- ObjectMessage
Publish Mode
The body of the ActiveMQ message will become the body of the ESBMessage that is published to Neuron.