Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

activemq http proxy

I need to connect a ActiveMQ-Listener to a broker outside the firewall through an HTTP/HTTPS-Proxy. I've searched everywhere but haven't found a solution how to set the proxy settings for the AcitveMQ-Client.

ActiveMQ is using Apache HttpClient but I don't know how to manipulate the creation of this client within ActiveMQ. The use of htttps.proxyHost and https.proxyPort is not used by the HttpClient.

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

like image 838
buddha089 Avatar asked Jan 18 '13 09:01

buddha089


People also ask

Does ActiveMQ use HTTP?

ActiveMQ implements a RESTful API to messaging which allows any web capable device to publish or consume messages using a regular HTTP POST or GET.

Does ActiveMQ use TCP or UDP?

All the kinds of clients and protocols which ActiveMQ supports use TCP as their transport layer. WebSockets specifically use TCP. Save this answer.

What protocol does ActiveMQ use?

0 ActiveMQ has support for automatic wire protocol detection over TCP, SSL, NIO, and NIO SSL. OpenWire, STOMP, AMQP, and MQTT are supported.

What is ActiveMQ Artemis?

Apache ActiveMQ Artemis is an asynchronous messaging system, an example of Message Oriented Middleware , we'll just call them messaging systems in the remainder of this book.


1 Answers

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

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

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

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

To configure a 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>
like image 155
Nicholas Avatar answered Sep 19 '22 00:09

Nicholas