ConsumeJMS 2025.10.9.21

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

Properties

PropertyDescription
Acknowledgement ModeThe JMS Acknowledgement Mode. Using Auto Acknowledge can cause messages to be lost on restart of NiFi but may provide better performance than Client Acknowledge.
Connection Client IDThe client id to be set on the connection, if set. For durable non shared consumer this is mandatory, for all others it is optional, typically with shared consumers it is undesirable to be set. Please see JMS spec for further details
Connection Factory ServiceThe Controller Service that is used to obtain Connection Factory. Alternatively, the ‘JNDI *’ or the ‘JMS *’ properties can also be used to configure the Connection Factory.
Destination NameThe name of the JMS Destination. Usually provided by the administrator (e.g., ‘topic://myTopic’ or ‘myTopic’).
Destination TypeThe type of the JMS Destination. Could be one of ‘QUEUE’ or ‘TOPIC’. Usually provided by the administrator. Defaults to ‘QUEUE’
Durable subscriptionIf destination is Topic if present then make it the consumer durable. @see https://jakarta.ee/specifications/platform/9/apidocs/jakarta/jms/session#createDurableConsumer-jakarta.jms. Topic-java.lang. String-
Error Queue NameThe name of a JMS Queue where - if set - unprocessed messages will be routed. Usually provided by the administrator (e.g., ‘queue://myErrorQueue’ or ‘myErrorQueue’).Only applicable if ‘Destination Type’ is set to ‘QUEUE’
Maximum Batch SizeThe maximum number of messages to publish or consume in each invocation of the processor.
Message SelectorThe JMS Message Selector to filter the messages that the processor will receive
PasswordPassword used for authentication and authorization.
SSL Context ServiceThe SSL Context Service used to provide client certificate information for TLS/SSL connections.
Shared subscriptionIf destination is Topic if present then make it the consumer shared. @see https://jakarta.ee/specifications/platform/9/apidocs/jakarta/jms/session#createSharedConsumer-jakarta.jms. Topic-java.lang. String-
Subscription NameThe name of the subscription to use if destination is Topic and is shared or durable.
TimeoutHow long to wait to consume a message from the remote broker before giving up.
User NameUser Name used for authentication and authorization.
brokerURI pointing to the network location of the JMS Message broker. Example for ActiveMQ: ‘tcp://myhost:61616’. Examples for IBM MQ: ‘myhost(1414)’ and ‘myhost01(1414),myhost02(1414)’.
cfThe fully qualified name of the JMS ConnectionFactory implementation class (eg. org.apache.activemq. ActiveMQConnectionFactory).
cflibPath to the directory with additional resources (eg. JARs, configuration files etc.) to be added to the classpath (defined as a comma separated list of values). Such resources typically represent target JMS client libraries for the ConnectionFactory implementation.
character-setThe name of the character set to use to construct or interpret TextMessages
connection.factory.nameThe name of the JNDI Object to lookup for the Connection Factory.
java.naming.factory.initialThe fully qualified class name of the JNDI Initial Context Factory Class (java.naming.factory.initial).
java.naming.provider.urlThe URL of the JNDI Provider to use as the value for java.naming.provider.url. See additional details documentation for allowed URL schemes.
java.naming.security.credentialsThe Credentials to use when authenticating with JNDI (java.naming.security.credentials).
java.naming.security.principalThe Principal to use when authenticating with JNDI (java.naming.security.principal).
naming.factory.librariesSpecifies jar files and/or directories to add to the ClassPath in order to load the JNDI / JMS client libraries. This should be a comma-separated list of files, directories, and/or URLs. If a directory is given, any files in that directory will be included, but subdirectories will not be included (i.e., it is not recursive).
output-strategyThe format used to output the JMS message into a FlowFile record.
record-readerThe Record Reader to use for parsing received JMS Messages into Records.
record-writerThe Record Writer to use for serializing Records before writing them to a FlowFile.

Restrictions

Required PermissionExplanation
reference remote resourcesClient Library Location can reference resources over HTTP

Relationships

NameDescription
parse.failureIf 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.
successAll FlowFiles that are received from the JMS Destination are routed to this relationship

Writes attributes

NameDescription
jms_deliveryModeThe JMSDeliveryMode from the message header.
jms_expirationThe JMSExpiration from the message header.
jms_priorityThe JMSPriority from the message header.
jms_redeliveredThe JMSRedelivered from the message header.
jms_timestampThe JMSTimestamp from the message header.
jms_correlationIdThe JMSCorrelationID from the message header.
jms_messageIdThe JMSMessageID from the message header.
jms_typeThe JMSType from the message header.
jms_replyToThe JMSReplyTo from the message header.
jms_destinationThe JMSDestination from the message header.
jms.messagetypeThe JMS message type, can be TextMessage, BytesMessage, ObjectMessage, MapMessage or StreamMessage).
other attributesEach message property is written to an attribute.

See also