THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
NOTE: For tests it can be useful to create an embedded broker like this:
Code Block |
---|
Wiki Markup |
{code} public final void run() { try { broker = new BrokerService(); broker.setPersistent(false); broker.setPersistenceAdapter(new MemoryPersistenceAdapter()); broker.setTmpDataDirectory(new File("./target")); broker.setUseJmx(false); if (brokerName != null) { broker.setBrokerName(brokerName); } broker.addConnector(brokerUrl1); broker.start(); } catch (Exception e) { e.printStackTrace(); } } {code} |
Consume the service with the API
...