[jboss-user] [Messaging, JMS & JBossMQ] - JMS Subsctiber not receiving message

kks_krishna do-not-reply at jboss.com
Mon Jun 9 06:26:39 EDT 2008


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



More information about the jboss-user mailing list