JMS Source connector

The JMS Source connector is a Stateless NiFi dataflow developed by Cloudera that is running in the Kafka Connect framework. Learn about the connector, its properties, and configuration.

The JMS Source Connector consumes messages from a JMS broker and transfers the message body to Kafka. The Kafka topic this connector transfers messages to is determined by the value of the topics parameter in the configuration. The JMS Source connector does not perform record processing, the messages are transferred to Kafka as they are consumed from the JMS broker.

TLS can be used to establish a secure connection between the connector and the JMS broker. The keystore and truststore files necessary for securing the connection must be present on the cluster node that the connector runs on.

Properties and configuration

Configuration is passed to the connector in a JSON file during creation. The properties of the connector can be categorized into three groups. These are as follows:

Common connector properties
These are the properties of the Kafka Connect framework that are accepted by all connectors. For a comprehensive list of these properties, see the Apache Kafka documentation.
Stateless NiFi Source properties
These are the properties that are specific to the Stateless NiFi Source connector. All Stateless NiFi Source connectors share and accept these properties. For a comprehensive list of these properties, see the Stateless NiFi Source property reference.
Connector/dataflow-specific properties
These properties are unique to this specific connector. Or to be more precise, unique to the dataflow running within the connector. These properties use the following prefix:
parameter.[***CONNECTOR NAME***] Parameters:
For a comprehensive list of these properties, see the JMS Source properties reference.

Notes and limitations

  • Required properties must be assigned a valid value even if they are not used in the particular configuration. If a required property is not used, either leave its default value, or completely remove the property from the configuration JSON.
  • If a property that has a default value is completely removed from the configuration JSON, the system uses the default value.
  • Properties not marked as required must be completely removed from the configuration JSON if not set.

Configuration example

In this example, the connector connects to an ActiveMQ Message Broker using a secured connection and username/password authentication.
{
 "connector.class": "org.apache.nifi.kafka.connect.StatelessNiFiSourceConnector",
 "meta.smm.predefined.flow.name": "JMS Source",
 "meta.smm.predefined.flow.version": "1.0.0",
 "key.converter": "org.apache.kafka.connect.storage.StringConverter",
 "value.converter": "org.apache.kafka.connect.converters.ByteArrayConverter",,
 "tasks.max": "1"
 "nexus.url": "https://repository.cloudera.com/artifactory/repo",
 "extensions.directory": "/tmp/nifi-stateless-extensions",
 "working.directory": "/tmp/nifi-stateless-working",,
 "topics": "[***TOPIC NAME***]"
 "parameter.JMS Source Parameters:JMS Broker URI": "[***BROKER URI***]",
 "parameter.JMS Source Parameters:JMS Client Libraries": "[***PATH TO CLIENT LIBRARIES***]",
 "parameter.JMS Source Parameters:JMS Connection Factory Class Name": "org.apache.activemq.ActiveMQSslConnectionFactory",
 "parameter.JMS Source Parameters:JMS Destination Name": "[***QUEUE NAME***]",
 "parameter.JMS Source Parameters:JMS Destination Type": "QUEUE",
 "parameter.JMS Source Parameters:JMS User Name": "[***USERNAME***]",
 "parameter.JMS Source Parameters:JMS User Password": "[***PASSWORD***]",
 "parameter.JMS Source Parameters:Truststore Filename": "[***PATH TO TRUSTSTORE***]",
 "parameter.JMS Source Parameters:Truststore Password": "[***TRUSTSTORE PASSWORD***]",
 "parameter.JMS Source Parameters:Truststore Type": "[***TRUSTSTORE TYPE***]"
}
The following list collects the properties from the configuration example that must be customized for this use case.
topics
The name of the Kafka topic that the connector sends messages to.
JMS Broker URI
The URI of the ActiveMQ Message Broker. For example, ssl://activemq-hostname:61617.
JMS Client Libraries
The path to the directory containing ActiveMQ client libraries.
JMS Connection Factory Class Name
The Java class name of the ActiveMQ ConnectionFactory implementation.
JMS Destination Name
The name of the destination (in this case a queue) on the ActiveMQ Message Broker that the messages are received from.
JMS Destination Type
The type of the destination. In this example, the type is QUEUE.
JMS User Name
The username used for authenticating to the ActiveMQ Message Broker.
JMS User Password
The password of the user.
Truststore *
These are the properties for accessing the truststore containing the ActiveMQ Message Broker’s certificate used for secure communication.