Details
-
Type: Monitor
-
Status: Closed
-
Priority: Major
-
Resolution: Done
-
Affects Version/s: None
-
Fix Version/s: 2021
-
Component/s: FIWARE-TECH-HELP
-
Labels:
-
HD-Chapter:Data
-
HD-Enabler:Orion
Description
Created question in FIWARE Q/A platform on 13-11-2015 at 11:11
Please, ANSWER this question AT http://stackoverflow.com/questions/33690740/orion-pattern-subscription-to-send-multiple-updates
Question:
Orion - pattern subscription to send multiple updates
Description:
I use Orion to send updates to Proton-CEP when a change of an object occurs.
However, I have many such objects updates occurring every few seconds. So I send these updates to Orion in batches, like this:
{
"contextElements": [
{
"type": "Queue",
"isPattern": "false",
"id": "Queue.routes_queue",
"attributes": [
]
},
{
"type": "Queue",
"isPattern": "false",
"id": "Queue.optimizer_queue",
"attributes": [
]
}
],
"updateAction": "APPEND"
}
I have a subscription which is supposed to send these event (when the volume has changed) to CEP for processing.
{
"entities": [
],
"attributes": [
"volume"
],
"reference": "http://<cep-host>:8080/ProtonOnWebServer/rest/events",
"duration": "P1M",
"notifyConditions": [
],
"throttling": "PT1S"
}
CEP is configured to listen to these events, and write them to a file. Unfortunately, only the first element is written.
I have confirmed that this is not a CEP problem by using the provided accumulator-server script. I can see only a single update being exposed:
POST http://localhost:1028/accumulate
Content-Length: 741
User-Agent: orion/0.24.0 libcurl/7.19.7
Host: localhost:1028
Accept: application/xml, application/json
Content-Type: application/xml
<notifyContextRequest>
<subscriptionId>5645bb21abde60e23096acef</subscriptionId>
<originator>localhost</originator>
<contextResponseList>
<contextElementResponse>
<contextElement>
<entityId type="Queue" isPattern="false">
<id>Queue.routes_queue</id>
</entityId>
<contextAttributeList>
<contextAttribute>
<name>volume</name>
<type>integer</type>
<contextValue>4</contextValue>
</contextAttribute>
</contextAttributeList>
</contextElement>
<statusCode>
<code>200</code>
<reasonPhrase>OK</reasonPhrase>
</statusCode>
</contextElementResponse>
</contextResponseList>
</notifyContextRequest>
=======================================
::1 - - [13/Nov/2015 10:29:05] "POST /accumulate HTTP/1.1" 200 -
Can Orion send updates for all elements that have changed?
2015-11-13 12:05|CREATED monitor | # answers= 1, accepted answer= False