QueueConnectionFactory for WebSphere MQ

Does anyone know if there is an implementation of javax.jms.QueueConnectionFactory for WebSphere MQ and where to get it? I Googled it and searched IBM website but couldn't find anything. I don't want to retrieve the connection or factory from Websphere MQ via JNDI, I need my own connection factory.


Asked by: Rafael517 | Posted: 28-01-2022






Answer 1

I think you need three jars

com.ibm.mq.jar
com.ibm.mqbind.jar
com.ibm.mqjms.jar

You instantiate a MQQueueConnectionFactory and i hope you can take it from there.

And here's more info: IBMs HOWTO

Oh, and MQ can do "real" JMS instead of MQ - only the JMS implementation seemed to have problems closing the Channel properly - at least in our environment.

Answered by: Marcus972 | Posted: 01-03-2022



Answer 2

Although Bobby's article referenced in the other response is good, I would want to use a more current version of the JMS classes than from 2005! Most of the development has been in enhancing JMS function and performance. The classes have been simplified and repackaged into fewer jars as well so it's easier to deploy.

I'd recommend going to the WMQ Infocenter for the version of JMS classes you have (6.0 or 7.0) and looking for the Using Java manual. Inside there is a section on environment variables. Make sure you have the jars listed in the CLASSPATH for your specific version. The infocenter is linked from the WMQ Library page.

If you can use the latest version, download the MQC7 SupportPac. This is the WMQ client code and includes the latest jars.

Once you get the client installed, the sample code can be found in C:\Program Files\IBM\WebSphere MQ\tools\jms\samples\simple

Answered by: Thomas416 | Posted: 01-03-2022



Similar questions

java - Why is my JNDI lookup for a QueueConnectionFactory returning null?

I am trying to look up a QueueConnectionFactory and Queue via Geronimo's JNDI. The Queue gets returned fine, but the QueueConnectionFactory lookup always returns null. It doesn't throw a NamingException, which is what I'd expect if the JNDI name was incorrect. Can anyone see what I'm doing wrong? The test code below outputs: true false


java - Impossible to inject JMS QueueConnectionFactory in JBoss 6.1.0 with resource annotation

I was spending a lot time to sort out problem with JBoss 6.1.0 to inject JMS connection factory in my session bean. I am using JBoss 6.1.0 with default profile and running it in debian. Snip of my code are: @Resource(name="java:/QueueConnectionFactory") private QueueConnectionFactory factory There is in jboss6/server/default/deploy/hornetq/hornetq-jms.xml: <conn...


java - JMS QueueConnectionFactory vs ConnectionFactory

My question is about the use of the following 2 factories: ConnectionFactory QueueConnectionFactory At the moment I just use a ConnectionFactory to initialize everything: Connection conn = factory.createConnection(user, pw); Session session = conn.createSession() Destination dest = session.createQueue('xyz') ... If I understand correctly, ...


java - Unable to resolve JNDI name for Queue and QueueConnectionFactory in Weblogic

I am working on the example of Message Driven Bean in EJB. I created EJB project which is deployed in weblogic server and Client project which sends the message to MDB using JNDI name. I also created JMS Queue and Queue ConnectionFactory in weblogic console. But problem is in client side it is not able to identify JNDI name for Queue.


java - QueueConnectionFactory.createQueueConnection() not returning or throwing an exception

When my MQ server becomes unavailable, the call to QueueConnectionFactory.createQueueConnection() hangs and eventually (1-2 minutes later) "javax.transaction.TransactionRolledbackException: Transaction is ended due to timeout" is thrown. I cannot find a JavaEE call to set a timeout for the function. Is there a way to get this function to fail faster or throw an exception on WebSphere when the MQ server cann...


java - Exception on Multiple QueueConnectionFactory

I have to connect to two different MQ endpoints. I defined 4 Beans: 2 QueueConnectionFactory and 2 JmsTemplate with different names using Spring Java configuration. When I start the app or run the tests it throws the following exception: java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(...


java - Is it possible to get the JMS Queue reference from WAS JNDI without QueueConnectionFactory?

I am working on a project where I need to consume JMS messages from IBM MQ which is defined in websphere as JNDI. I have given only the JNDI of a queue (jms/sampleQ). I am trying to connect the Queue from Spring JMS. Here my question is, whether the QueueConnectionFactory is mandatory to connect the Queue (JNDI) ?






Still can't find your answer? Check out these amazing Java communities for help...



Java Reddit Community | Java Help Reddit Community | Dev.to Java Community | Java Discord | Java Programmers (Facebook) | Java developers (Facebook)



top