ActiveMQ Exception when trying to work with SSL

岁酱吖の 提交于 2019-12-11 08:15:05

问题


I'm trying to send secure messages over SSL with ActiveMQ, using the Apache NMS API for .NET.

In the broker.xml I tried adding "sslEnabled=true" to the default acceptor:

<acceptor name="artemis">tcp://0.0.0.0:61616?sslEnabled=true;tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=CORE,AMQP,STOMP,HORNETQ,MQTT,OPENWIRE;useEpoll=true;amqpCredits=1000;amqpLowCredits=300</acceptor>

I'm trying to set up a consumer like this:

IConnectionFactory factory = new ConnectionFactory("activemq:tcp://localhost:61616");
connection = (Connection)factory.CreateConnection();                       
connection.Start();
ISession session = connection.CreateSession();
IDestination destination = session.GetTopic("topic1");
consumer = session.CreateConsumer(destination);
consumer.Listener += new MessageListener(HandleMessage);

When the code reaches the line connection.Start(), I get this exception:

Channel was inactive for too long: tcp://localhost:61616/

I have tried changing the connection url like this (ssl in the middle instead of tcp):

IConnectionFactory factory = new ConnectionFactory("activemq:ssl://localhost:61616");

And then I got this exception:

Unable to read data from the transport connection: An established connection was aborted by the software in your host machine

What am I doing wrong here? How can I send and receive secured messages?

来源:https://stackoverflow.com/questions/58201771/activemq-exception-when-trying-to-work-with-ssl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!