falcon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pallavi Rao (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FALCON-1126) Custom JMS client unable to recieve messages for topics created for feeds
Date Tue, 31 Mar 2015 04:26:52 GMT

    [ https://issues.apache.org/jira/browse/FALCON-1126?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14387954#comment-14387954
] 

Pallavi Rao commented on FALCON-1126:
-------------------------------------

{quote}
2. The name of this topic is same as that of the feed.
{quote}
The name of the topic will be FALCON.<entity name>. So, in your case, it will be something
like, FALCON.repl-cltOne-cltTwo-with-hcat-Mar27-1
{quote}
3. The broker URL to create a ConnectionFactory instance to subscribe to this topic is the
one mentioned in conf/startup.xml.
{quote}
Nope. The connection properties for user topics (topics for user created entities) are picked
up from cluster definition. The messaging interface is used for the same. See http://falcon.apache.org/0.6-incubating/EntitySpecification.html#Cluster_Specification

{quote}
Following is the code that I'm using to subscribe to feed named repl-cltOne-cltTwo-with-hcat-Mar27-1:
...
Topic destination =topicSession.createTopic("repl-cltOne-cltTwo-with-hcat-Mar27-1");
...
{quote}
Topic should be FALCON.repl-cltOne-cltTwo-with-hcat-Mar27-1. Rest of the code looks fine to
me. You can use the Falcon code and UT as sample code for your consumer -> https://github.com/apache/falcon/blob/master/messaging/src/main/java/org/apache/falcon/messaging/JMSMessageConsumer.java


> 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)

Mime
View raw message