Announcement Announcement Module
Collapse
No announcement yet.
Lost thread when sending message using jmsTemplate.send Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Lost thread when sending message using jmsTemplate.send

    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() {....}
    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());
    			}
    		}
    Any suggestions would be appreciate.
Working...
X