简体   繁体   中英

PERSEO_NOTICES_PATH='/notices',PERSEO_RULES_PATH='/rules' create subscription 2 Orion from Cep & how notify rules & subscription between Orion & Cep

I want create a subscription From PERSEO CEP to Orion CB so that when a attribute change Perseo Cep throws a rule. How to use these 3 directives: - PERSEO_NOTICES_PATH='/notices', - PERSEO_RULES_PATH='/rules' - MAX_AGE

In - MAX_AGE I want to set it to last forever o for a lot of years.

perseo-core: image: fiware/perseo-core hostname: perseo-core container_name: fiware-perseo-core depends_on: - mongo-db - orion networks: - smartcity ports: - "8080:8080" environment: - PERSEO_FE_URL= http://perseo-fe:9090 - MAX_AGE=9999

perseo-front:

image: telefonicaiot/perseo-fe

image: fiware/perseo
hostname: perseo-fe
container_name: fiware-perseo-fe
networks:
    - smartcity
ports:
    - "9090:9090"
depends_on:
     - perseo-core
environment:
    - PERSEO_ENDPOINT_HOST=perseo-core
    - PERSEO_ENDPOINT_PORT=8080
    - PERSEO_MONGO_HOST=mongo-db
    - PERSEO_MONGO_URL=http://mongo-db:27017
    - PERSEO_MONGO_ENDPOINT=mongo-db:27017 
    - PERSEO_ORION_URL=http://orion:1026/
    - PERSEO_LOG_LEVEL=debug
    - PERSEO_CORE_URL=http://perseo-core:8080
    - PERSEO_SMTP_SECURE=true
    - PERSEO_MONGO_USER:"root"
    - PERSEO_MONGO_PASSWORD:"example"
    - PERSEO_SMTP_HOST=x
    - PERSEO_SMTP_PORT=25
    - PERSEO_SMTP_AUTH_USER=x
    - PERSEO_SMTP_AUTH_PASS=x
    - PERSEO_NOTICES_PATH='/notices'
    - PERSEO_RULES_PATH='/rules'

You can find basic information about CB subscriptions in the NGSIv2 API walkthrough and the full detail in the NGSIv2 Specification ("Subscriptions" section).

In this case, you have to set as notification endpoint the one corresponding to Perseo. Taking into account the above configuration for PERSEO_ENDPOINT_PORT and PERSEO_NOTICES_PATH it should be something like this:

  ...
  "notification": {
    "http": {
      "url": "http://<perseohost>:8080/notices"
    },
  ...

EDIT: maybe port is 9090 instead of 8080. Not fully sure (9090 could be the port in the Perseo FE, where /notices is listening while 8080 is the port that Perseo FE uses to contact with Perseo Core)

In the rule creation, when I send the rule I had http://perseo-coreip:8080/perseo-core/rules and it is not correct,

the correct is: http://perseo-fe-ip:9090/rules , with that it works.

Store the rule in mongodb and fire the rule properly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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