There are a few example programs to test out ActiveMQ in the org.activemq.tool package in the unit test area.
Another option is to run it from inside Maven
For all of these examples you can specify specific URLs to connect to or run a server on as we shall see below.
You can run the example programs from inside your IDE as they are stand alone Java applications. e.g. ConsumerTool consumes on a topic/queue and PublisherTool publishes on a topic/queue.
You can run them from inside Maven via the following.
for the producer
You can specify a subject to publish/consume on too
You can mix and match url and subject parameters. If neither are specified then defaults are used.