How do you configure an Http-push connection ? [message #1844160] |
Fri, 03 September 2021 15:39 |
Amaury Guichard Messages: 3 Registered: September 2021 |
Junior Member |
|
|
Hello !
I'm trying to make a custom protocol mapper by implementing the MessageMapper Interface.
If I understood everything correctly, in order for Ditto to use this custom mapper you need to create a new connection.
I tried creating a new http connection but it doesn't seem to work, here is my connection configuration :
{
"targetActorSelection": "/system/sharding/connection",
"headers": {
"aggregate": false
},
"piggybackCommand": {
"type": "connectivity.commands:modifyConnection",
"connection": {
"id":"ocppConnection",
"name": "ocppConnection",
"connectionType":"http-push",
"connectionStatus": "open",
"uri":"http://localhost:8080",
"sources":[],
"targets": [{
"address": "PUT:/api/2/chargepoint",
"authorizationContext": ["nginx:ditto"],
"headerMapping": {
"content-type": "application/json"
},
"topic":[
"_/_/things/twin/events",
"_/_/things/live/commands"
],
"payloadMapping": ["status"]
}
],
"mappingDefinitions": {
"status": {
"mappingEngine": "Ocpp1_6Mapper",
"options":{}
}
}
}
}
}
localhost:8080 is my ditto "normal" endpoint and is the only URI I can enter without getting an error.
However, when I try a PUT request on http://localhost:8080/api/2/chargepoint I get the following response : "The requested resource could not be found."
I tried everything (using ditto:ditto in the URI, in my request, adding {{ thing:id }} etc...) but I always get the same response and when I check the connection metrics I see that nothing is recognized (I only have 0 at every attributes).
Can someone help me ?
Thx in advance !
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04569 seconds