Orange-OpenSource/fiware-cepheus

Cepheus-CEP multitenancy issue on filtering requests

ahmadessam opened this issue · 6 comments

I have made my cepheus-cep in mutitenant mode and then uploaded two config files with different servicepaths . Now , when i send any http request having the service and servicepath for either of the two tenants , the Cepheus-cep runs the last uploaded config file even if the servicepath in the incoming request is different . as far as i know , the cepheus-cep could filter the requests and accordingly run the config file corresponding to the service and servicepath in the request . I feel that the cepheus-cep caches only the last config file uploaded even in multitenancy mode .So What could be the issue in my case ??

Please provide some more info like logs. Helping you without logs is just not possible.

@marcc-orange
firstly i've uploaded my first config.json file with service cairouniversity and servicePath /fci/lab1
upload-fci-lab1
and then i upload another configuration file with service cairouniversity and servicepath /fci/lab2
upload-fci-lab2
i made a flask server receive the requests generated from the CEP after processing.
The problem is that when i send update to CEP with Fiware-Service: cairouniversity and Fiware -ServicePath:/fci/lab1 ,i receive the CEP output request with Fiware Service: cairouniversity and Fiware-ServicePath:/fci/lab2 which is different from that of the CEP incoming request.
i've printed service and servicePath in the tenantFilter file and found that the Fiware-Service: is cairouniversity and Fiware -ServicePath is /fci/lab1 and the tenant id is cairouniversity/fci/lab1
tenantfilter
and then I printed the httpheaders in the EventSinklistener to see the service and servicePath of the generated output and found out that the Fiware Service is cairouniversity and Fiware-ServicePath is /fci/lab2 which is incorrect and logically supposed to be /fci/lab1 as the incoming request as printed in the tenantFilter !
so it is changed at this point and become corrupted .
eventsinklistener

and then i received at my flask server the eventout request of the configration file of /fci/lab1 But with
Fiware Service: cairouniversity and Fiware-ServicePath:/fci/lab2
serverside

Hope my case right now is clear enough and that there could be a possible solution . Thanks !

@marcc-orange
Now , We've edited the source code of the Cepheus and the problem is now solved completely and tested . So we're willing to publish it and need to know the steps to contribute to Fiware with this modification

Hi, you can clone the repo and submit us a pull request. We will review the modifications and merge your code once approved.
Thanks for your contribution !

@marcc-orange
We've cloned the repository then edited and committed and that's the log . what should be done next ?
commit d6e49856110c51012af7562050c8c7559533fd89
Author: AhmadElseify ahmad.essam@ansr.cu.edu.eg
Date: Wed Jan 24 17:57:05 2018 +0200

Sorry, I did not mention creating a fork.
You need a github account to create a fork of our repo, then push your modification to a branch on this fork, then create a pull request.
More info about the process here : https://help.github.com/articles/about-pull-requests/