ActiveMQ HttpClientTransport包含以下可用于指定代理主机和端口的方法:
public void setProxyHost(String proxyHost)
public void setProxyPort(int proxyPort)
对于 5.6+ 版本,您还可以提供代理用户名和密码:
public void setProxyUser(String proxyUser)
public void setProxyPassword(String proxyPassword)
要配置 JmsInvokerProxyFactoryBean:
<bean id="jmsClientFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL">
<value>http://myendpoint.somewhere.com:5186?proxyUser=fred&proxyPassword=ahoy&proxyHost=myproxyhost.somewhere.com&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>