Activemq http proxy

I need to connect an ActiveMQ-Listener to a broker outside the firewall through an HTTP / HTTPS proxy. I searched everywhere, but did not find a solution, how to set proxy settings for AcitveMQ-Client.

ActiveMQ uses Apache HttpClient, but I don’t know how to manipulate the creation of this client in ActiveMQ. Using htttps.proxyHost and https.proxyPort is not used by HttpClient.

Is there a way to set the global http / https proxy for all instances of HttpClient?

+7
source share
1 answer

ActiveMQ HttpClientTransport contains the following methods that you can use to specify the host and port of the proxy:

public void setProxyHost(String proxyHost) public void setProxyPort(int proxyPort) 

For version 5.6+, you can also specify the proxy username and password:

 public void setProxyUser(String proxyUser) public void setProxyPassword(String proxyPassword) 

To configure JmsInvokerProxyFactoryBean:

 <bean id="jmsClientFactory" class="org.apache.activemq.ActiveMQConnectionFactory"> <property name="brokerURL"> <value>http://myendpoint.somewhere.com:5186?proxyUser=fred&amp;proxyPassword=ahoy&amp;proxyHost=myproxyhost.somewhere.com&amp;proxyPort=8081</value> </property> </bean> <bean id="remotingService" class="org.springframework.jms.remoting.JmsInvokerProxyFactoryBean"> <property name="serviceInterface" value="com.foo.CheckingAccountService"/> <property name="connectionFactory" ref="jmsClientFactory"/> <property name="queue" ref="queue"/> </bean> 
+5
source

All Articles