2

This may be a n00b question, I've installed activemq on CentoOS and when i start it like so setting the brokerName to "Test":

 sudo activemq start broker:tcp://localhost:61666?brokerName=Test&persistent=true&useJmx=false

Then query it:

sudo activemq query

The broker name is always "localhost"...

....
QueueSubscribers = []
Topics = [org.apache.activemq:type=Broker,brokerName=localhost,destinationType=Topic,destinationName=ActiveMQ.Advisory.MasterBroker]
TotalMessageCount = 0
SslURL =
TemporaryQueueSubscribers = []
BrokerName = localhost <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<HERE
DynamicDestinationProducers = []
Persistent = true
DataDirectory = /etc....
....

Can someone shed some light? When I connect using JMS API in an example Java class, specificing the full URL like above puts it in that broker? is this to have multiple brokers with different names?

Thanks for any clarifications,

dlite922
  • 1,924
  • 3
  • 24
  • 60
  • localhost is the default brokername. Could it be that with the install, activeMQ was set-up as a service, so that this broker with its default name is always automatically started? – ljgw Jun 06 '13 at 16:39
  • I did set it up as a service, however, `which activemq` goes directly to the /opt/activemq/bin/activemq binary directly. So each time it starts another as my user separate from the service, no? if this is not the case, how come the port number given on the same parameter line is accepted and it starts to listen on that non-default port. – dlite922 Jun 06 '13 at 16:55

1 Answers1

1

Acording to the docs, the URI format is:

broker:(transportURI,network:networkURI)/brokerName?brokerOptions

So, in your case:

broker:(tcp://localhost:61666)/Test&persistent=true&useJmx=false

Disclaimer: Haven't verified it.

Another, perhaps better, way is to point out a config XML instead of an URI. That gives you more fine grained control over everything.

Petter Nordlander
  • 22,053
  • 5
  • 50
  • 84