You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by Amy Wu <Am...@adaptiveapps.com> on 2014/06/26 00:16:33 UTC

qpid 0.28 + qpid jca + jboss 7 + spring 3.2.x (jms)

Hello,

I'm trying to figure out the best way to use qpid for messaging for a Java web application hosted on JBoss that uses the Spring framework.
So far, I am able to get things working if I specify something like this in my applicationContext.xml

        <bean id="qpidConnFactory" class="org.apache.qpid.client.AMQConnectionFactory">
                <constructor-arg name="url"
                        value="<using a properties file>" />
        </bean>
        <bean id="connectionFactory"
                class="org.springframework.jms.connection.CachingConnectionFactory">
                <property name="targetConnectionFactory" ref="qpidConnFactory" />
                <property name="sessionCacheSize" value="10" />
                <property name="cacheConsumers" value="false" />
                <property name="cacheProducers" value="false" />
        </bean>

However, I feel like it'd be even better if I could get JBoss to manage the qpid connections in some way.  I figure one way to achieve this is through qpid jca.  Unfortunately, I have not been having the best luck getting it to work.  One issue I ran into was when Spring's SingleConnectionFactory tried to call setExceptionListener on the qpid connection, QpidRASessionFactoryImpl ends up throwing back an IllegalStateException.  Has anyone else gotten this type of setup to work?  Anyone got any pointers?  Is it even worth it to have JBoss manage the qpid connections?

Thanks