Krymnos / IDP

University project
0 stars 0 forks source link

forward data from first gateway to the next node does not work #61

Closed GerritJa closed 6 years ago

GerritJa commented 6 years ago

When i start our pipeline with docker-compose: sensor->gateway->endpoint

then the data is successfully received by the first hop (gateway) but it's not forwarded.

Not sure whether the error is in the compose file but it seems that this is a functional problem inside the pipeline code.

Sample Output: gateway_1 | Jan 09, 2018 9:18:40 AM de.idp.pipeline.gatewayServer$pushDataService$2 onNext gateway_1 | INFO: Request: measurement { gateway_1 | meter_id: "31400010000002300" gateway_1 | metric_id: "010131070000" gateway_1 | timestamp: 1515489520897 gateway_1 | value: 1.4171 gateway_1 | } gateway_1 | gateway_1 | Jan 09, 2018 9:18:40 AM de.idp.pipeline.gatewayServer$pushDataService$2 onNext gateway_1 | INFO: Request: measurement { gateway_1 | meter_id: "31400010000002200" gateway_1 | metric_id: "010131070000" gateway_1 | timestamp: 1515489520897 gateway_1 | value: 0.1468 gateway_1 | } gateway_1 | gateway_1 | Jan 09, 2018 9:18:40 AM de.idp.pipeline.gatewayServer$pushDataServ

that's the configuration in the docker-compose file:

    source:
        image: sensor:latest
        command: ./smemu -sourceFolder data/20170210 -targetAddress gateway:5050 -targetType grpc-pipeline
        depends_on:
            - gateway
    gateway:
        image: pipeline_java:latest
        environment:
            - "ARGUMENTS=--port 5050 --host_next endpoint --port_next 5050"
        depends_on:
            - endpoint
    endpoint:
        image: pipeline_java:latest
        environment:
            - "ARGUMENTS=--port 5050 --verbose"
khudemann commented 6 years ago

Dominiks emulator streams the sensor values using one stream. The Pipeline assumed it can forward the messages after a stream ends. That caused the forwarding issues since the gateway waits until all values are successfully received. This is now solved by forwarding while still receiving. The Pipeline code was changed to already forward after having received 10 messages and repeat every 10 messages. So now the pipeline forwards while still receiving through one stream.