Incompatibility with fiware/orion:2.0.0

119 views Asked by At

This is a question related with this issue

https://github.com/ging/fiware-cygnus/issues/6

I've deployed the iot stack with docker. These are the used containers:

  • fiware/orion:2.0.0
  • ging/fiware-cygnus:latest

ging/fiware-cygnus:latest

"Id": "sha256:b6baf1cbd18e6ba6ab5ec7d8e1d9c8a08bbc18b45037faa345e8465c890f454c",
"RepoTags": [ "ging/fiware-cygnus:latest" ],
"RepoDigests": [
"ging/fiware-cygnus@sha256:4fcf44666651ca63f1a74203bc12a7ffd9a1268f8d514dff1a83db269a1c6923"
],
"Created": "2018-10-17T15:52:19.749023834Z"

[And other containers not involved in the issue ...]

Currently the image fiware/orion:2.0.0 is sending the headers as follows.

--------------------------------------------------
Standard FlowFile Attributes
Key: 'entryDate'
        Value: 'Wed Oct 31 12:15:25 UTC 2018'
Key: 'lineageStartDate'
        Value: 'Wed Oct 31 12:15:25 UTC 2018'
Key: 'fileSize'
        Value: '144'
FlowFile Attribute Map Content
Key: 'Accept'
        Value: 'application/json'
Key: 'Content-Length'
        Value: '144'
Key: 'Content-Type'
        Value: 'application/json; charset=UTF-8'
Key: 'Fiware-Correlator'
        Value: 'a5a196d6-dd06-11e8-8f35-0242ac1c0004'
Key: 'Fiware-Service'
        Value: 'testService'
Key: 'Fiware-Servicepath'
        Value: '/testPath'
Key: 'Host'
        Value: 'cygnus:5050'
Key: 'Ngsiv2-AttrsFormat'
        Value: 'normalized'
Key: 'User-Agent'
        Value: 'orion/2.0.0 libcurl/7.29.0'
Key: 'filename'
        Value: '102283488692700'
Key: 'path'
        Value: './'
Key: 'restlistener.remote.source.host'
        Value: '172.28.0.4'
Key: 'restlistener.remote.user.dn'
        Value: 'none'
Key: 'restlistener.request.uri'
        Value: '/v2/notify'
Key: 'uuid'
        Value: 'b20ecd8d-7d6e-4edd-be39-242a1ae1cc49'
--------------------------------------------------

Specifically, the header "Fiware-Servicepath" does not match what is expected this line of code. "fiware-servicepath," Fiware-ServicePath "," fiware-servicepath"

And this causes the following error:

`2018-10-31 12:15:41,201 ERROR [Timer-Driven Process Thread-1] o.a.nifi.processors.ngsi.NGSIToMongo NGSIToMongo[id=8f96c89d-850a-3578-b512-2b3f5f4fdacd] java.lang.NullPointerException

I think that it is caused by this line

String fiwareServicePath = (flowFile.getAttribute("fiware-servicepath")==null) ? flowFile.getAttribute("Fiware-ServicePath"):flowFile.getAttribute("fiware-servicepath"); 

IN

fiware-cygnus/nifi-ngsi-bundle/nifi-ngsi-processors/src/main/java/org/apache/nifi/processors/ngsi/NGSI/utils/NGSIUtils.java

0

There are 0 answers