Springframework.jms.support.JmsAccessor does not have createConnection(userid,pwd) method

荒凉一梦 提交于 2019-12-12 04:05:58

问题


I am writing sample Apache Camel (2.16.2) application that connects to IBM MQ queue manager in clients mode. Apache Camel uses Spring JMS underneath to connect to JMS providers. I see that Spring JmsAccessor does not have a createConnection() method that takes UserId and Password. It only has createConnection() method that does not take any parameters. Because of this create connection to queue manager fails with 2035 - Not authorized.

I can connect to queue manager in server bindings mode but I need to connect in client mode as queue manager runs in a different machine. Is there a way I can get around this problem?


回答1:


Wrap your ConnectionFactory in a UserCredentialsConnectionFactoryAdapter.



来源:https://stackoverflow.com/questions/35103679/springframework-jms-support-jmsaccessor-does-not-have-createconnectionuserid-pw

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!