I'm doing a test for jmsTemplate.send.
Shut down the Message Queue broker after initializing the Application(spring bean) and then trying to send message using
jmsTemplate.send(jmsTemplate.send(new MessageCreator() {....}Any suggestions would be appreciate.Code:private void sendMessage(final LWDMessage lwdMessage) throws JMSException{ try{ System.out.println("in SendMessage ...."); System.out.println("jms template ...." + jmsTemplate.toString()); jmsTemplate.send(new MessageCreator() { public Message createMessage(Session session) throws JMSException { System.out.println("Creating the message from object with session." + session.toString()); Message m = messageService.getMessage(lwdMessage,session); System.out.println("Created the message from object with session." + session.toString()); return m; } }); System.out.println("sendmessage"); }catch (Exception e){ System.out.println("error while sending message , broker down"); throw new JMSException("error: " + e.getMessage()); } }


Reply With Quote