我正在模拟一个虚拟场景来玩 Perseo 和 Orion。我正在使用 4 个 docker 容器:Mongo、Orion、Perseo FE 和 Perseo Core。他们都运行健康。
我正在做的步骤是:
- 首先,我使用 POST to Orion (
localhost:1026/v2/entities) 创建实体。该实体如下所示:
{
"id": "DummyEvent1",
"type": "DummyEvent",
"identification": {
"value": "default",
"type": "String"
}
}
- 其次,我创建了一个带有 POST 到 Orion (
localhost:1026/v2/subscriptions) 的订阅,以便将其DummyEvent从 Orion 推送到 Perseo:
{
"description": "A subscription to get info about DummyEvent1",
"subject": {
"entities": [
{
"id": "DummyEvent1",
"type": "DummyEvent"
}
],
"condition": {
"attrs": [ ]
}
},
"notification": {
"http": {
"url": "http://perseo-fe:9090/notices"
},
"attrs": [
"identification"
]
}
}
- 第三,如果我在 Orion (
localhost:1026/v2/subscriptions) 中获取所有订阅,我可以看到 Orion 将DummyEvent正确转发给 Perseo:
{
"id": "5ca5c18ab07f5ae96aa12152",
"description": "A subscription to get info about DummyEvent1",
"status": "active",
"subject": {
"entities": [
{
"id": "DummyEvent1",
"type": "DummyEvent"
}
],
"condition": {
"attrs": []
}
},
"notification": {
"timesSent": 1,
"lastNotification": "2019-04-04T08:34:18.00Z",
"attrs": [
"identification"
],
"attrsFormat": "normalized",
"http": {
"url": "http://perseo-fe:9090/notices"
},
"lastSuccess": "2019-04-04T08:34:18.00Z",
"lastSuccessCode": 200
}
}
- 第四,但是当我尝试使用以下方法在 Perseo (
localhost:8080/perseo-core/rules) 中发布规则时出现问题DummyEvent:
{
"name": "dummy_rule",
"text": "select * from DummyEvent",
"action": {
"type": "update",
"parameters": {
"name": "identification",
"value": "updatedValue",
"type": "string"
}
}
}
Perseo 告诉我:
{
"error": "Failed to resolve event type: Event type or class named 'DummyEvent' was not found [select * from DummyEvent]"
}
我究竟做错了什么?
谢谢!