ConsumeJMS

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.

Additional Details...

Tags:

jms, get, message, receive, consume

Properties:

In the list below, the names of required properties appear in bold. Any other properties (not in bold) are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.

Display NameAPI NameDefault ValueAllowable ValuesDescription
Connection Factory ServiceConnection Factory ServiceController Service API:
JMSConnectionFactoryProviderDefinition
Implementations: JndiJmsConnectionFactoryProvider
JMSConnectionFactoryProvider
The Controller Service that is used to obtain Connection Factory. Alternatively, the 'JNDI *' or the 'JMS *' properties can also be be used to configure the Connection Factory.
Destination NameDestination NameThe name of the JMS Destination. Usually provided by the administrator (e.g., 'topic://myTopic' or 'myTopic').
Supports Expression Language: true (will be evaluated using variable registry only)
Destination TypeDestination TypeQUEUE
  • QUEUE
  • TOPIC
The type of the JMS Destination. Could be one of 'QUEUE' or 'TOPIC'. Usually provided by the administrator. Defaults to 'QUEUE'
Message SelectorMessage SelectorThe JMS Message Selector to filter the messages that the processor will receive
Supports Expression Language: true (will be evaluated using variable registry only)
User NameUser NameUser Name used for authentication and authorization.
Supports Expression Language: true (will be evaluated using variable registry only)
PasswordPasswordPassword used for authentication and authorization.
Sensitive Property: true
Connection Client IDConnection 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
Supports Expression Language: true (will be evaluated using variable registry only)
Session Cache SizeSession Cache size1This property is deprecated and no longer has any effect on the Processor. It will be removed in a later version.
Character Setcharacter-setUTF-8The name of the character set to use to construct or interpret TextMessages
Supports Expression Language: true (will be evaluated using variable registry only)
Acknowledgement ModeAcknowledgement ModeCLIENT_ACKNOWLEDGE (2)
  • AUTO_ACKNOWLEDGE (1) Automatically acknowledges a client's receipt of a message, regardless if NiFi session has been commited. Can result in data loss in the event where NiFi abruptly stopped before session was commited.
  • CLIENT_ACKNOWLEDGE (2) (DEFAULT) Manually acknowledges a client's receipt of a message after NiFi Session was commited, thus ensuring no data loss
  • DUPS_OK_ACKNOWLEDGE (3) This acknowledgment mode instructs the session to lazily acknowledge the delivery of messages. May result in both data duplication and data loss while achieving the best throughput.
The JMS Acknowledgement Mode. Using Auto Acknowledge can cause messages to be lost on restart of NiFi but may provide better performance than Client Acknowledge.
Durable SubscriptionDurable subscriptionfalse
  • true
  • false
If destination is Topic if present then make it the consumer durable. @see https://docs.oracle.com/javaee/7/api/javax/jms/Session.html#createDurableConsumer-javax.jms.Topic-java.lang.String-
Supports Expression Language: true (will be evaluated using variable registry only)
Shared SubscriptionShared subscriptionfalse
  • true
  • false
If destination is Topic if present then make it the consumer shared. @see https://docs.oracle.com/javaee/7/api/javax/jms/Session.html#createSharedConsumer-javax.jms.Topic-java.lang.String-
Supports Expression Language: true (will be evaluated using variable registry only)
Subscription NameSubscription NameThe name of the subscription to use if destination is Topic and is shared or durable.
Supports Expression Language: true (will be evaluated using variable registry only)
TimeoutTimeout1 secHow long to wait to consume a message from the remote broker before giving up.
Supports Expression Language: true (will be evaluated using variable registry only)
Error Queue NameError 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'
Supports Expression Language: true (will be evaluated using variable registry only)
Record Readerrecord-readerController Service API:
RecordReaderFactory
Implementations: GrokReader
JsonTreeReader
WindowsEventLogReader
ReaderLookup
ParquetReader
CSVReader
Syslog5424Reader
ExcelReader
CEFReader
XMLReader
ScriptedReader
SyslogReader
JsonPathReader
AvroReader
YamlTreeReader
The Record Reader to use for parsing received JMS Messages into Records.
Record Writerrecord-writerController Service API:
RecordSetWriterFactory
Implementations: FreeFormTextRecordSetWriter
CSVRecordSetWriter
ParquetRecordSetWriter
RecordSetWriterLookup
ScriptedRecordSetWriter
XMLRecordSetWriter
JsonRecordSetWriter
AvroRecordSetWriter
The Record Writer to use for serializing Records before writing them to a FlowFile.

This Property is only considered if the [Record Reader] Property has a value specified.
Output Strategyoutput-strategyUse Content as Value
  • Use Content as Value Write only the message to the FlowFile record.
  • Use Wrapper Write the additional attributes into the FlowFile record on a separate leaf. (See processor usage for more information.)
  • Use Appender Write the additional attributes into the FlowFile record prefixed with "_". (See processor usage for more information.)
The format used to output the JMS message into a FlowFile record.

This Property is only considered if the [Record Reader] Property has a value specified.
JNDI Initial Context Factory Classjava.naming.factory.initialThe fully qualified class name of the JNDI Initial Context Factory Class (java.naming.factory.initial).
Supports Expression Language: true (will be evaluated using variable registry only)
JNDI Provider URLjava.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.
Supports Expression Language: true (will be evaluated using variable registry only)
JNDI Name of the Connection Factoryconnection.factory.nameThe name of the JNDI Object to lookup for the Connection Factory.
Supports Expression Language: true (will be evaluated using variable registry only)
JNDI / JMS Client Librariesnaming.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).

This property expects a comma-separated list of resources. Each of the resources may be of any of the following types: directory, file, URL.

Supports Expression Language: true (will be evaluated using variable registry only)
JNDI Principaljava.naming.security.principalThe Principal to use when authenticating with JNDI (java.naming.security.principal).
Supports Expression Language: true (will be evaluated using variable registry only)
JNDI Credentialsjava.naming.security.credentialsThe Credentials to use when authenticating with JNDI (java.naming.security.credentials).
Sensitive Property: true
JMS Connection Factory Implementation ClasscfThe fully qualified name of the JMS ConnectionFactory implementation class (eg. org.apache.activemq.ActiveMQConnectionFactory).
Supports Expression Language: true (will be evaluated using variable registry only)
JMS Client LibrariescflibPath 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.

This property expects a comma-separated list of resources. Each of the resources may be of any of the following types: directory, file, URL.

Supports Expression Language: true (will be evaluated using variable registry only)
JMS Broker URIbrokerURI 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)'.
Supports Expression Language: true (will be evaluated using variable registry only)
JMS SSL Context ServiceSSL Context ServiceController Service API:
SSLContextService
Implementations: StandardSSLContextService
StandardRestrictedSSLContextService
The SSL Context Service used to provide client certificate information for TLS/SSL connections.

Dynamic Properties:

Supports Sensitive Dynamic Properties: No

Dynamic Properties allow the user to specify both the name and value of a property.

NameValueDescription
The name of a Connection Factory configuration property.The value of a given Connection Factory configuration property.Additional configuration property for the Connection Factory. It can be used when the Connection Factory is being configured via the 'JNDI *' or the 'JMS *'properties of the processor. For more information, see the Additional Details page.
Supports Expression Language: true (will be evaluated using variable registry only)

Relationships:

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

Reads Attributes:

None specified.

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.

State management:

This component does not store state.

Restricted:

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

Input requirement:

This component does not allow an incoming relationship.

System Resource Considerations:

None specified.

See Also:

PublishJMS, JMSConnectionFactoryProvider