wtorek, kwietnia 29, 2014

How to shutdown EMS via message

TibjmsXAQueueConnectionFactory cf = new TibjmsXAQueueConnectionFactory("<$admin>:tcp://10.1.1.1:7222", null, null);
XAQueueConnection conn = cf.createXAQueueConnection(user, pass);
QueueSession sess = conn.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
MapMessage mapmessage = sess.createMapMessage();
mapmessage.setIntProperty("code", 198);
mapmessage.setBooleanProperty("save", false);
try {
sess.createSender(sess.createQueue("$sys.admin")).send(mapmessage);
}
catch (Exception e) {
if (e.toString().contains("terminated"))
return;
}
sess.close();
conn.close();

0 komentarze: