1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | package mqconn; import com.ibm.mq.MQException; public class MQGet extends MQConnector { public MQGet() { } public String getMessages(String[] args) throws MQException { String message=getMessageFromQueue(); return message; } public static void main(String[] args) { MQGet mqget = new MQGet(); MQConnector.DEBUG=false; try { mqget.initMq(); mqget.openQueue(); String msg=mqget.getMessages(args); if(msg!=null) { System.out.println(msg); } mqget.closeQueue(); mqget.disconnectMq(); } catch (Exception e) { e.printStackTrace(); System.out.println("Usage: "+mqget.getClass().getName()+" "); } } } |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |