繁体   English   中英

Orion - 发送多个更新的模式订阅

[英]Orion - pattern subscription to send multiple updates

当对象发生变化时,我使用 Orion 向 Proton-CEP 发送更新。

但是,我每隔几秒钟就会更新很多这样的对象。 因此,我将这些更新分批发送给 Orion,如下所示:

{
    "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"
}

我有一个订阅,它应该将这些事件(当音量改变时)发送到 CEP 进行处理。

{
    "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 配置为侦听这些事件,并将它们写入文件。 不幸的是,只写入了第一个元素。

我已经通过使用提供的累加器服务器脚本确认这不是 CEP 问题。 我只能看到一个更新被公开:

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 -

Orion 可以为所有已更改的元素发送更新吗?

解决方案很简单,就是去除节流。 限制适用于整个订阅,而不仅仅是匹配模式中的单个对象。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM