The first approach starts a broker within your webapp itself. You can use a normal consumer (not a message-driven bean - MDB), but only your webapp can access it, via the VM transport (vm://).
The second approach lets the app server manage both the connection to the broker and the creation of the broker, so it's probably also within the JVM that runs your webapp and probably only accessible to your webapp, but those details are hidden from you by the app server. You can only consume messages via an MDB, but this provides a uniform interface that doesn't need to change if you switch to another JMS provider in the future. Since the standard way to integrate a JEE webapp with a JMS broker is via the RA, I'd recommend that you use that approach simply for consistency and standardization. That should also allow you to switch to a standalone ActiveMQ broker (or another JMS product) in the future with minimal effort. Tim On Apr 18, 2017 5:34 AM, "aragoubi" <aymen....@gmail.com> wrote: I am creating a Java application in eclipse to let different devices communicate together using a publish/subscribe protocol. I am using Jboss and ActiveMQ and I want to know if I should use an ActiveMQ resource adapter to integrate the broker in jboss in a standalone mode or I should just add dependencies in my pom.xml file and use explicit java code like indicated here http://activemq.apache.org/how-do-i-embed-a-broker-inside-a-connection.html <http://activemq.apache.org/how-do-i-embed-a-broker-inside-a-connection.html > Here the documentation I found to integrate ActiveMQ within jboss in a standalone mode https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_A-MQ/6.1/html/ Integrating_with_JBoss_Enterprise_Application_Platform/DeployRar-InstallRar. html <https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_A-MQ/6.1/html/ Integrating_with_JBoss_Enterprise_Application_Platform/DeployRar-InstallRar. html> Could someone tell me what is the difference between the two approaches? -- View this message in context: http://activemq.2283324.n4. nabble.com/Interest-of-using-activeMQ-resource-adapter-tp4725027.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.