简体   繁体   中英

For JMS, how to access topic name in Java code?

I am using ActiveMQ which uses JMS . I have a requirement where I need to find the topic name from Java program. Is there any JMS api for that?

EDIT: There is an api in JMS to find topic but will it work for ActiveMQ topics?

There are many ways to do that (choosing one depends on your use case).

A possibility for ActiveMQ is

org.apache.activemq.broker.jmx.BrokerViewMBean.getTopics()

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