Mahak created FALCON-1126:
-----------------------------
Summary: Custom JMS client unable to recieve messages for topics
created for feeds
Key: FALCON-1126
URL: https://issues.apache.org/jira/browse/FALCON-1126
Project: Falcon
Issue Type: Bug
Reporter: Mahak
Hi,
I am trying to write a JMS client to receive messages by subscribing to topics
created by falcon for feeds that I submit and scheduled.
Following is my understanding about the falcon JMS architecture:
1. Whenever a feed is scheduled falcon creates a topic for the same.
2. The name of this topic is same as that of the feed.
3. The broker URL to create a ConnectionFactory instance to subscribe to this
topic is the one mentioned in conf/startup.xml.
4. The client ID used for setting up the connection object can be any string.
Following is the code that I'm using to subscribe to feed named
repl-cltOne-cltTwo-with-hcat-Mar27-1:
ConnectionFactory connectionFactory = new
ActiveMQConnectionFactory("","","tcp://<falcon_server>:61616");
Connection connection =null;
try {
String falconClientID = "some-user";
connection = connectionFactory.createConnection();
connection.setClientID(falconClientID);
TopicSession topicSession =
(TopicSession)connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
Topic destination
=topicSession.createTopic("repl-cltOne-cltTwo-with-hcat-Mar27-1");
TopicSubscriber topicSubscriber =
topicSession.createDurableSubscriber(destination,falconClientID);
connection.start();
javax.jms.Message message = topicSubscriber.receive(1000);
//if(textMessage != null){
String text = message.toString();
System.out.println("message received : " + text);
//}else{
//System.out.println("Nothing returned from receive method");
//}
connection.close();
} catch (JMSException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}catch (Exception e){
e.printStackTrace();
if(connection!=null){
connection.close();
}
}
Please mind my naivety, I'm pretty new to JMS messaging.
Any help is greatly appreciated.
Regards,
Mahak Mukhi
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)