Reputation: 45
Is there a way to let a WSO2 Stream Processor Siddhi application send messages to JMS queue in Tibco EMS? This guide here demonstrates how you can do it with ActiveMQ, but how can I set it up with Tibco EMS as a sink?
I found this PR with a doc example on how to supposedly connect to the Tibco EMS. I followed what he wrote but I'm getting connection errors in SP console:
[2020-12-02 14:24:00,161] ERROR {org.wso2.extension.siddhi.io.jms.sink.JMSSink} - Error while connecting to JMS provider at destination: org.wso2.siddhi.core.util.transport.Option@3ff61cc8
[2020-12-02 14:24:00,164] ERROR {org.wso2.siddhi.core.stream.output.sink.Sink} - Error on 'EMS_EXAMPLE'. Error while connecting to JMS provider at destination: org.wso2.siddhi.core.util.transport.Option@3ff61cc8 Error while connecting at Sink 'jms' at 'TestMonitoring2', will retry in '5 min'. org.wso2.siddhi.core.exception.ConnectionUnavailableException: Error while connecting to JMS provider at destination: org.wso2.siddhi.core.util.transport.Option@3ff61cc8
at org.wso2.extension.siddhi.io.jms.sink.JMSSink.connect(JMSSink.java:151)
at org.wso2.siddhi.core.stream.output.sink.Sink.connectWithRetry(Sink.java:217)
at org.wso2.siddhi.core.stream.output.sink.Sink$1.run(Sink.java:231)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.wso2.transport.jms.exception.JMSConnectorException: Error connecting to JMS provider. Naming exception while obtaining connection factory for FTQueueConnectionFactory
at org.wso2.transport.jms.sender.JMSClientConnectorImpl.<init>(JMSClientConnectorImpl.java:58)
at org.wso2.transport.jms.impl.JMSConnectorFactoryImpl.createClientConnector(JMSConnectorFactoryImpl.java:44)
at org.wso2.extension.siddhi.io.jms.sink.JMSSink.connect(JMSSink.java:148)
... 9 more
My siddhi app looks like this:
@App:name("EMS_EXAMPLE")
@sink(type="jms", destination="sample", connection.factory.jndi.name="FTQueueConnectionFactory", factory.initial="com.tibco.tibjms.naming.TibjmsInitialContextFactory", provider.url="tibjmsnaming://localhost:7222", connection.factory.type="queue", connection.username="tibco", connection.password="tibco",
@map(type = 'json'))
define stream TestMonitoring2 (
consumerKey string,
context string,
api_version string,
api string,
resourcePath string,
resourceTemplate string,
method string,
version string,
userId string,
tenantDomain string,
hostName string,
apiPublisher string,
applicationName string,
applicationId string,
clientIp string,
applicationOwner string,
message string,
type string
);
My Tibco EMS is up and running with both user and queue created:
2020-12-02 14:15:25.191 Process started from '/opt/tibco/ems/8.4/bin/tibemsd'.
2020-12-02 14:15:25.191 Process Id: 3522
2020-12-02 14:15:25.191 Hostname: 9e943d4f4b33
2020-12-02 14:15:25.191 Hostname IP address: 172.17.0.2
2020-12-02 14:15:25.191 Reading configuration from '/opt/tibco/tibco/cfgmgmt/ems/data/tibemsd.conf'.
2020-12-02 14:15:25.194 Logging into file '/opt/tibco/tibco/cfgmgmt/ems/data/datastore/logfile'
2020-12-02 14:15:25.195 Server name: 'EMS-SERVER'.
2020-12-02 14:15:25.195 Storage Location: '/opt/tibco/tibco/cfgmgmt/ems/data/datastore'.
2020-12-02 14:15:25.195 Routing is disabled.
2020-12-02 14:15:25.195 Authorization is enabled.
2020-12-02 14:15:25.195 The server will attempt to trace warnings about destinations that are growing unbounded above 26843545 bytes or 50000 messages.
2020-12-02 14:15:25.195 Set server properties 'large_destination_memory' and 'large_destination_count' respectively to alter these thresholds.
2020-12-02 14:15:25.196 WARNING: Configuration warning: file=/opt/tibco/tibco/cfgmgmt/ems/data/routes.conf, line=51: route 'EMS-SERVER2' does not have a user configured for authorization.
2020-12-02 14:15:25.198 Accepting connections on tcp://9e943d4f4b33/[::]:7222.
2020-12-02 14:15:25.198 Accepting connections on tcp://9e943d4f4b33/0.0.0.0:7222.
2020-12-02 14:15:25.198 Recovering state, please wait.
2020-12-02 14:15:25.200 Recovered 1 message.
2020-12-02 14:15:25.200 Server is active.
I'm using WSO2 Stream Processor 4.4.0, Tibco EMS 8.4, and the whole thing runs in Dockerized CentOS.
Upvotes: 1
Views: 148
Reputation: 412
The error message 'Naming exception while obtaining connection factory for FTQueueConnectionFactory' means that the specified connection factory (FTQueueConnectionFactory) doesn't exist on the target EMS server. If it exist you may need to check that you are connecting to the right EMS.
Upvotes: 1