<a id="activemq-source-connector-examples"></a>

# Example Configurations

The following sections require running Apache Kafka® and Connect. For more
information, see the [Tutorial: Moving Data In and Out of
Kafka](/platform/current/connect/quickstart.html). Note that as of Confluent Platform 7.5, ZooKeeper is deprecated for
new deployments. Confluent recommends KRaft mode for new deployments. For more
information, see the [KRaft](https://docs.confluent.io/platform/current/kafka-metadata/kraft.html)
documentation page.

## Standalone

The first configuration is used typically along with [standalone
workers](/platform/current/connect/concepts.html#standalone-workers).

```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
```

You can change the `confluent.topic.*` properties to fit your specific
environment. If running on a single-node Kafka cluster, you must include the
following: `"confluent.topic.replication.factor":"1"`. Leave the
`confluent.license` property blank for a 30-day trial. For more details, see
the [configuration options](source_connector_config.md#activemq-source-connector-license-config).

To explore other options when connecting to ActiveMQ, see the
[Configuration Reference for ActiveMQ Source Connector for Confluent Platform](source_connector_config.md#activemq-source-connector-config) page. For details about the ActiveMQ URL
parameters, see the [Apache ActiveMQ](https://activemq.apache.org/connection-configuration-uri.html)
documentation.

## Distributed

This configuration is used typically along with [distributed
mode](/platform/current/connect/concepts.html#distributed-workers).

1. Create a file named `connector.json` using the following JSON configuration example:
   ```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"
      }
   }
   ```

   You can change the `confluent.topic.*` properties to fit your specific
   environment. If running on a single-node Kafka cluster, you must include the
   following: `"confluent.topic.replication.factor":"1"`. Leave the
   `confluent.license` property blank for a 30-day trial. For more details,
   see the [configuration options](source_connector_config.md#activemq-source-connector-license-config).

   To explore other options when connecting to ActiveMQ, see the
   [Configuration Reference for ActiveMQ Source Connector for Confluent Platform](source_connector_config.md#activemq-source-connector-config) page. For details about the ActiveMQ
   URL parameters, see the [Apache ActiveMQ](https://activemq.apache.org/connection-configuration-uri.html)
   documentation.
2. Use `curl` to post the configuration to one of the Kafka Connect Workers.
   Change `http://localhost:8083/` the endpoint of one of your Kafka Connect
   worker(s).
   ```bash
   curl -s -X POST -H 'Content-Type: application/json' --data @connector.json http://localhost:8083/connectors
   ```
