.. _activemq-sink-connector:
|kconnect-long| ActiveMQ Sink Connector
=======================================
The ActiveMQ Sink Connector is used to move messages from |ak| to an `ActiveMQ `_ cluster.
.. note::
If you are required to use the Java Naming and Directory Interfaceâ„¢ (JNDI) to connect to ActiveMQ,
there is a general :ref:`JMS Sink Connector ` available that uses a
JNDI-based mechanism to connect to the JMS broker.
Prerequisites
-------------
The following are required to run the |kconnect-long| ActiveMQ Sink Connector:
* |ak| Broker: |cp| 3.3.0 or above, or |ak| 0.11.0 or above
* |kconnect|: |cp| 4.1.0 or above, or |ak| 1.1.0 or above (requires header support in |kconnect|)
* `ActiveMQ 5.x `_
* Java 1.8
Install ActiveMQ Sink Connector
-------------------------------
.. include:: ../../includes/connector-install.rst
.. include:: ../../includes/connector-install-hub.rst
.. codewithvars:: bash
confluent-hub install confluentinc/kafka-connect-activemq-sink:latest
.. include:: ../../includes/connector-install-version.rst
.. codewithvars:: bash
confluent-hub install confluentinc/kafka-connect-activemq-sink:1.0.0-preview
--------------------------
Install Connector Manually
--------------------------
`Download and extract the ZIP file `_ for your connector and then follow the manual connector installation :ref:`instructions `.
License
-------
.. include:: ../../includes/enterprise-license.rst
See :ref:`activemq_sink_connector_license_config` for license properties and :ref:`activemq_sink_license-topic-configuration` for information about the license topic.
Client Library JARs
-------------------
The |kconnect-long| ActiveMQ connector includes all of the client libraries required to work with ActiveMQ.
.. note:: The ActiveMQ Sink Connector uses the ``org.apache.activemq:activemq-client:5.14.4`` client library.
Quick Start
-----------
This quick start uses the ActiveMQ Sink Connector to consume records from |ak| and send them to an ActiveMQ broker.
#. `Install ActiveMQ `_
#. `Start ActiveMQ `_
#. Install the connector through the `Confluent Hub Client `_.
.. codewithvars:: bash
# run from your Confluent Platform installation directory
confluent-hub install confluentinc/kafka-connect-activemq-sink:latest
#. Start |cp|.
.. codewithvars:: bash
|confluent_start|
#. `Produce `_ test data to the ``sink-messages`` topic in |ak|.
.. codewithvars:: bash
seq 10 | |confluent_produce| sink-messages
#. Create a ``activemq-sink.json`` file with the following contents:
.. codewithvars:: json
{
"name": "AMQSinkConnector",
"config": {
"connector.class": "io.confluent.connect.jms.ActiveMqSinkConnector",
"tasks.max": "1",
"topics": "sink-messages",
"activemq.url": "tcp://localhost:61616",
"activemq.username": "connectuser",
"activemq.password": "connectuser",
"jms.destination.type": "queue",
"jms.destination.name": "connector-quickstart",
"key.converter": "org.apache.kafka.connect.storage.StringConverter",
"value.converter": "org.apache.kafka.connect.storage.StringConverter",
"confluent.topic.bootstrap.servers": "localhost:9092",
"confluent.topic.replication.factor": "1"
}
}
#. Load the ActiveMQ Sink Connector.
.. include:: ../../../includes/confluent-local-consume-limit.rst
.. codewithvars:: bash
|confluent_load| jms|dash| -d activemq-sink.json
.. important:: Don't use the :ref:`cli` in production environments.
#. Confirm that the connector is in a ``RUNNING`` state.
.. codewithvars:: bash
|confluent_status| AMQSinkConnector
#. Navigate to the `ActiveMQ Admin UI `_ or use the following ActiveMQ CLI command to confirm the messages were delivered to the ``connector-quickstart`` queue.
.. tip:: The default credentials for the ActiveMQ Admin UI are ``admin``/``admin``
.. codewithvars:: bash
./bin/activemq consumer --destination connector-quickstart --messageCount 10
.. include:: ../../includes/jms-message-formats.rst
Additional Documentation
------------------------
.. toctree::
:maxdepth: 1
connector_config
changelog