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

Latest commit

 

History

History
 
 

connect-jms-tibco-sink

JMS TIBCO Sink connector

asciinema

Objective

Quickly test JMS TIBCO Sink connector.

Using TIBCO Docker image

How to run

Simply run:

$ ./jms-tibco-ems-sink.sh

Details of what the script is doing

The queue connector-quickstart is not created using tibemsadmin as described in Quick Start because the TIBCO Enterprise Message Service™ - Community Edition does not contain it.

The queues is created by providing ./docker-tibco/queues.conffile in /home/tibusrdirectory.

This file contains:

>
sample

queue.sample

connector-quickstart

The connector is created with:

$ curl -X PUT \
     -H "Content-Type: application/json" \
     --data '{
               "connector.class": "io.confluent.connect.jms.JmsSinkConnector",
                    "tasks.max": "1",
                    "topics": "sink-messages",
                    "java.naming.provider.url": "tibjmsnaming://tibco-ems:7222",
                    "java.naming.factory.initial": "com.tibco.tibjms.naming.TibjmsInitialContextFactory",
                    "jndi.connection.factory": "QueueConnectionFactory",
                    "java.naming.security.principal": "admin",
                    "java.naming.security.credentials": "",
                    "jms.destination.type": "queue",
                    "jms.destination.name": "connector-quickstart",
                    "key.converter": "org.apache.kafka.connect.storage.StringConverter",
                    "value.converter": "org.apache.kafka.connect.storage.StringConverter",
                    "confluent.topic.bootstrap.servers": "broker:9092",
                    "confluent.topic.replication.factor": "1"
          }' \
     http://localhost:8083/connectors/jms-tibco-ems-sink/config | jq .

Sending messages to topic sink-messages:

seq 10 | docker exec -i broker kafka-console-producer --broker-list broker:9092 --topic sink-messages

Verify we have received the data in connector-quickstart EMS queue:

$ docker exec tibco-ems bash -c '
cd /opt/tibco/ems/8.5/samples/java
export TIBEMS_JAVA=/opt/tibco/ems/8.5/lib
CLASSPATH=${TIBEMS_JAVA}/jms-2.0.jar:${CLASSPATH}
CLASSPATH=.:${TIBEMS_JAVA}/tibjms.jar:${TIBEMS_JAVA}/tibjmsadmin.jar:${CLASSPATH}
export CLASSPATH
javac *.java
java tibjmsMsgConsumer -user admin -queue connector-quickstart -nbmessages 10'

Results:

------------------------------------------------------------------------
tibjmsMsgConsumer SAMPLE
------------------------------------------------------------------------
Server....................... localhost
User......................... admin
Destination.................. connector-quickstart
------------------------------------------------------------------------

Subscribing to destination: connector-quickstart

Received message:  Header={ JMSMessageID={ID:E4EMS-SERVER.15DA88A7B4:1} JMSDestination={Queue[connector-quickstart]} JMSReplyTo={null} JMSDeliveryMode={PERSISTENT} JMSRedelivered={false} JMSCorrelationID={null} JMSType={null} JMSTimestamp={Thu Oct 17 15:37:24 UTC 2019} JMSDeliveryTime={Thu Oct 17 15:37:24 UTC 2019} JMSExpiration={0} JMSPriority={4} } Properties={ JMSXDeliveryCount={Integer:1} msg_num={Integer:1} }
Received message:  Header={ JMSMessageID={ID:E4EMS-SERVER.15DA88A7B4:2} JMSDestination={Queue[connector-quickstart]} JMSReplyTo={null} JMSDeliveryMode={PERSISTENT} JMSRedelivered={false} JMSCorrelationID={null} JMSType={null} JMSTimestamp={Thu Oct 17 15:37:24 UTC 2019} JMSDeliveryTime={Thu Oct 17 15:37:24 UTC 2019} JMSExpiration={0} JMSPriority={4} } Properties={ JMSXDeliveryCount={Integer:1} msg_num={Integer:2} }
Received message:  Header={ JMSMessageID={ID:E4EMS-SERVER.15DA88A7B4:3} JMSDestination={Queue[connector-quickstart]} JMSReplyTo={null} JMSDeliveryMode={PERSISTENT} JMSRedelivered={false} JMSCorrelationID={null} JMSType={null} JMSTimestamp={Thu Oct 17 15:37:24 UTC 2019} JMSDeliveryTime={Thu Oct 17 15:37:24 UTC 2019} JMSExpiration={0} JMSPriority={4} } Properties={ JMSXDeliveryCount={Integer:1} msg_num={Integer:3} }
Received message:  Header={ JMSMessageID={ID:E4EMS-SERVER.15DA88A7B4:4} JMSDestination={Queue[connector-quickstart]} JMSReplyTo={null} JMSDeliveryMode={PERSISTENT} JMSRedelivered={false} JMSCorrelationID={null} JMSType={null} JMSTimestamp={Thu Oct 17 15:37:24 UTC 2019} JMSDeliveryTime={Thu Oct 17 15:37:24 UTC 2019} JMSExpiration={0} JMSPriority={4} } Properties={ JMSXDeliveryCount={Integer:1} msg_num={Integer:4} }
Received message:  Header={ JMSMessageID={ID:E4EMS-SERVER.15DA88A7B4:5} JMSDestination={Queue[connector-quickstart]} JMSReplyTo={null} JMSDeliveryMode={PERSISTENT} JMSRedelivered={false} JMSCorrelationID={null} JMSType={null} JMSTimestamp={Thu Oct 17 15:37:24 UTC 2019} JMSDeliveryTime={Thu Oct 17 15:37:24 UTC 2019} JMSExpiration={0} JMSPriority={4} } Properties={ JMSXDeliveryCount={Integer:1} msg_num={Integer:5} }
Received message:  Header={ JMSMessageID={ID:E4EMS-SERVER.15DA88A7B4:6} JMSDestination={Queue[connector-quickstart]} JMSReplyTo={null} JMSDeliveryMode={PERSISTENT} JMSRedelivered={false} JMSCorrelationID={null} JMSType={null} JMSTimestamp={Thu Oct 17 15:37:24 UTC 2019} JMSDeliveryTime={Thu Oct 17 15:37:24 UTC 2019} JMSExpiration={0} JMSPriority={4} } Properties={ JMSXDeliveryCount={Integer:1} msg_num={Integer:6} }
Received message:  Header={ JMSMessageID={ID:E4EMS-SERVER.15DA88A7B4:7} JMSDestination={Queue[connector-quickstart]} JMSReplyTo={null} JMSDeliveryMode={PERSISTENT} JMSRedelivered={false} JMSCorrelationID={null} JMSType={null} JMSTimestamp={Thu Oct 17 15:37:24 UTC 2019} JMSDeliveryTime={Thu Oct 17 15:37:24 UTC 2019} JMSExpiration={0} JMSPriority={4} } Properties={ JMSXDeliveryCount={Integer:1} msg_num={Integer:7} }
Received message:  Header={ JMSMessageID={ID:E4EMS-SERVER.15DA88A7B4:8} JMSDestination={Queue[connector-quickstart]} JMSReplyTo={null} JMSDeliveryMode={PERSISTENT} JMSRedelivered={false} JMSCorrelationID={null} JMSType={null} JMSTimestamp={Thu Oct 17 15:37:24 UTC 2019} JMSDeliveryTime={Thu Oct 17 15:37:24 UTC 2019} JMSExpiration={0} JMSPriority={4} } Properties={ JMSXDeliveryCount={Integer:1} msg_num={Integer:8} }
Received message:  Header={ JMSMessageID={ID:E4EMS-SERVER.15DA88A7B4:9} JMSDestination={Queue[connector-quickstart]} JMSReplyTo={null} JMSDeliveryMode={PERSISTENT} JMSRedelivered={false} JMSCorrelationID={null} JMSType={null} JMSTimestamp={Thu Oct 17 15:37:24 UTC 2019} JMSDeliveryTime={Thu Oct 17 15:37:24 UTC 2019} JMSExpiration={0} JMSPriority={4} } Properties={ JMSXDeliveryCount={Integer:1} msg_num={Integer:9} }
Received message:  Header={ JMSMessageID={ID:E4EMS-SERVER.15DA88A7B4:10} JMSDestination={Queue[connector-quickstart]} JMSReplyTo={null} JMSDeliveryMode={PERSISTENT} JMSRedelivered={false} JMSCorrelationID={null} JMSType={null} JMSTimestamp={Thu Oct 17 15:37:24 UTC 2019} JMSDeliveryTime={Thu Oct 17 15:37:24 UTC 2019} JMSExpiration={0} JMSPriority={4} } Properties={ JMSXDeliveryCount={Integer:1} msg_num={Integer:10} }

N.B: Control Center is reachable at http://127.0.0.1:9021

Credits

mikeschippers/docker-tibco