This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes Spring JMS with IBM  Websphere MQ5.3.1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Spring JMS with IBM  Websphere MQ5.3.1" Watch "Spring JMS with IBM  Websphere MQ5.3.1" New topic
Author

Spring JMS with IBM Websphere MQ5.3.1

Palash Sahu
Greenhorn

Joined: Dec 06, 2006
Posts: 13
Hi,
I am using JMS provider as IBM Websphere MQ5.3.1.
Message sending and receiving is working fine with jmsTemplate.
But when I am writing MessageDrivenPOJO class using DefaultMessageListenerContainer or MessageListenerAdapter,then I am getting error.
I have set up websphre MQ correctly.Added all required jars to the classpath.I have created QManager and Queue.Then inialized jndi. After that I binded instance of QueueConnectonFactory and Queue. My bean configuration file is as follows:-

<!-- description of the suite context -->
<description>This file defines beans of Message driven POJO and Message Listener Container</description>

<!-- this is the Message Driven POJO (MDP) -->
<bean id="msgDrivenPOJOId" class="com.anshinsoft.pi.messaging.MessageDrivenPOJOImpl"/>

<!-- and this is the message listener container -->
<bean id="listenerContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
<property name="concurrentConsumers" value="5"/>
<property name="connectionFactory" ref="jmsQueueConnectionFactory" />
<property name="destination" ref="jmsDestination" />
<property name="messageListener" ref="msgDrivenPOJOId" />
</bean>

<!-- JNDI Environment Template -->
<bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
<property name="environment">
<props>
<prop key="java.naming.factory.initial">com.sun.jndi.fscontext.RefFSContextFactory</prop>
<prop key="java.naming.provider.url">file:/C:/JNDI-Directory</prop>
</props>
</property>
</bean>


<!-- JMS Queue Connection Factory -->
<bean id="internalJmsQueueConnectionFactory"
class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiTemplate">
<ref bean="jndiTemplate"/>
</property>
<property name="jndiName">
<value>jmsQCF1</value>
</property>
</bean>

<!-- Spring JMS Queue Connection Factory -->
<bean id="jmsQueueConnectionFactory"
class="org.springframework.jms.connection.SingleConnectionFactory102">
<property name="targetConnectionFactory">
<ref bean="internalJmsQueueConnectionFactory"/>
</property>
<property name="pubSubDomain">
<value>false</value>
</property>
</bean>

<!-- Destination -->
<bean id="jmsDestination" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiTemplate">
<ref bean="jndiTemplate"/>
</property>
<property name="jndiName">
<value>jmsspringQueue1</value>
</property>
</bean>

<!-- JMS Template -->
<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate102">
<property name="connectionFactory">
<ref bean="jmsQueueConnectionFactory"/>
</property>
<property name="defaultDestination">
<ref bean="jmsDestination"/>
</property>
<property name="receiveTimeout">
<value>30000</value>
</property>
</bean>

<!-- JMS Sender -->
<bean id="messageSender" class="com.anshinsoft.pi.MessageSender">
<property name="jmsTemplate">
<ref bean="jmsTemplate"/>
</property>
</bean>

I think websphre mq(version 5.3.1) does support spring's new feature like DefaultMessageListenerContainer or MessageListenerAdapter.
I will be oblized for any kind of help and active participation to this topic.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Spring JMS with IBM Websphere MQ5.3.1
 
Similar Threads
MDP consuming from remote JBossMQ Queue
DefaultMessageListenerContainer not getting started
Spring configuration for Testing JMS using Junit
How to connect to a remote MQ Queue using Spring MDPs and Weblogic
can't create connection to JBoss MQ using Spring JMS