使用HTTP传输通过代理将消息推送到活动MQ

问题描述:

我正在尝试通过http传输将消息推送到活动的mq. 活动的mq位于代理服务器之后,在将消息推送到外部活动的mq之前,该代理服务器需要进行身份验证. 有没有办法将代理详细信息设置为活动的mq连接.

Hi I am trying to push messages to active mq via http transport. The active mq is behind the proxy server which need authentication before pushing the message to external active mq. is there a way I can set the proxy details to active mq connection.

我阅读了一些文章,其中提到我们可以使用HttpClientTrasport. 但是我不确定如何将HttpClientTrasport设置为ActiveMQConnection对象. 预先感谢.

I read some article where mentioned we can use HttpClientTrasport. But i am not sure how to set the HttpClientTrasport to ActiveMQConnection object. Thanks in advance.

如果我了解您要为org.apache.activemq.ActiveMQConnection设置代理配置? 可以在org.apache.activemq.ActiveMQConnectionFactory.ActiveMQConnectionFactory(String brokerURL)级别上通过将url与代理配置一起传递来设置: brokerURL =" http://localhost:8080?proxyHost = proxy& proxyPort = 8080& proxyUser = user& proxyPassword = pwd "

if i understand you want to set the proxy config for org.apache.activemq.ActiveMQConnection ? this can be set on org.apache.activemq.ActiveMQConnectionFactory.ActiveMQConnectionFactory(String brokerURL) level by passing the url with proxy config like this : brokerURL = "http://localhost:8080?proxyHost=proxy&proxyPort=8080&proxyUser=user&proxyPassword=pwd"

如果用户或pwd上有特殊字符,则需要这样更改: brokerURL =" http://localhost:8080 ?" + URLEncoder.encode("proxyHost = proxy& proxyPort = 8080& proxyUser = user& proxyPassword = pwd," UTF-8);

if you have specials characters on user or pwd you need to change like this : brokerURL = "http://localhost:8080?"+ URLEncoder.encode("proxyHost=proxy&proxyPort=8080&proxyUser=user&proxyPassword=pwd", "UTF-8");

希望获得帮助