.. _activemq-source-connector-examples:


Example Configurations
----------------------

These following sections requires running |zk|, |ak-tm|, and |kconnect|.
For more information, see the :ref:`Kafka Connect quick start guide <connect_quickstart>`.


Standalone
^^^^^^^^^^

The first configuration is used typically along with ::ref:`standalone mode <standalone-workers>`.

.. codewithvars:: bash

   name=connector1
   tasks.max=1
   connector.class=io.confluent.connect.activemq.ActiveMQSourceConnector
   # The following values must be configured.
   kafka.topic=MyKafkaTopicName
   activemq.url=tcp://localhost:61616
   jms.destination.name=testing
   # The following define the information used to validate the license stored in Kafka
   # or leave blank for a 30 day trial
   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 |ak| 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 <activemq-source-connector-license-config>` for more details.



.. note::
   Be sure to check the 
   :ref:`connector configuration properties <activemq-source-connector-config>`   for other options when connecting to ActiveMQ, and the
   `ActiveMQ documentation <http://activemq.apache.org/connection-configuration-uri.html>`_
   for details about the ActiveMQ URL parameters.


Distributed
^^^^^^^^^^^

This configuration is used typically along with :ref:`distributed mode <distributed-workers>`.
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).

.. codewithvars:: bash

   {
     "name": "connector1",
     "config": {
       "connector.class": "io.confluent.connect.activemq.ActiveMQSourceConnector",
       "kafka.topic":"MyKafkaTopicName",
       "activemq.url":"tcp://localhost:61616",
       "jms.destination.name":"testing",
       "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 |ak| 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 <activemq-source-connector-license-config>` for more details.



.. note::
   Be sure to check the 
   For other options when connecting to ActiveMQ, see the
   :ref:`connector configuration properties <activemq-source-connector-config>`   , and for details about the ActiveMQ URL parameters, see the
   `ActiveMQ documentation <http://activemq.apache.org/connection-configuration-uri.html>`_
   .


Use curl to post the configuration to one of the |kconnect-long| Workers.
Change ``http://localhost:8083/`` the endpoint of one of your |kconnect-long| worker(s).

.. codewithvars:: bash

   curl -s -X POST -H 'Content-Type: application/json' --data @connector.json http://localhost:8083/connectors