Quickly test ActiveMQ Source connector.
Using ActiveMQ Docker image
Simply run:
$ ./active-mq.sh
ActiveMQ UI is reachable at http://127.0.0.1:8161 (admin/admin
)
The connector is created with:
$ curl -X PUT \
-H "Content-Type: application/json" \
--data '{
"connector.class": "io.confluent.connect.activemq.ActiveMQSourceConnector",
"kafka.topic": "MyKafkaTopicName",
"activemq.url": "tcp://activemq:61616",
"jms.destination.name": "DEV.QUEUE.1",
"jms.destination.type": "queue",
"confluent.license": "",
"confluent.topic.bootstrap.servers": "broker:9092",
"confluent.topic.replication.factor": "1"
}' \
http://localhost:8083/connectors/active-mq-source/config | jq .
Messages are sent to IBM MQ using curl:
$ curl -XPOST -u admin:admin -d "body=message" http://localhost:8161/api/message/DEV.QUEUE.1?type=queue
Verify we have received the data in MyKafkaTopicName topic:
docker exec connect kafka-avro-console-consumer -bootstrap-server broker:9092 --property schema.registry.url=http://schema-registry:8081 --topic MyKafkaTopicName --from-beginning --max-messages 1
We get:
{
"bytes": null,
"correlationID": null,
"deliveryMode": 2,
"destination": {
"io.confluent.connect.jms.Destination": {
"destinationType": "queue",
"name": "DEV.QUEUE.1"
}
},
"expiration": 0,
"map": null,
"messageID": "ID:activemq-34421-1570550056457-4:2:1:1:1",
"messageType": "text",
"priority": 5,
"properties": {},
"redelivered": false,
"replyTo": null,
"text": {
"string": "message"
},
"timestamp": 1570550394652,
"type": null
}
N.B: Control Center is reachable at http://127.0.0.1:9021