• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Spring JMS with IBM Websphere MQ5.3.1

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 carry this gun in case a vending machine doesn't give me my fritos. This gun and this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic