Look into the following code. I am always getting message as null. why I am not 
able to receive the message?

  |                     Properties props = new Properties();
  |                     props.setProperty("java.naming.factory.initial",
  |                                     
"org.jnp.interfaces.NamingContextFactory");
  |                     props.setProperty("java.naming.factory.url.pkgs",
  |                                     "org.jboss.naming");
  |                     props.setProperty("java.naming.provider.url", 
"localhost");
  |                     Context context = new InitialContext(props);
  |                     TopicConnectionFactory tcf = (TopicConnectionFactory) 
context
  |                                     .lookup("ConnectionFactory");
  |                     conn = tcf.createTopicConnection();
  |                     topic = (Topic) context.lookup("topic/BccTopic");
  |                     session = conn.createTopicSession(false,
  |                                     TopicSession.AUTO_ACKNOWLEDGE);
  |                     conn.start();
  |                     TopicPublisher send = session.createPublisher(topic);
  |                     TextMessage tm = 
session.createTextMessage("TestMessage");
  |                     send.publish(tm);
  |                     send.close();
  | 
  |                     TopicSubscriber topicSubscriber = 
session.createSubscriber(topic);
  |                     Message msg = topicSubscriber.receive(50);


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

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4156624
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to