Posts

Showing posts from April, 2017

IBM MQ from Spring using JMS

2 Ways to Connect to IBM MQ from Spring using JMS Java Messaging Service (JMS) provides a standard way for Java applications to communicate with messaging systems like IBM MQ . In Spring applications, there are two primary approaches to connect to IBM MQ using JMS. 1. Using com.ibm.mq.jms.context.WMQInitialContextFactory This method relies on JNDI-based lookups to retrieve connection factories and destinations. It is typically used in environments where resources such as ConnectionFactory and Queue are preconfigured on the application server (e.g., WebSphere). This approach is suitable when you want to externalize configuration and rely on a container-managed environment. java.naming.factory.initial = com.ibm.mq.jms.context.WMQInitialContextFactory java.naming.provider.url = tcp://hostname:1414 2. Using com.ibm.mq.jms.MQQueueConnectionFactory This is a programmatic approach that integrates seamlessly with Spring’s configuration. You can define the MQ connection direct...