Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/374.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 通过JMS中的消息获取客户机ID_Java_Jms_Messaging - Fatal编程技术网

Java 通过JMS中的消息获取客户机ID

Java 通过JMS中的消息获取客户机ID,java,jms,messaging,Java,Jms,Messaging,我试图通过JMS中的消息获取消息使用者的客户机id(或连接id) 当我只能访问接收到的消息时(如MessageListener接口的onMessage方法),有没有办法获取它 简短:我有一条jms消息,我想知道收到该消息的消费者的客户机id。连接对象是客户机与其jms提供程序的活动连接。它通常 在Java虚拟机(JVM)外部分配提供程序资源。 连接接口的方法提供了以下方法 String getClientID() throws JMSException 此值特定于JMS提供程序。它由管理员在C

我试图通过JMS中的消息获取消息使用者的客户机id(或连接id)

当我只能访问接收到的消息时(如
MessageListener
接口的
onMessage
方法),有没有办法获取它


简短:我有一条jms消息,我想知道收到该消息的消费者的客户机id。连接对象是客户机与其jms提供程序的活动连接。它通常 在Java虚拟机(JVM)外部分配提供程序资源。 连接接口的方法提供了以下方法

String getClientID() throws JMSException

此值特定于JMS提供程序。它由管理员在ConnectionFactory对象中预配置,或由应用程序通过调用setClientID方法动态分配。

Ok,因此,我需要
连接
类的实例,并且我没有机会仅通过
消息
类的实例获取客户端id?是的,您必须获取连接类的实例才能获取客户端id。没有范围通过消息类实例获取客户端id。