0

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?

Dev
  • 13,492
  • 19
  • 81
  • 174
  • Most providers automatically create the topic as soon as there first producer or consumer is created, though I don't know Open JMS and how it works. – Scott Sosna Nov 11 '16 at 02:19

1 Answers1

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