ActiveMQ Integration
wconroy Jun 21, 2006 5:37 PMI posted the following on the ActiveMQ forum
----------
I am trying to create an MDB in jboss that runs off an ActiveMQ queue.
To do this, you apparently need add something like the following into the jms-ds.xml file, then you can say in your mdb what provider to use.
<!-- The ActiveMQ JMS provider loader --> <mbean code="org.jboss.jms.jndi.JMSProviderLoader" name="jboss.mq:service=JMSProviderLoader,name=ActiveMQJMSProvider"> <attribute name="ProviderName">ActiveMQJMSProvider</attribute> <attribute name="ProviderAdapterClass"> org.jboss.jms.jndi.JNDIProviderAdapter </attribute> <!-- The combined connection factory --> <attribute name="FactoryRef">java:/activemq/QueueConnectionFactory</attribute> <!-- The queue connection factory --> <attribute name="QueueFactoryRef">java:/activemq/QueueConnectionFactory</attribute> <!-- The topic factory --> <attribute name="TopicFactoryRef">java:/activemq/QueueConnectionFactory</attribute> <!-- Uncomment to use HAJNDI to access JMS <attribute name="Properties"> java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces java.naming.provider.url=localhost:1100 </attribute> --> </mbean>
So my mdb is annotated with the following.
@MessageDriven(activationConfig = { @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"), @ActivationConfigProperty(propertyName="destination", propertyValue="activemq/queue/SecurityChanged"), @ActivationConfigProperty(propertyName="connectionFactoryName", propertyValue="activemq/QueueConnectionFactory"), @ActivationConfigProperty(propertyName="resourceAdaptorName", propertyValue="activemq-ra-4.0.rar"), @ActivationConfigProperty(propertyName="providerAdapterJNDI", propertyValue="java:/ActiveMQJMSProvider") })
I get the following exception when running I run my jboss server.
javax.jms.JMSException: Not Supported. at org.apache.activemq.ra.ManagedConnectionProxy.createConnectionConsumer(ManagedConnectionProxy.java:221) at org.jboss.ejb3.mdb.MDB.innerCreateQueue(MDB.java:530) at org.jboss.ejb3.mdb.MDB.innerCreate(MDB.java:454) at org.jboss.ejb3.mdb.MDB.innerStart(MDB.java:267) at org.jboss.ejb3.mdb.MDB.start(MDB.java:256)
Is there a differenct connection factory i should be using that supports the createConnectionConsumer method? I just have the standard of what comes in the activemq-4.0-ra.xml.
-------------------------
And someone on the ActiveMQ forum replied with the following
It seems that with that configuration the JCA activation spec stuff is
not being used to deliver messages to JBoss. JBoss is trying to do
the message delivery itself by setting up a connectionConsumer. I
would cross post this question to the JBoss mailing lists to find out
why JBoss is trying to create connection consumer if you've configured
the activation spec properties.
-----------------------------
Any help would be appreciated. I am just trying to get an MDB configured to work off an ActiveMQ queue.
Thanks
--Bo