[ https://jira.fiware.org/browse/HELP-20573?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Fernando Lopez reassigned HELP-20573:
-------------------------------------
Assignee: Ken Zangelin
> [fiware-stackoverflow] My dockerized service doesn't receive the notification sent by Orion Context Broker
> --------------------------------------------------------------------------------------------------------------
>
> Key: HELP-20573
> URL: https://jira.fiware.org/browse/HELP-20573
> Project: Help-Desk
> Issue Type: Monitor
> Components: FIWARE-TECH-HELP
> Reporter: Backlog Manager
> Assignee: Ken Zangelin
> Labels: docker, docker-compose, docker-networking, fiware, fiware-orion
>
> Created question in FIWARE Q/A platform on 18-01-2023 at 14:01
> {color: red}Please, ANSWER this question AT{color} 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
> expose:
> - "9090"
> ports:
> - "9090:9090"
> environment:
> - CB_HOST=orion
> - CB_PORT=1026
> - SMART_VERTICAL_PORT=9090
> - SMART_VERTICAL_HOST=http://smart-vertical:9090/subscription
> - NGSI_CONTEXT_URL=http://ld-context:80/ngsi-context.jsonld
> 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.
--
This message was sent by Atlassian JIRA
(v6.4.1#64016)
You can get more information about our cookies and privacy policies clicking on the following links: Privacy policy Cookies policy