We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When we want to communicate with external endpoints (for example: calling a REST service of an AI endpoint) we want to have this configurable.
An easy way to define the way to communicate with an external service in a customizable way.
We differ here between send and receive and provide a communication data converter which can be configured.
send
receive
Here we only provide simple key mapping without substructure creation. Means we do currently not handle complex keys with parent child structures
As an example:
{ "result" : { "status" : "OK", "message" : "some message inside child structure" } }
which could be provided by a key like "result.status" is currently not supported.
If it becomes necessary we will address this in another issue.
{ "send" : { "targetType" : "$type", "mapping" : { "$sourceKey" : "$destinationKey" } }, "receive" : { "sourceType" : "$type", "mapping" : { "$sourceKey" : "$destinationKey" } } }
{ "send" : { "targetType" : "JSON", "mapping" : { "cweId" : "cwe_id", "language" : "lang", "details" : "cwe_details" } }, "receive" : { "sourceType" : "JSON", "mapping" : { "error" : "result_problem", "status" : "result_status", "description" : "content" } } }
CommunicationDataConverter converter = new CommunicationDataConverter(config); val requestData = new HashMap<String,String>(); requestData.put("cweId", "79"); requestData.put("language", "java"); requestData.put("details", "some technical details about the cwe problem"); String jsonToSend = converter.convertForSending(data); String jsonReceived = serviceXyz.fetchLoadByJsonContent(jsonToSend); Map<String, String> resultMappingData= converter.convertFromReceived(jsonReceived); String content = resultMappingData.get("content"); String status = resultMappingData.get("result_status")
The text was updated successfully, but these errors were encountered:
Introduce communcation data converter #3712
6e90f31
Introduce communication data converter #3712
27b0723
fdd8448
Merge pull request #3895 from mercedes-benz/feature-3712-introduce-co…
1c66a14
…mmunication-data-converter Introduce communcation data converter #3712
Successfully merging a pull request may close this issue.
Situation
When we want to communicate with external endpoints (for example: calling a REST service of an AI endpoint) we want to have this configurable.
Wanted
An easy way to define the way to communicate with an external service in a customizable way.
Solution
We differ here between
send
andreceive
and provide a communication data converter which can be configured.Out of scope
Here we only provide simple key mapping without substructure creation.
Means we do currently not handle complex keys with parent child structures
As an example:
which could be provided by a key like "result.status" is currently not supported.
If it becomes necessary we will address this in another issue.
Converter config syntax
Example
Usage
The text was updated successfully, but these errors were encountered: