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.
Tags
consume, get, jms, message, receive
Properties
In the list below required Properties are shown with an asterisk (*). Other properties are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.
Display Name | API Name | Default Value | Allowable Values | Description |
---|---|---|---|---|
Connection Factory Service | Connection Factory Service | Controller Service: JMSConnectionFactoryProviderDefinition Implementations: JMSConnectionFactoryProvider JndiJmsConnectionFactoryProvider | 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 Name * | Destination Name | The name of the JMS Destination. Usually provided by the administrator (e.g., 'topic://myTopic' or 'myTopic'). Supports Expression Language, using FlowFile attributes and Environment variables. | ||
Destination Type * | Destination Type | QUEUE |
| The type of the JMS Destination. Could be one of 'QUEUE' or 'TOPIC'. Usually provided by the administrator. Defaults to 'QUEUE' |
Message Selector | Message Selector | The JMS Message Selector to filter the messages that the processor will receive Supports Expression Language, using Environment variables. | ||
User Name | User Name | User Name used for authentication and authorization. Supports Expression Language, using Environment variables. | ||
Password | Password | Password used for authentication and authorization. | ||
Connection Client ID | Connection Client ID | The 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, using Environment variables. | ||
Character Set * | character-set | UTF-8 | The name of the character set to use to construct or interpret TextMessages Supports Expression Language, using FlowFile attributes and Environment variables. | |
Acknowledgement Mode * | Acknowledgement Mode | CLIENT_ACKNOWLEDGE (2) |
| 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 Subscription | Durable subscription | false |
| If 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- Supports Expression Language, using Environment variables. |
Shared Subscription | Shared subscription | false |
| If 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- Supports Expression Language, using Environment variables. |
Subscription Name | Subscription Name | The name of the subscription to use if destination is Topic and is shared or durable. Supports Expression Language, using Environment variables. | ||
Timeout * | Timeout | 1 sec | How long to wait to consume a message from the remote broker before giving up. Supports Expression Language, using Environment variables. | |
Maximum Batch Size * | Maximum Batch Size | 1 | The maximum number of messages to publish or consume in each invocation of the processor. | |
Error Queue Name | Error Queue Name | The 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, using FlowFile attributes and Environment variables. | ||
Record Reader | record-reader | Controller Service: RecordReaderFactory Implementations: AvroReader CEFReader CSVReader ExcelReader GrokReader JsonPathReader JsonTreeReader ReaderLookup ScriptedReader Syslog5424Reader SyslogReader WindowsEventLogReader XMLReader YamlTreeReader | The Record Reader to use for parsing received JMS Messages into Records. | |
Record Writer * | record-writer | Controller Service: RecordSetWriterFactory Implementations: AvroRecordSetWriter CSVRecordSetWriter FreeFormTextRecordSetWriter JsonRecordSetWriter RecordSetWriterLookup ScriptedRecordSetWriter XMLRecordSetWriter | The Record Writer to use for serializing Records before writing them to a FlowFile. This property is only considered if:
| |
Output Strategy * | output-strategy | Use Content as Value |
| The format used to output the JMS message into a FlowFile record. This property is only considered if:
|
JNDI Initial Context Factory Class | java.naming.factory.initial | The fully qualified class name of the JNDI Initial Context Factory Class (java.naming.factory.initial). Supports Expression Language, using Environment variables. | ||
JNDI Provider URL | java.naming.provider.url | The 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, using Environment variables. | ||
JNDI Name of the Connection Factory | connection.factory.name | The name of the JNDI Object to lookup for the Connection Factory. Supports Expression Language, using Environment variables. | ||
JNDI / JMS Client Libraries | naming.factory.libraries | Specifies 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). Supports Expression Language, using Environment variables. | ||
JNDI Principal | java.naming.security.principal | The Principal to use when authenticating with JNDI (java.naming.security.principal). Supports Expression Language, using Environment variables. | ||
JNDI Credentials | java.naming.security.credentials | The Credentials to use when authenticating with JNDI (java.naming.security.credentials). | ||
JMS Connection Factory Implementation Class | cf | The fully qualified name of the JMS ConnectionFactory implementation class (eg. org.apache.activemq.ActiveMQConnectionFactory). Supports Expression Language, using Environment variables. | ||
JMS Client Libraries | cflib | Path 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. Supports Expression Language, using Environment variables. | ||
JMS Broker URI | broker | URI 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, using Environment variables. | ||
JMS SSL Context Service | SSL Context Service | Controller Service: SSLContextService Implementations: StandardRestrictedSSLContextService StandardSSLContextService | The SSL Context Service used to provide client certificate information for TLS/SSL connections. |
Dynamic Properties
Name | Value | Description |
---|---|---|
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: Yes, evaluated using Environment variables. |
Relationships
Name | Description |
---|---|
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. |
success | All FlowFiles that are received from the JMS Destination are routed to this relationship |
Reads Attributes
This processor does not read attributes.
Writes Attributes
Name | Description |
---|---|
jms.messagetype | The JMS message type, can be TextMessage, BytesMessage, ObjectMessage, MapMessage or StreamMessage). |
jms_correlationId | The JMSCorrelationID from the message header. |
jms_deliveryMode | The JMSDeliveryMode from the message header. |
jms_destination | The JMSDestination from the message header. |
jms_expiration | The JMSExpiration from the message header. |
jms_messageId | The JMSMessageID from the message header. |
jms_priority | The JMSPriority from the message header. |
jms_redelivered | The JMSRedelivered from the message header. |
jms_replyTo | The JMSReplyTo from the message header. |
jms_timestamp | The JMSTimestamp from the message header. |
jms_type | The JMSType from the message header. |
other attributes | Each message property is written to an attribute. |
State Management
This component does not store state.
Restricted
Required Permission | Explanation |
---|---|
reference remote resources | Client Library Location can reference resources over HTTP |
Input Requirement
This component does not allow an incoming relationship.
System Resource Considerations
This component does not specify system resource considerations.