Skip to content
This repository has been archived by the owner on Nov 18, 2021. It is now read-only.

Latest commit

 

History

History
 
 

connect-jms-active-mq-sink

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

JMS ActiveMQ Sink connector

asciinema

Objective

Quickly test JMS ActiveMQ Sink connector.

Using ActiveMQ Docker image

How to run

Simply run:

$ ./jms-active-mq-sink.sh

Details of what the script is doing

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