ibm-messaging / mq-jms-spring

Components to assist MQ JMS integration with Spring frameworks
Apache License 2.0
189 stars 102 forks source link

inject multiple jmstemplate connections in Spring boot #85

Closed u742936 closed 1 year ago

u742936 commented 2 years ago

Using, java 8 spring boot 2.5.0 spring jms 5.3.7 ibm mq 8.0.0.5

using spring boot and application.yml file i have set ibm.mq.queueManager , ibm.mq.channel, ibm.mq.connName and using @Autowired JmsTemplate jmstemplate; I am able to successfully connect to the MQ

but i have second Queuemanager, want to know how to instantiate jmstemplate2 with new set of values in application.yml which are named as ibm.mq2.queueManager , ibm.mq2.channel, ibm.mq2.connName

Is there a easier way to configure it, like below @Autowired @Qualifier("ibm.mq") JmsTemplate jmstemplate;

@Autowired @Qualifier("ibm.mq2") JmsTemplate jmstemplate2;

or do i have to follow this approach https://stackoverflow.com/questions/49520412/spring-boot-multiple-jms-connections

can you pls guide me

ibmmqmet commented 2 years ago

See, for example, https://github.com/ibm-messaging/mq-jms-spring/issues/7 and an article linked from there at https://dev.to/adzubla/using-multiple-jms-servers-with-spring-boot-3cbm

Supreja commented 1 year ago

MqconnectionFactoryFactory is not working.