use of com.redhat.service.smartevents.infra.exceptions.definitions.user.CloudEventDeserializationException in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class ExecutorService method toSourceCloudEvent.
private CloudEvent toSourceCloudEvent(String event, Headers headers) {
try {
// JsonCloudEventData.wrap requires an empty JSON
JsonNode payload = event == null ? mapper.createObjectNode() : mapper.readTree(event);
CloudEventData data = JsonCloudEventData.wrap(payload);
return wrapToCloudEvent(String.format("%s", executor.getProcessor().getDefinition().getRequestedSource().getType()), data, toExtensionsMap(headers));
} catch (JsonProcessingException e2) {
LOG.error("JsonProcessingException when generating CloudEvent for '{}'", event, e2);
throw new CloudEventDeserializationException("Failed to generate event map");
}
}
Aggregations