[jboss-user] [Messaging, JMS & JBossMQ] - Re: JBoss 4.0.2 MDB bind to remote MQSeries

srikanth_vals do-not-reply at jboss.com
Tue Jun 26 08:39:50 EDT 2007


Hi ,
      I have written a sample MDB ,please find code below and i could receive message from MQ Queue but could not put in queue.
I have followed the steps in http://wiki.jboss.org/wiki/Wiki.jsp?page=UsingWebSphereMQSeriesWithJBossASPart4

I need it very urgently, please help



         TextMessage tm = (TextMessage)m;

         String text = tm.getText();
         System.out.println("message " + text + " received");
         String result = process(text);
         System.out.println("message processed, result: " + result);

         conn = getConnection();
         session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
         System.out.println("Bef ic");
		 InitialContext ic = new InitialContext();
         Queue que = (Queue)ic.lookup("newq");
         System.out.println("Aft ic");

         Destination replyTo = (Queue)que;
         System.out.println(replyTo.toString());
         MessageProducer producer = session.createProducer(replyTo);
         System.out.println("Aft crt prod");
         TextMessage reply = session.createTextMessage(result);

         producer.send(reply);
         producer.close();


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4057697#4057697

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4057697



More information about the jboss-user mailing list