Its depend on the consumer. You can define consumer group and consumer id based 
on your needs. For example using the following URL, I am subscribing to a topic 
testtopic with consumer group as CG1 and consumer as c1.

http://10.12.5.163:30227/events/testtopic/CG1/C1?timeout=1000


Thanks,
Sunil

From: Migdal, Marcin (Nokia - PL/Wroclaw) [mailto:marcin.mig...@nokia.com]
Sent: Friday, April 06, 2018 10:12 AM
To: UNNAVA, SUNIL <su6...@att.com>; MUNNELLI, BHAVANI <bm8...@att.com>; 
onap-discuss@lists.onap.org
Cc: KOYA, RAMPRASAD <rk5...@att.com>; LUNANUOVA, DOMINIC <d...@research.att.com>
Subject: Re: Testing Dmaap locally - problems with reading messages


Hello Sunil,



How to determine consumerGroup and consumerId?

May they have any values?

I have found that there is exposed REST API that enables registering consumer 
to topic:
curl  --request PUT localhost:3904/topics/testTopic/consumers/consumerId

But when I call it, then there is thrown NullPointerException:
Caused by: java.lang.NullPointerException
    at com.att.nsa.security.NsaAclUtils.updateAcl(NsaAclUtils.java:74)
    at 
com.att.nsa.cambria.beans.DMaaPKafkaMetaBroker$KafkaTopic.updateAcl(DMaaPKafkaMetaBroker.java:412)
    at 
com.att.nsa.cambria.beans.DMaaPKafkaMetaBroker$KafkaTopic.permitReadsByUser(DMaaPKafkaMetaBroker.java:399)
    at 
com.att.nsa.cambria.service.impl.TopicServiceImpl.permitConsumerForTopic(TopicServiceImpl.java:595)
    at 
com.att.nsa.dmaap.service.TopicRestService.permitConsumerForTopic(TopicRestService.java:582)

How to stub
com.att.nsa.security.NsaAclUtils.updateAcl(NsaAclUtils.java:74)
for local run of DMaap so that I could register consumer to topic?

Regards,
Marcin



________________________________
From: UNNAVA, SUNIL <su6...@att.com<mailto:su6...@att.com>>
Sent: Friday, April 6, 2018 3:39:44 PM
To: Migdal, Marcin (Nokia - PL/Wroclaw); MUNNELLI, BHAVANI; 
onap-discuss@lists.onap.org<mailto:onap-discuss@lists.onap.org>
Cc: KOYA, RAMPRASAD; LUNANUOVA, DOMINIC
Subject: RE: Testing Dmaap locally - problems with reading messages


Marcin,



Consumers has to subscribe to a topic to receive the events. Consumer will 
receive the messages published after subscribed to a topic. Subscriber URL 
({host}:3904/events/testTopic/{consumerGroup}/{consumerId}) is used to both 
subscribe to a topic and receive messages from the topic. ConsumerGroup and 
ConsumerId are used to uniquely identify a subscriber. You will not receive 400 
as response code even when you are trying to subscribe to a consumer.



Thanks,

Sunil



From: Migdal, Marcin (Nokia - PL/Wroclaw) [mailto:marcin.mig...@nokia.com]
Sent: Friday, April 06, 2018 9:09 AM
To: UNNAVA, SUNIL <su6...@att.com<mailto:su6...@att.com>>; MUNNELLI, BHAVANI 
<bm8...@att.com<mailto:bm8...@att.com>>; 
onap-discuss@lists.onap.org<mailto:onap-discuss@lists.onap.org>
Cc: KOYA, RAMPRASAD <rk5...@att.com<mailto:rk5...@att.com>>; LUNANUOVA, DOMINIC 
<d...@research.att.com<mailto:d...@research.att.com>>
Subject: Testing Dmaap locally - problems with reading messages



Hello



I managed to run Dmaap locally with code from master branch.

I am able to list existing queues:

Request:
curl --request GET localhost:3904/topics/listAll
Response:
{"topics": [
    {
        "owner": "",
        "txenabled": false,
        "topicName": "msgrtr.apinode.metrics.dmaap"
    },
    {
        "owner": "",
        "txenabled": false,
        "topicName": "testTopic"
    }
]}



Also sending messages to quese seems to work fine:
Request:

curl --header "Content-type: application/json" --request POST --data 
'{"message":"messageContent"}' http://localhost:3904/events/testTopic

Response:

{
    "serverTimeMs": 2,
    "count": 1
}



Also in logs there are entries that message has been published:



""2018-04-06 12:59:09,875 [qtp1555093762-2808] INFO  
com.att.nsa.dmaap.service.EventsRestService - Publishing message to topic 
testTopic
""2018-04-06 12:59:09,879 [qtp1555093762-2808] INFO  
com.att.nsa.cambria.service.impl.EventsServiceImpl - Published 1 msgs in 2ms 
for topic testTopic



Now target is to read messages from topic named testTopic



According to:

http://onap.readthedocs.io/en/amsterdam/submodules/dmaap/messagerouter/messageservice.git/docs/Installation/Installation.html
<https://urldefense.proofpoint.com/v2/url?u=http-3A__onap.readthedocs.io_en_amsterdam_submodules_dmaap_messagerouter_messageservice.git_docs_Installation_Installation.html&d=DwMF-g&c=LFYZ-o9_HUMeMTSQicvjIg&r=t27CRRmn7U12dnOvcSPfcQ&m=RPD2w4klVamKihTTyV_e2UhKEVnJsDSMaR3ECoMTgw4&s=Eqa_W65gMh333DpomJvedIb7EsRdGC-4_IkhHjSsyDs&e=>

below request should work fine:

curl -H "Content-Type:text/plain" -GET 
http://localhost:3904/events/testTopic/CG1/C1?timeout=1000

But it does not work. Also logs confirm that:

2018-04-06 13:03:25.608:WARN:oejh.HttpParser:qtp1555093762-2885: badMessage: 
400 for HttpChannelOverHttp@7a1b89e8{r=0,c=false,a=IDLE,uri=-}

>From EventsRestService implementation I can see that request should look like 
>as below one:
curl  --request GET localhost:3904/events/testTopic/{consumerGroup}/{consumerId}
But I do not know consumerGroup and ConsumerID.

So question how to read messages from DMaap using DMaap REST API?

Best regards,
Marcin Migdal
_______________________________________________
onap-discuss mailing list
onap-discuss@lists.onap.org
https://lists.onap.org/mailman/listinfo/onap-discuss

Reply via email to