Uploaded image for project: 'Help-Desk'
  1. Help-Desk
  2. HELP-20573

FIWARE.Question.Tech.My dockerized service doesn't receive the notification sent by Orion Context Broker.

    Details

      Description

      Created question in FIWARE Q/A platform on 18-01-2023 at 14:01
      Please, ANSWER this question AT https://stackoverflow.com/questions/75160863/my-dockerized-service-doesnt-receive-the-notification-sent-by-orion-context-bro

      Question:
      My dockerized service doesn't receive the notification sent by Orion Context Broker

      Description:
      I don't understand why Orion says to successfully send TrafficFlowObserved entity update but my service (dockerized) receives nothing.
      I expect one of the following scenarios:

      Orion prints an error message if it fails to contact service, assuming the url is incorrect, or
      my service processes the request and prints the payload to the console.

      But neither of these two scenarios happens.
      Here's the log from Orion:
      2023-01-18 14:16:50 time=Wednesday 18 Jan 13:16:50 2023.790Z | lvl=TMP | corr=N/A | trans=1674046401-299-00000017019 | from=pending | srv=pending | subsrv=pending | comp=Orion | op=httpRequestSend.cpp[564]:httpRequestSendWithCurl | msg=Sending message 16973 to HTTP server: sending message of 994 bytes to HTTP server
      2023-01-18 14:16:50 time=Wednesday 18 Jan 13:16:50 2023.792Z | lvl=INFO | corr=N/A | trans=1674046401-299-00000017019 | from=pending | srv=pending | subsrv=pending | comp=Orion | op=httpRequestSend.cpp[587]:httpRequestSendWithCurl | msg=Notification Successfully Sent to http://smart-vertical:9090/subscription/traffic-flow/observation?subscriptionId=urn:ngsi-ld:Subscription:59c301f4-972f-11ed-809c-0242ac190006

      This is the code of resource in Quarkus that should receive the notification:
      @Path("/subscription/traffic-flow")
      public class TrafficFlowResource {
      @POST
      @Path("/observation")
      @Consumes(MediaType.APPLICATION_JSON)
      public void measurement(@QueryParam("subscriptionId") String id, Payload payload)

      { logger.info(payload); }

      }

      The Orion Context Broker subscription looks like following, but it's done programmatically:
      curl -L -X POST 'http://localhost:1026/ngsi-ld/v1/subscriptions/' \
      -H 'Content-Type: application/ld+json' \
      -H 'NGSILD-Tenant: openiot' \
      --data-raw '{
      "description": "Notify me of all traffic flow observation changes",
      "type": "Subscription",
      "entities": [

      {"type": "TrafficFlowObserved"}

      ],
      "watchedAttributes": [
      "averageVehicleSpeed",
      "intensity",
      "occupancy",
      "levelOfService",
      "roadLoad",
      "saturationFlow"
      ],
      "notification": {
      "format": "keyValues",
      "endpoint":

      { "uri": "http://smart-vertical:9090/subscription/traffic-flow/observation", "accept": "application/json" }

      },
      "@context": "http://ld-context:80/ngsi-context.jsonld"
      }'

      And this is the service configuration in docker:
      smart-vertical:
      build:
      context: ./smart-vertical
      dockerfile: src/main/docker/Dockerfile.jvm
      restart: on-failure
      depends_on:

      Orion and all services are on the same network created automatically by docker.
      I have a feeling it's an IP problem but without an error message I can't be sure.
      The tests I've done are to change the ip, so instead of using "smart-vertical" in docker-compose.yaml, I've tried "localhost", 172.30.0.8 (set by docker), 0.0.0.0 but the situation gets worse because I get the following results:
      2023-01-18 14:55:44 time=Wednesday 18 Jan 13:55:44 2023.079Z | lvl=ERROR | corr=N/A | trans=1674050062-123-00000000379 | from=pending | srv=pending | subsrv=pending | comp=Orion | op=httpRequestSend.cpp[573]:httpRequestSendWithCurl | msg=curl_easy_perform failed: 7

      or
      2023-01-18 15:07:43 time=Wednesday 18 Jan 14:07:43 2023.747Z | lvl=ERROR | corr=N/A | trans=1674050827-980-00000000194 | from=pending | srv=pending | subsrv=pending | comp=Orion | op=httpRequestSend.cpp[573]:httpRequestSendWithCurl | msg=curl_easy_perform failed: 28

      From the Orion implementation (github) I saw that:

      7 stands for message size too large
      28 should be 2+8?? where 2 stands for "Invalid IP" and 8 stands for "Unable to initialize libcurl (NOTE: only possible if actual curl is not provided as first argument)".

      Quarkus uses Vertx and by default Vertx uses its own DNS, could this be the problem? But I don't understand why with this setting
      SMART_VERTICAL_HOST=http://smart-vertical:9090/subscription

      I don't have IP problems but I still don't receive anything.

        Activity

        Hide
        backlogmanager Backlog Manager added a comment -

        2023-01-19 05:31|CREATED monitor | # answers= 0, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2023-01-19 05:31|CREATED monitor | # answers= 0, accepted answer= False
        Hide
        kzangeli Ken Zangelin added a comment -

        I answered on SOF ...

        Show
        kzangeli Ken Zangelin added a comment - I answered on SOF ...
        Hide
        backlogmanager Backlog Manager added a comment -

        2023-01-24 05:31|UPDATED status: transition Finish| # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2023-01-24 05:31|UPDATED status: transition Finish| # answers= 1, accepted answer= True

          People

          • Assignee:
            kzangeli Ken Zangelin
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: