Quickly test JMS ActiveMQ Sink connector.
Using ActiveMQ Docker image
Simply run:
$ ./jms-active-mq-sink.sh
ActiveMQ UI is reachable at http://127.0.0.1:8161 (admin/admin
)
Sending messages to topic sink-messages
$ docker exec -i broker kafka-console-producer --broker-list broker:9092 --topic sink-messages << EOF
This is my message
EOF
The connector is created with:
$ curl -X PUT \
-H "Content-Type: application/json" \
--data '{
"connector.class": "io.confluent.connect.jms.JmsSinkConnector",
"topics": "sink-messages",
"java.naming.factory.initial": "org.apache.activemq.jndi.ActiveMQInitialContextFactory",
"java.naming.provider.url": "tcp://activemq:61616",
"java.naming.security.principal": "admin",
"java.naming.security.credentials": "admin",
"connection.factory.name": "ConnectionFactory",
"jms.destination.type": "queue",
"jms.destination.name": "DEV.QUEUE.1",
"key.converter": "org.apache.kafka.connect.storage.StringConverter",
"value.converter": "org.apache.kafka.connect.storage.StringConverter",
"confluent.license": "",
"confluent.topic.bootstrap.servers": "broker:9092",
"confluent.topic.replication.factor": "1"
}' \
http://localhost:8083/connectors/jms-active-mq-sink/config | jq .
Get messages from DEV.QUEUE.1 JMS queue:
$ curl -XGET -u admin:admin -d "body=message" http://localhost:8161/api/message/DEV.QUEUE.1?type=queue
We get:
This is my message
N.B: Control Center is reachable at http://127.0.0.1:9021