Simple JMS template usage example


/ Published in: Java
Save to your folder(s)

A simple usage example


Copy this code and paste it in your HTML
  1. public void sendJMS() {
  2. ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("spring-config.xml");
  3. JmsTemplate jmsTemplate = (JmsTemplate) applicationContext.getBean("jmsTemplate");
  4. jmsTemplate.send(new MessageCreator() {
  5. public Message createMessage(Session session) throws JMSException {
  6. return session.createTextMessage("hello queue world");
  7. }
  8. });
  9. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.