.. _jms-source-connector-examples: JMS Connector Example Configurations ------------------------------------ These following sections requires running Zookeeper, Kafka, and Connect. For more information, see the :ref:`Kafka Connect quick start guide `. Standalone ^^^^^^^^^^ The first configuration is used typically along with standalone mode: .. sourcecode:: bash name=connector1 tasks.max=1 connector.class=io.confluent.connect.jms.JmsSourceConnector # The following values must be configured. kafka.topic=MyKafkaTopicName jms.destination.name=MyQueueName java.naming.factory.initial= java.naming.provider.url= # The following define the information used to validate the license stored in Kafka. confluent.license= confluent.topic.bootstrap.servers=localhost:9092 Change the ``confluent.topic.*`` properties as required to suit your environment. Leave the ``confluent.license`` property blank for a 30 day trial. See the :ref:`configuration options ` for more details. For example, the following specifies looking up the IBM MQ connection information in LDAP (check the documentation for your JMS broker for more details). .. sourcecode:: bash name=connector1 tasks.max=1 connector.class=io.confluent.connect.jms.JmsSourceConnector # The following values must be configured. kafka.topic=MyKafkaTopicName jms.destination.name=MyQueueName java.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory java.naming.provider.url":"ldap://" java.naming.security.principal=MyUserName java.naming.security.credentials=MyPassword # The following define the information used to validate the license stored in Kafka. confluent.license= confluent.topic.bootstrap.servers=localhost:9092 Distributed ^^^^^^^^^^^ This configuration is used typically along with :ref:`distributed mode `Write the following json to connector.json, configure all of the required values, and use the command below to post the configuration to one the distributed connect worker(s). .. sourcecode:: bash { "name": "connector1", "config": { "connector.class": "io.confluent.connect.jms.JmsSourceConnector", "kafka.topic":"MyKafkaTopicName", "jms.destination.name":"MyQueueName", "java.naming.factory.initial":"", "java.naming.provider.url":"", "confluent.license":"", "confluent.topic.bootstrap.servers":"localhost:9092" } } Change the ``confluent.topic.*`` properties as required to suit your environment. If running on a single-node Kafka cluster you will need to include ``confluent.topic.replication.factor=1``. Leave the ``confluent.license`` property blank for a 30 day trial. See the :ref:`configuration options ` for more details. For example, the following specifies looking up the IBM MQ connection information in LDAP (check the documentation for your JMS broker for more details). .. sourcecode:: bash { "name": "connector1", "config": { "connector.class": "io.confluent.connect.jms.JmsSourceConnector", "kafka.topic":"MyKafkaTopicName", "jms.destination.name":"MyQueueName", "jms.destination.type":"queue", "java.naming.factory.initial":"com.sun.jndi.ldap.LdapCtxFactory", "java.naming.provider.url":"ldap://" "java.naming.security.principal":"MyUserName", "java.naming.security.credentials":"MyPassword", "confluent.license":"", "confluent.topic.bootstrap.servers":"localhost:9092" } } Change the ``confluent.topic.*`` properties as required to suit your environment. If running on a single-node Kafka cluster you will need to include ``"confluent.topic.replication.factor":"1"``. Leave the ``confluent.license`` property blank for a 30 day trial. See the :ref:`configuration options ` for more details. Use curl to post the configuration to one of the Kafka Connect Workers. Change ``http://localhost:8083/`` the the endpoint of one of your Kafka Connect worker(s). .. sourcecode:: bash curl -s -X POST -H 'Content-Type: application/json' --data @connector.json http://localhost:8083/connectors