Skip to content

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.

ModeDescription
SubscribeSend a message from Neuron to ActiveMQ
PublishPublish 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 NameDescription
DestinationSets the name of the ActiveMQ location to send to or receive messages from.
PersistentSubscribe mode only. Sets the JMS Persistent option.
PrioritySubscribe mode only. Sets the JMS Priority level.
TypeSets the type (Queue or Topic) of the destination.
URISets the ActiveMQ URI.
Publish TopicPublish 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 NameDescription
activemq_out.JMSReplyToSets the queue or topic the sender expects replies to. The ReplyToType property must be set when using this property.
activemq_out.ReplyToTypeSets the destination type when using the JMSReplyToProperty. Valid values: Queue, TemporaryQueue, Topic, TemporaryTopic.
activemq_out.JMSTypeSets the type of message.
activemq_out.JMSPrioritySets the priority of the message.
activemq_out.JMSDeliveryModeSets the delivery mode.
activemq_out.JMSExpirationSets 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.JMSCorrelationIdThis 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 NameDescription
activemq_in.MessageTypeThe type of message: BytesMessage, TextMessage, MapMessage or ObjectMessage. If the type is not recognized, the value will be “Unknown”.
activemq_out.MessageTypeThe type of message: BytesMessage, TextMessage, MapMessage or ObjectMessage. If the type is not recognized, the value will be “Unknown”.
activemq_in.JMSCorrelationIdThis header is set by the application for use by other applications.
activemq_out.JMSCorrelationIdThis header is set by the application for use by other applications.
activemq_in.JMSDestinationThe destination from which the message was received from.
activemq_in.DestinationTypeThe type of the JMSDestination.
activemq_in.JMSExpirationThe 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.JMSExpirationThe 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.JMSMessageIdThe message ID.
activemq_in.JMSDeliveryModeThe delivery mode.
activemq_out.JMSDeliveryModeThe delivery mode.
activemq_in.JMSPriorityThe message priority.
activemq_out.JMSPriorityThe message priority.
activemq_in.JMSRedeliveredIndicates the message is being redelivered. Set by the JMS provider.
activemq_in.JMSReplyToThe destination where a reply message should be sent.
activemq_out.JMSReplyToThe destination where a reply message should be sent.
activemq_in.JMSTimestampThe timestamp of the message.
activemq_in.JMSTypeThe type of message.
activemq_out.JMSTypeThe 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.

Was this article helpful?
Dislike 0
Previous: Apple Push Notification Service Adapter
Next: Active Directory Adapter