Springframework.jms.support.JmsAccessor does not h

2019-09-02 14:36发布

问题:

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.