How do I use ActiveMQ using in JVM messaging

 FAQ > Using Apache ActiveMQ > How do I use ActiveMQ using in JVM messaging

For ActiveMQ 3.x/4.x

To use pure in-memory messaging you just need to set the broker URL to be


Actually you can use any text after vm:// so that you can segment multiple logical JMS brokers within the same JVM and classloader, using the name to distinguish between them.

There is an example of how to do this along with a description of the available protocols in the Protocols overview.

Also see: how to optimise the VM transport

Apache ActiveMQ, ActiveMQ, ActiveMQ Artemis, Apache, the Apache feather logo, and the Apache ActiveMQ project logo are trademarks of The Apache Software Foundation. Copyright © 2019, The Apache Software Foundation. Licensed under Apache License 2.0.