1

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'

2 Answers2

1

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)

fgalan
  • 11,732
  • 9
  • 46
  • 89
  • To warn Perseo FE from Perseo core is 9090 – Antonio Moreno Borras May 20 '19 at 12:34
  • How to fix this from Perseo FE Log's: accept":"*/*"},"body":{},"subservice":"/","service":"unknownt"} -- Perseo FE is not doing anything – Antonio Moreno Borras May 20 '19 at 12:39
  • fgalan Firts of all, Perseo CEP works? Have you ever seen it wonking? – Antonio Moreno Borras May 20 '19 at 14:00
  • Yes, I confirm it works. But it needs to be deployed, configured and used correctly for that. I guess that some kind of issue in the deployment, configuration or usage is causing your problems. – fgalan May 20 '19 at 20:29
  • Ok, thank you, now the problem that i got is that in the perseo fe, after comming from perseo core and rule fired there, it says that it can't find the rule. I am goning to try to put the rule directly in Mongo Cep to see if it find the rule. – Antonio Moreno Borras May 21 '19 at 07:07
  • I could fire a rule but storing it manually in Mongodb in rules collection, what makes me thing that the mechanism to store the rules in Mongodb is not well set up. Could you tell me how to do aware the system where to store the rules? – Antonio Moreno Borras May 22 '19 at 06:47
  • Happy to know you solved! As you can see, Perseo works ;) – fgalan May 22 '19 at 13:32
1

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.