来自Orion Context Broker的通知

时间:2016-06-20 17:36:47

标签: fiware-orion

我正在与Orion Context Broker合作,并希望收到以下订阅的通知,已添加到orion.lab.fiware.org:1026

curl -v orion.lab.fiware.org:1026/v2/subscriptions -X POST -s -S --header 'Content-Type: application/json' --header "X-Auth-Token: <myToken>" -d @- <<EOF 
{
  "description": "A subscription to get info about Room1",
  "subject": {
    "entities": [
      {
"id": "11582",        
"type": "User"
      }
    ],
    "condition": {
      "attrs": [
        "temperature"
      ]
    }
  },
  "notification": {
    "http": {
      "url": "http://<myIPAddress>:8080"
    },
    "attrs": [
      "temperature"
    ]
  },
  "expires": "2040-01-01T14:00:00.00Z",
  "throttling": 5
}
EOF

myToken:FIWARE服务器生成的令牌

myIPAddress:我的电脑的IP地址

但是,在我的端口8080上的示例HTTP服务器程序(Node.js)中,我没有收到任何通知。我应该注意,在添加上述订阅后,我通过另一个POST请求将ID为11582的实体添加到orion.lab.fiware.org:1026/v2/entities

当我稍后阅读添加的订阅时,它确认已发送通知(通过lastNotification):

{
  "id": "5768088c70dce43aa351cf9b",
  "description": "A subscription to get info about Room1",
  "expires": "2040-01-01T14:00:00.00Z",
  "status": "active",
  "subject": {
    "entities": [
      {
        "id": "11582",
        "idPattern": "",
        "type": "User"
      }
    ],
    "condition": {
      "attrs": [
        "temperature"
      ]
    }
  },
  "notification": {
    "timesSent": 1,
    "lastNotification": "2016-06-20T15:16:04.00Z",
    "attrs": [
      "temperature"
    ],
    "attrsFormat": "normalized",
    "http": {
      "url": "http://<myIPAddress>:8080"
    }
  },
  "throttling": 5
}    

知道为什么我的HTTP服务器程序没有收到通知吗?我的防火墙也关闭了。

谢谢!

1 个答案:

答案 0 :(得分:1)

following tes来自orion.lab.fiware.org。 termina1l.txt文件显示发送给Orion的订阅和实体创建请求(注意我们使用localhost:10026,因为测试已在orion.lab.fiware.org主机本身完成),terminal2.txt文件显示收到的通知在监听过程中(POST / HTTP/1.1 user-agent: orion/1.2.1 libcurl/7.19.7 host: 130.206.112.29:1028 accept: application/json content-length: 146 content-type: application/json; charset=utf-8 fiware-correlator: 0870b41c-378d-11e6-910f-52540003a38e ngsiv2-attrsformat: normalized X-Forwarded-For: 127.0.0.1 Connection: keep-alive {"subscriptionId":"5768ff6a70dce43aa351cfaa","data":[{"id":"11582","type":"UserTest2","temperature":{"type":"Float","value":23.5,"metadata":{}}}]} )。

我们还在FIWARE实验室的VM机器上运行侦听器(安全原因无法公开IP),并在安全组中使用1028端口开放执行相同的测试(此次使用 def create @individual_training = IndividualTraining.new(individual_training_params) Stripe.api_key = ENV['STRIPE_SECRET_KEY'] token = params[:stripeToken] begin charge = Stripe::Charge.create( amount: (@individual_training.training_cost.cost * 100).floor, currency: 'pln', card: token ) rescue Stripe::CardError => e flash[:danger] = e.message render :new end if @individual_training.save redirect_to :back, notice: 'Pomyślnie dodano.' else render :new end end 类型)得到的一切都很好,得到:

DECLARE @SQL NVARCHAR(MAX);

-- The base statement
SET @SQL = 'SELECT * FROM table1 WHERE @columnparameter = ''test''';

-- Only append the extra conditions if the variables are not null
IF @l_userId IS NOT NULL
    SET @SQL += ' AND table1.userId = ' + @l_userId;

IF @l_docId IS NOT NULL
    SET @SQL += ' AND table1.fileId = ' + @l_docId;

因此,我了解orion.lab.fiware.org与您的进程之间的某些内容阻止了流量。请注意,除了机器中运行的防火墙(您提到的是关闭)之外,另一个防火墙层可能会阻塞(例如FIWARE云或AWS云安全组,公司防火墙等)。