简体   繁体   中英

activemq brokerName always localhost?

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,

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM