I am able to create topics in Open JMS using admin UI. Is there any Java API or REST API or shell command to do so?
Asked
Active
Viewed 126 times
1 Answers
0
Administration API can be used in Java.
Sample code:
import org.exolab.jms.administration.AdminConnectionFactory;
import org.exolab.jms.administration.JmsAdminServerIfc;
// ...
String url = "tcp://localhost:3035/";
JmsAdminServerIfc admin = AdminConnectionFactory.create(url);
String topic = "mytopic";
Boolean isQueue = Boolean.FALSE;
if (!admin.addDestination(topic, isQueue)) {
System.err.println("Failed to create topic " + topic);
}

Dev
- 13,492
- 19
- 81
- 174