JMS 2.0 JCA 1.7 changes- createContext() causing 2nd connection to be created by Tibco

49 views
Skip to first unread message

Patrick Nodder

unread,
Oct 1, 2018, 9:40:56 AM10/1/18
to Generic JMS JCA Resource Adapter for JBoss AS
I am using Wildfly 13 and the Generic RA to connect to Tibco EMS (8.3.0). When connecting to a topic two connections are opened at the same time. 

These lines in JmsManagedConnection.java both create connections, each with a different connection ID.

I see that the second highlighted line was added in March 2015 for the update to JMS 2.0 JCA 1.7. On executing this line it goes off into the Tibco code and eventually calls createConnection() for a second time.

Just wondering if you have any thoughts on this or idea how I could resolve it?

            log.debug("created XAConnection: " + connection);
        } else if (factory instanceof ConnectionFactory) {
            ConnectionFactory qFactory = (ConnectionFactory) factory;
            if (username != null) {
                if (mcf.getProperties().getType() == JmsConnectionFactory.QUEUE) {
                    connection = ((QueueConnectionFactory)qFactory).createQueueConnection(username, password);
                } else if (mcf.getProperties().getType() == JmsConnectionFactory.TOPIC) {
                    connection = ((TopicConnectionFactory)qFactory).createTopicConnection(username, password);
                } else {
                    connection = qFactory.createConnection(username, password);
                }
                context = qFactory.createContext(username, password);
            } else {
               if (mcf.getProperties().getType() == JmsConnectionFactory.QUEUE) {
                   connection = ((QueueConnectionFactory)qFactory).createQueueConnection();
               } else if (mcf.getProperties().getType() == JmsConnectionFactory.TOPIC) {
                   connection = ((TopicConnectionFactory)qFactory).createTopicConnection();
               } else {
                   connection = qFactory.createConnection();
               }
                context = qFactory.createContext();
            }



Justin Bertram

unread,
Oct 1, 2018, 11:11:32 AM10/1/18
to Generic JMS JCA Resource Adapter for JBoss AS
At this point there's nothing you can do to resolve it short of re-implementing JMS 2.0 support in the RA.

Patrick Nodder

unread,
Oct 1, 2018, 11:37:01 AM10/1/18
to Generic JMS JCA Resource Adapter for JBoss AS
Thanks for replying, could you clarify what you mean by re-implementing JMS 2.0 support? I thought that's what that commit was for. It seems to me that the RA is currently using both the the JMS 1.0 and 2.0 API's i.e. creating both a Connection and a JMSContext object, which results in two connections. Am I missing something?

Justin Bertram

unread,
Oct 1, 2018, 12:07:19 PM10/1/18
to Generic JMS JCA Resource Adapter for JBoss AS
JMS 2.0 support was already implemented (via the commit you mentioned), and that implementation is causing the double connection.  What I was saying in my previous message is that if you don't want the double connection then you'll have to undo the previous JMS 2.0 implementation and re-implement it in a different way to avoid the double connection.

Patrick Nodder

unread,
Oct 1, 2018, 12:18:09 PM10/1/18
to Generic JMS JCA Resource Adapter for JBoss AS
Got it, thanks Justin.
Reply all
Reply to author
Forward
0 new messages