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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ssl/3.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 Destinationsource.getQueues不';t使用SSL连接返回正确数量的队列_Java_Ssl_Activemq - Fatal编程技术网

Java Destinationsource.getQueues不';t使用SSL连接返回正确数量的队列

Java Destinationsource.getQueues不';t使用SSL连接返回正确数量的队列,java,ssl,activemq,Java,Ssl,Activemq,我想知道我的ActiveMQ上的队列数量,我有以下代码,可用于我的本地ActiveMQ安装: ActiveMQSslConnectionFactory connectionFactory = new ActiveMQSslConnectionFactory(url); //connectionFactory.setTrustStore("truststore.ts"); //connectionFactory.setTrustStorePassword("password"); ActiveM

我想知道我的ActiveMQ上的队列数量,我有以下代码,可用于我的本地ActiveMQ安装:

ActiveMQSslConnectionFactory connectionFactory = new ActiveMQSslConnectionFactory(url);
//connectionFactory.setTrustStore("truststore.ts");
//connectionFactory.setTrustStorePassword("password");

ActiveMQConnection connection = (ActiveMQConnection) connectionFactory.createConnection();
connection.start();

DestinationSource destinationQueues = connection.getDestinationSource();        
Set<ActiveMQQueue> queues = destinationQueues.getQueues();  

System.out.println(queues.size());
ActiveMQSslConnectionFactory connectionFactory=新的ActiveMQSslConnectionFactory(url);
//connectionFactory.setTrustStore(“truststore.ts”);
//connectionFactory.setTrustStorePassword(“密码”);
ActiveMQConnection连接=(ActiveMQConnection)connectionFactory.createConnection();
connection.start();
DestinationSource destinationQueues=连接。getDestinationSource();
Set queues=destinationQueues.getQueues();
System.out.println(queues.size());
但是,当我在服务器上的ActiveMQ上使用它时(使用truststore),它将返回零队列。我知道连接是有效的,因为我可以使用一个确切队列中的消息。我已经尝试过其他线程的提示,比如
sleep
,但仍然不起作用


可能是因为SSL连接,在这种情况下,我是否必须更改某些内容?提前感谢。

目标源位不能保证及时返回全套队列等。可能是您在代理上以不同的方式配置了SSL连接器,也可能是由于JDK实现上SSL的吞吐量慢得多,所以数据没有到达

找到了问题。它是ActiveMQ的一个设置,可以在ActiveMQ.xml中找到。零件
advisorySupport=“false”
导致了问题。注释此设置后,查询将返回队列的真实数量。

谢谢您的回答!那么,除了目标源之外,是否有任何可能使用SSL?或者在这种情况下,代理是否必须进行不同的配置?