获取 TIBCO EMS 队列
Getting TIBCO EMS Queue
我尝试创建 class java 可以访问 EMS 队列检查待处理消息
但它在 TibjmsAdmin admin = new TibjmsAdmin("tcp://local host:7222","admin","");
行给我错误
在我的简单代码下方
public static void main(String[] args) throws TibjmsAdminException {
TibjmsAdmin admin = new TibjmsAdmin("tcp://localhost:7222","admin","");
String destName = null;
QueueInfo di = admin.getQueue("test");
StatData iStats = di.getInboundStatistics();
StatData oStats = di.getOutboundStatistics();
long pendingMessages = di.getPendingMessageCount();
long pendingSize = di.getPendingMessageSize();
long inMsgRate = iStats.getMessageRate();
long inByteRate = iStats.getByteRate();
long outMsgRate = oStats.getMessageRate();
long outByteRate = oStats.getByteRate();
System.out.println(pendingMessages);
}
我尝试做的方法可以给他队列名称它给我待处理的消息
Error :
run:
Exception in thread "main" java.lang.NoClassDefFoundError: com/tibco/tibjms/TibjmsQueueConnectionFactory
at com.tibco.tibjms.admin.MessengerUtil.(MessengerUtil.java:46)
at com.tibco.tibjms.admin.TibjmsAdmin.(TibjmsAdmin.java:424)
at com.tibco.tibjms.admin.TibjmsAdmin.(TibjmsAdmin.java:405)
at EMS.main(EMS.java:31)
Caused by: java.lang.ClassNotFoundException: com.tibco.tibjms.TibjmsQueueConnectionFactory
at java.net.URLClassLoader.run(URLClassLoader.java:366)
at java.net.URLClassLoader.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 4 more
Java Result: 1
BUILD SUCCESSFUL (total time: 0 seconds)
将 tibjms.jar 文件放入您的 class 路径
java -cp <path to jar>/tibjms.jar:<all my other jars>
我尝试创建 class java 可以访问 EMS 队列检查待处理消息
但它在 TibjmsAdmin admin = new TibjmsAdmin("tcp://local host:7222","admin","");
行给我错误
在我的简单代码下方
public static void main(String[] args) throws TibjmsAdminException {
TibjmsAdmin admin = new TibjmsAdmin("tcp://localhost:7222","admin","");
String destName = null;
QueueInfo di = admin.getQueue("test");
StatData iStats = di.getInboundStatistics();
StatData oStats = di.getOutboundStatistics();
long pendingMessages = di.getPendingMessageCount();
long pendingSize = di.getPendingMessageSize();
long inMsgRate = iStats.getMessageRate();
long inByteRate = iStats.getByteRate();
long outMsgRate = oStats.getMessageRate();
long outByteRate = oStats.getByteRate();
System.out.println(pendingMessages);
}
我尝试做的方法可以给他队列名称它给我待处理的消息
Error : run: Exception in thread "main" java.lang.NoClassDefFoundError: com/tibco/tibjms/TibjmsQueueConnectionFactory at com.tibco.tibjms.admin.MessengerUtil.(MessengerUtil.java:46) at com.tibco.tibjms.admin.TibjmsAdmin.(TibjmsAdmin.java:424) at com.tibco.tibjms.admin.TibjmsAdmin.(TibjmsAdmin.java:405) at EMS.main(EMS.java:31) Caused by: java.lang.ClassNotFoundException: com.tibco.tibjms.TibjmsQueueConnectionFactory at java.net.URLClassLoader.run(URLClassLoader.java:366) at java.net.URLClassLoader.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:425) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) ... 4 more Java Result: 1 BUILD SUCCESSFUL (total time: 0 seconds)
将 tibjms.jar 文件放入您的 class 路径
java -cp <path to jar>/tibjms.jar:<all my other jars>