String manifestDestination = "/queue/app.plugin.create";
Client c;
try {
c = new Client(activeMqIp, 61666, "", "");
System.out.println("Connected to broker");
Map header = new HashMap();
header.put("transformation", "jms-object-xml");
header.put("reply-to", "/queue/app.data.response");
System.out.println("Subscribe for replies to command");
c.subscribe("/queue/app.data.response", new Listener() {
@Override
public void message(Map map, String string) {
System.out.println("STOMP client receives something...");
System.out.println(string);
}
});
System.out.println("Sending XML manifest...");
c.send(manifestDestination, manifest, header);
System.out.println("Sending XML command...");
c.send(commandDestination, command, header);
System.out.println("Sending XML event...");
c.send(eventDestination, event, header);
System.out.println("sent");
} catch (IOException ex) {
Logger.getLogger(JavaStompClientExample.class.getName()).log(Level.SEVERE, null, ex);
} catch (LoginException ex) {
Logger.getLogger(JavaStompClientExample.class.getName()).log(Level.SEVERE, null, ex);