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": [
{
"name": "volume",
"type": "integer",
"value": "3"
}
]
},
{
"type": "Queue",
"isPattern": "false",
"id": "Queue.optimizer_queue",
"attributes": [
{
"name": "volume",
"type": "integer",
"value": "4"
}
]
}
],
"updateAction": "APPEND"
}
I have a subscription which is supposed to send these event (when the volume has changed) to CEP for processing.
{
"entities": [
{
"type": "Queue",
"isPattern": "true",
"id": "Queue.*"
}
],
"attributes": [
"volume"
],
"reference": "http://<cep-host>:8080/ProtonOnWebServer/rest/events",
"duration": "P1M",
"notifyConditions": [
{
"type": "ONCHANGE",
"condValues": [
"volume"
]
}
],
"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?
The solution is simply to remove the throttling. Throttling applies to the entire subscription, not just to a single object in the matched pattern.