【问题标题】:FIWARE Orion: notification responsesFIWARE Orion:通知响应
【发布时间】:2018-09-30 18:01:51
【问题描述】:

在 Orion 我可以创建订阅:

curl localhost:1026/v2/subscriptions -s -S --header 'Content-Type: application/json' \
    -d @- <<EOF
{
  "description": "A subscription to get info about Room1",
  "subject": {
    "entities": [
      {
        "id": "Room1",
        "type": "Room"
      }
    ],
    "condition": {
      "attrs": [
        "pressure"
      ]
    }
  },
  "notification": {
    "http": {
      "url": "http://localhost:1028/accumulate"
    },
    "attrs": [
      "temperature"
    ]
  },
  "expires": "2040-01-01T14:00:00.00Z",
  "throttling": 5
}
EOF

在本例中,Orion 将在服务器 http://localhost:1028/accumulate 上执行 POST 请求。有没有办法从 Orion 收到的 POST 中检索响应?即 200、404... 在我的用例中,通知执行 POST 请求以在另一台服务器上创建一些资源。 POST 返回所创建资源的位置。检索这些位置会很有用。

【问题讨论】:

  • “在 Orion 中我可以创建通知”。您的意思是“创建订阅”吗?
  • 是的,已更正。

标签: fiware-orion


【解决方案1】:

Orion 不会记录对其发送的通知的响应。它实现了“一劳永逸”的方法,很少关注通知请求的响应。实际上,Orion 会查看最后一个通知的响应,并使用它来设置lastFailurelastSuccess 时间戳(视情况而定),如果响应有错误代码,则将status 设置为failed

可以使用中间的系统来解决您的情况。我的意思是,一些桥接软件从 Orion 接收通知,转发到最终系统,获取响应并对此类响应执行任何处理(例如,存储刚刚创建的资源的位置)。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-08
    • 1970-01-01
    相关资源
    最近更新 更多