PublishJMS 2.0.0

Bundle
org.apache.nifi | nifi-jms-processors-nar
Description
Creates a JMS Message from the contents of a FlowFile and sends it to a JMS Destination (queue or topic) as JMS BytesMessage or TextMessage. FlowFile attributes will be added as JMS headers and/or properties to the outgoing JMS message.
Tags
jms, message, publish, put, send
Input Requirement
REQUIRED
Supports Sensitive Dynamic Properties
false
  • Additional Details for PublishJMS 2.0.0

    PublishJMS

    Summary

    This processor publishes the contents of the incoming FlowFile to a JMS compliant messaging system.

    This processor does two things. It constructs JMS Message by extracting FlowFile contents (both body and attributes). Once message is constructed it is sent to a pre-configured JMS Destination. Standard JMS Headers will be extracted from the FlowFile and set on javax.jms.Message as JMS headers while other FlowFile attributes will be set as properties of javax.jms.Message. Upon success the incoming FlowFile is transferred to the success Relationship and upon failure FlowFile is penalized and transferred to the failure Relationship.

    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 PublishJMS:

    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
System Resource Considerations
Resource Description
MEMORY An instance of this component can cause high usage of this system resource. Multiple instances or high concurrency settings may result a degradation of performance.
Restrictions
Required Permission Explanation
reference remote resources Client Library Location can reference resources over HTTP
Relationships
Name Description
success All FlowFiles that are sent to the JMS destination are routed to this relationship
failure All FlowFiles that cannot be sent to JMS destination are routed to this relationship
Reads Attributes
Name Description
jms_deliveryMode This attribute becomes the JMSDeliveryMode message header. Must be an integer.
jms_expiration This attribute becomes the JMSExpiration message header. Must be a long.
jms_priority This attribute becomes the JMSPriority message header. Must be an integer.
jms_redelivered This attribute becomes the JMSRedelivered message header.
jms_timestamp This attribute becomes the JMSTimestamp message header. Must be a long.
jms_correlationId This attribute becomes the JMSCorrelationID message header.
jms_type This attribute becomes the JMSType message header. Must be an integer.
jms_replyTo This attribute becomes the JMSReplyTo message header. Must be an integer.
jms_destination This attribute becomes the JMSDestination message header. Must be an integer.
other attributes All other attributes that do not start with jms_ are added as message properties.
other attributes .type When an attribute will be added as a message property, a second attribute of the same name but with an extra `.type` at the end will cause the message property to be sent using that strong type. For example, attribute `delay` with value `12000` and another attribute `delay.type` with value `integer` will cause a JMS message property `delay` to be sent as an Integer rather than a String. Supported types are boolean, byte, short, integer, long, float, double, and string (which is the default).
See Also