Derzeit habe ich Probleme mit dem Senden von ActiveMQ
Nachricht an das Internet über Proxy-Server.So senden Sie eine Nachricht von ActiveMQ über Proxy
Meine Netzwerkarchitektur:
JMS Sender ---- |Proxy| --- JMS server (xx.xx.xx.xx) [on Internet]
ich auf ActiveMQ in der Dokumentation gesucht, aber nichts gefunden, ActiveMQ zu API. http://activemq.apache.org/tcp-transport-reference.html
Is it possible to send JMS message over proxy? Any solution for this problem?
Mein Code Arbeit gut auf LAN, aber wenn über Proxy senden, heben sie Fehler:
Code:
public void createConnection() throws JMSException {
String jmsURL = "tcp://xx.xx.xx.xx:61616";
TopicConnectionFactory factory
= (TopicConnectionFactory) new ActiveMQConnectionFactory(jmsURL);
TopicConnection connection = factory.createTopicConnection(); //Error here
TopicSession session = connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
Topic topic = session.createTopic(topicName);
TopicPublisher publisher = session.createPublisher(topic);
publisher.setPriority(PRIORITY);
publisher.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
}
Fehler:
Exception in thread "main" javax.jms.JMSException:
Could not connect to broker URL: tcp://xx.xx.xx.xx:61616. Reason: java.net.ConnectException: Connection timed out: connect
at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:36)
at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:360)
at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:305)
at org.apache.activemq.ActiveMQConnectionFactory.createTopicConnection(ActiveMQConnectionFactory.java:279)
at JMSSender.createConnection(JMSSender.java:55)
at MainClass.main(MainClass.java:142)
Caused by: java.net.ConnectException: Connection timed out: connect
Dank bro, ich werde es versuchen. –