Announcement Announcement Module
Collapse
No announcement yet.
Spring JMS / OpenMQ Glassfish queue Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring JMS / OpenMQ Glassfish queue

    I've created a Message Driven POJO listener and want to receive messages from an OpenMQ Glassfish queue. I haven't found any examples of how to configure a connectionFactory in my spring config to connect to OpenMQ.

    I found the below example for ActiveMQ but does anyone have an example config for OpenMQ/Glassfish?

    <bean id="connectionFactory" class="org.apache.activemq.spring.ActiveMQConnecti onFactory">
    <property name="brokerURL" value="vm://localhost"/>
    </bean>

  • #2
    Hi,
    If you have defined the JMS queues in Glassfish with JNDI names you should be able to do a jndi lookup and pass that for your destination and connection factory:
    Code:
    	<jee:jndi-lookup id="destinationLookup" jndi-name="jms/a.queue" expected-type="javax.jms.Queue" />
    	<jee:jndi-lookup id="factoryLookup" jndi-name="jms/na.connectionFactory." expected-type="javax.jms.QueueConnectionFactory" />						   
    						   
    	<int-jms:outbound-channel-adapter id="out" channel="in" destination="destinationLookup" connection-factory="factoryLookup"  >
    I am using the namespace support, (which is very easy to set up if you are using sts) so you will need the following in your context file:

    Code:
    <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xmlns:context="http://www.springframework.org/schema/context" 
    	xmlns:int-jms="http://www.springframework.org/schema/integration/jms" 
    	xmlns:jee="http://www.springframework.org/schema/jee"
    	xsi:schemaLocation="http://www.springframework.org/schema/jee 
    			    http://www.springframework.org/schema/jee/spring-jee-3.0.xsd
    		            http://www.springframework.org/schema/integration/jms 
    			    http://www.springframework.org/schema/integration/jms/spring-integration-jms-2.0.xsd
    			    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
    Hope that is helpful.
    G

    Comment

    Working...
    X