<a id="weblogic-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.

#### NOTE
The following configuration examples show the `JmsSourceConnector`
connector class. If you plan to use a [shared subscription](https://docs.oracle.com/middleware/11119/wls/JMSPG/advpubsub.htm#CHDDBFIA)
(that is, `"jms.subscription.shared": "TRUE"`) which requires the
`jms.client.id` configuration property, you would use the extended
connector class `io.confluent.connect.weblogic.WeblogicSourceConnector`.

## Standalone

The first configuration is used typically along with standalone mode:

```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=weblogic.jndi.WLInitialContextFactory
java.naming.provider.url=t3://<host>:7001
connection.factory.name=MyConnectionFactory
# 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 [configuration options](configuration.md#jms-source-connector-license-config) for more details.

For example, the following configuration specifies how to look up the Weblogic connection information (check your Oracle Weblogic
console and documentation for details).

```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=weblogic.jndi.WLInitialContextFactory
java.naming.provider.url=t3://<host>:7001
java.naming.security.principal=MyUserName
java.naming.security.credentials=MyPassword
connection.factory.name=MyConnectionFactory

# 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 typically used along with [distributed
mode](/platform/current/connect/concepts.html#distributed-workers). Write the following JSON
example to `connector.json`, configure all the required values, and use the
command below to post the configuration to one of the distributed connect
workers.

```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":"",
    "connection.factory.name":,"",
    "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; otherwise, specify the Confluent license key.
See [Confluent Platform license options](configuration.md#jms-source-connector-license-config) for more details.

For example, the following specifies how to look up the Weblogic connection information (for more details, refer to the documentation on connecting with
[JNDI](https://docs.oracle.com/javase/tutorial/jndi/overview/index.html) and [How to Lookup a Destinations](https://docs.oracle.com/middleware/1221/wls/JMSPG/lookup.htm#JMSPG634)) to create a durable subscription to a JMS topic.

```bash
{
 "name": "connector1",
 "config": {
   "connector.class": "io.confluent.connect.jms.JmsSourceConnector",
   "kafka.topic":"MyKafkaTopicName",
   "java.naming.factory.initial": "weblogic.jndi.WLInitialContextFactory",
   "jms.destination.name":"MyWeblogicTopic",
   "jms.destination.type":"topic",
   "java.naming.provider.url": "t3://<host>:7001/",
   "connection.factory.name": "com.oracle.webservices.api.jms.ConnectionFactory",
   "confluent.license": "",
   "java.naming.security.principal": "weblogic",
   "java.naming.security.credentials": "welcome1",
   "tasks.max" : "1",
   "jms.subscription.durable": true,
   "jms.subscription.name": "sub1",
   "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 must include `"confluent.topic.replication.factor":"1"`.
Leave the `confluent.license` property blank for a 30 day trial.
See [Confluent Platform license options](configuration.md#jms-source-connector-license-config) for more details.

Use curl to post the configuration to one of the Kafka Connect Workers.
Change `http://localhost:8083/` to 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
```
