ConsumeJMS 2.1.0

Bundle
org.apache.nifi | nifi-jms-processors-nar
Description
Consumes JMS Message of type BytesMessage, TextMessage, ObjectMessage, MapMessage or StreamMessage transforming its content to a FlowFile and transitioning it to 'success' relationship. JMS attributes such as headers and properties will be copied as FlowFile attributes. MapMessages will be transformed into JSONs and then into byte arrays. The other types will have their raw contents as byte array transferred into the flowfile.
Tags
consume, get, jms, message, receive
Input Requirement
FORBIDDEN
Supports Sensitive Dynamic Properties
false
  • Additional Details for ConsumeJMS 2.1.0

    ConsumeJMS

    Summary

    This processor consumes messages from JMS compliant messaging system and converts them to a FlowFile to be routed to the next component in the flow.

    This processor does two things. It constructs FlowFile by extracting information from the consumed JMS message including body, standard JMS Headers and Properties. The message body is written to a FlowFile while standard JMS Headers and Properties are set as FlowFile attributes.

    Configuration Details

    At the time of writing this document it only defines the essential configuration properties which are suitable for most cases. Other properties will be defined later as this component progresses. Configuring ConsumeJMS:

    1. User Name - [OPTIONAL] User Name used for authentication and authorization when this processor obtains javax.jms.Connection from the pre-configured javax.jms.ConnectionFactory (see below).
    2. Password - [OPTIONAL] Password used in conjunction with User Name.
    3. Destination Name - [REQUIRED] the name of the javax.jms.Destination. Usually provided by administrator ( e.g., ’topic://myTopic’).
    4. Destination Type - [REQUIRED] the type of the javax.jms.Destination. Could be one of ‘QUEUE’ or ‘TOPIC’ Usually provided by the administrator. Defaults to ‘QUEUE’.

    Connection Factory Configuration

    There are multiple ways to configure the Connection Factory for the processor:

    • Connection Factory Service property - link to a pre-configured controller service ( JndiJmsConnectionFactoryProvider or JMSConnectionFactoryProvider)
    • JNDI * properties - processor level configuration, the properties are the same as the properties of JndiJmsConnectionFactoryProvider controller service, the dynamic properties can also be used in this case
    • JMS * properties - processor level configuration, the properties are the same as the properties of JMSConnectionFactoryProvider controller service, the dynamic properties can also be used in this case

    The preferred way is to use the Connection Factory Service property and a pre-configured controller service. It is also the most convenient method, because it is enough to configure the controller service once, and then it can be used in multiple processors.

    However, some JMS client libraries may not work with the controller services due to incompatible Java ClassLoader handling between the 3rd party JMS client library and NiFi. Should you encounter java.lang.ClassCastException errors when using the controller services, please try to configure the Connection Factory via the ‘JNDI *’ or the ‘JMS *’ and the dynamic properties of the processor. For more details on these properties, see the documentation of the corresponding controller service (JndiJmsConnectionFactoryProvider for ‘JNDI *’ and JMSConnectionFactoryProvider for ‘JMS *’).

Properties
Dynamic Properties
Restrictions
Required Permission Explanation
reference remote resources Client Library Location can reference resources over HTTP
Relationships
Name Description
success All FlowFiles that are received from the JMS Destination are routed to this relationship
parse.failure If a message cannot be parsed using the configured Record Reader, the contents of the message will be routed to this Relationship as its own individual FlowFile.
Writes Attributes
Name Description
jms_deliveryMode The JMSDeliveryMode from the message header.
jms_expiration The JMSExpiration from the message header.
jms_priority The JMSPriority from the message header.
jms_redelivered The JMSRedelivered from the message header.
jms_timestamp The JMSTimestamp from the message header.
jms_correlationId The JMSCorrelationID from the message header.
jms_messageId The JMSMessageID from the message header.
jms_type The JMSType from the message header.
jms_replyTo The JMSReplyTo from the message header.
jms_destination The JMSDestination from the message header.
jms.messagetype The JMS message type, can be TextMessage, BytesMessage, ObjectMessage, MapMessage or StreamMessage).
other attributes Each message property is written to an attribute.
See Also