Hi. I'm new with JMS and I'm trying to count how many message a queue have.
When I run the code with my Eclipse i get the right result.
But when I deploy in LOCAL weblogic I get:
javax.jms.JMSException: Unknown foreign destination
This line throws the exception
JMSDestinationRuntimeMBean destMBean = JMSRuntimeHelper.getJMSDestinationRuntimeMBean(ctx, queue);
The queue it's not in my LOCAL weblogic. I mean:
env.put(Context.PROVIDER_URL, " t3://172.xx.xxx.xxx:port");
How the proper way to solve this?
I got the impression that the JMS destination is not a WebLogic destination. In other words, it is a JMS destination that is running on a foreign JMS provider. If it is the case, I don't think you can use JMSRuntimeHelper to access the MBeans because the helper only works with WLS JMS destinations.
You need to use the JMX capability provided by the foreign JMS provider.