2015-01-26 5 views
2

OrionCB의 기존 엔티티 속성에 대한 구독을 만들려고합니다.성공 사례가보고되었지만 구독이 표시되지 않습니다.

URL http://130.206.80.120:1026/NGSI10/subscribeContext

방법 POST

헤더 콘텐츠 형식 : 응용 프로그램/XML

바디

<?xml version="1.0"?> 
<subscribeContextRequest> 
    <entityIdList> 
    <entityId type="finesce_meteo" isPattern="false"> 
     <id>finesce_meteo</id> 
    </entityId> 
    </entityIdList> 
    <attributeList> 
    <attribute>precip</attribute> 
    </attributeList> 
    <reference>http://localhost:5050/notify</reference> 
    <duration>P100Y</duration> 
    <notifyConditions> 
    <notifyCondition> 
     <type>ONCHANGE</type> 
     <condValueList> 
     <condValue>precip</condValue> 
     </condValueList> 
    </notifyCondition> 
    </notifyConditions> 
    <throttling>PT5S</throttling> 
</subscribeContextRequest> 

이 작업이 몸, 200 OK 헤더 코드를 검색 :

<subscribeContextResponse> 
    <subscribeResponse> 
    <subscriptionId>54c5f049286043784451d08b</subscriptionId> 
    <duration>P100Y</duration> 
    <throttling>PT5S</throttling> 
    </subscribeResponse> 
</subscribeContextResponse> 

문제는 내가 생성되었는지 확인하려고 할 때입니다. 구독을 나열하려고하면 나타나지 않습니다. 이 줄을 사용하고 있습니다 :

echo 'db.csubs.find().pretty()' | mongo orion 

그러나이 구독을 unsubscribeContextRequest로 삭제하면 200 OK 코드가 나타납니다. 이 구독이 존재 함을 나타냅니다.

가입이 생성되고 삭제 되었기 때문에 가입 사실이 표시되고 구독을 나열하는 순간은 거의 나타나지 않습니다.

제발, 거기에 뭔가 잘못된가요?

나는 cygnus proccess가 시작된 것을 시도하고 있으며, cygnus와 동일한 프로세스가 중단되어 같은 결과를 얻었습니다.

감사

+0

질문을 편집하여 Orion Context Broker를 시작한 명령 줄을 표시하십시오. 일반적으로'ps ax | grep contextBroker' 명령을 사용하십시오. – fgalan

+0

[root @ orioncb ~] # ps ax | grep contextBroker 6889 pts/1 S + 0:00 grep contextBroker 28707? Ssl 672 : 56/usr/bin/contextBroker -port 1026 -logDir/var/log/contextBroker -pidpath /var/log/contextBroker/contextBroker.pid -dbhost localhost -db orion – user2677744

답변

0

몽고는 find() 명령으로이 부분 (예를 들어, 30 개 이상은) 당신이 찾고있는 특정 하나가 검색되지 않는 경우가 발생할 수보다 더 많은 구독을 따라서 경우, 쿼리와 일치하는 처음 20 개 결과를 반환합니다. (mongo 대화 형 셸을 사용하면 it 명령을 사용하여 20 개 결과를 얻을 수 있지만 mongo가 비대화 형 모드로 실행될 때 어떻게 작동하는지 잘 모르는 경우).

따라서 검색어에서 검색하는 ID를 포함하는 것이 좋습니다. 즉, 당신은 단지 하나 개의 결과를 기대로

echo 'db.csubs.find({_id: ObjectId("54c90821286043500575eecf")}).pretty()' | mongo orion 

Morevoer, 당신은 findOne()을 사용할 수 있으며 pretty()의 사용을 저장 : 당신이 오리온 요청에서 얻을 ID가있는 경우 예를 들어, "54c90821286043500575eecf는"당신은 사용할 수 있습니다 :

echo 'db.csubs.findOne({_id: ObjectId("54c90821286043500575eecf")})' | mongo orion