Mqqueueconnectionfactory

mqqueueconnectionfactory
@SpringBootApplication
public class WmqSenderApplication {

public static void main(String[] args) {
ConfigurableApplicationContext ctx = SpringApplication.run(WmqSenderApplication.class, args);
JmsTemplate jmsTemplate = ctx.getBean(JmsTemplate.class);
jmsTemplate.send(“TEST_QUEUE”,new MessageCreator() {

@Override
public Message createMessage(Session session) throws JMSException {
TextMessage message = session.createTextMessage();
mqqueueconnectionfactory best of mqqueueconnectionfactory
message.setJMSReplyTo(new MQDestination(“REPLY_QUEUE”));//com.ibm.mq.jms.MQDestination
return message;
}
});

}

@Bean
public MQQueueConnectionFactory connFac() throws JMSException {
MQQueueConnectionFactory cf = new MQQueueConnectionFactory();
mqqueueconnectionfactory best of mqqueueconnectionfactory
cf.setTransportType(1);
cf.setHostName(“localhost”);
cf.setPort(1417);
cf.setQueueManager(“TEST”);
cf.setChannel(“CHANNEL”);
return cf;
}
@Bean
public JmsTemplate jmsTemplate() throws JMSException {
return new JmsTemplate(connFac());
mqqueueconnectionfactory best of mqqueueconnectionfactory
}
}

com.ibm.msg.client.jms.DetailedInvalidDestinationException:
JMSCMQ0005: The destination name ‘://REPLY_QUEUE’ was not valid. The destination name specified does not conform to published destination syntax. Correct the specified destination name and try again.

Destination replyToQ = session.createQueue(“REPLYQ”);
TextMessage message = session.createTextMessage();
message.setJMSReplyTo(replyToQ);
return message;
mqqueueconnectionfactory informational mqqueueconnectionfactory

jmsTemplate.send(“TEST_QUEUE”,new MessageCreator() {

@Override
public Message createMessage(Session session) throws JMSException {
TextMessage message = session.createTextMessage();
Queue queue = session.createQueue(“REPLY_QUEUE”);
message.setJMSReplyTo(queue);
return message;
}
mqqueueconnectionfactory informational mqqueueconnectionfactory
});
mqqueueconnectionfactory

Gogo Blendit

Zizaran Rf Build