nickshoe opened a new pull request, #15924:
URL: https://github.com/apache/camel/pull/15924
# Description
This PR solves the webhook events deserialization (at the momen, only the
`TaskTimeTrackedUpdatedEvent` class is supported) by always using a JSON-only
property for both serialization and deserialization.
This allows a webhook event to be serialized and deserialized back and
forth. This comes particularly in handy when persisting events in JSON, for
later processing.
## Example
### Webhook events intake route
```java
fromF(
"webhook:clickup:%s?webhookAutoRegister=true&authorizationToken=%s&events=%s",
clickupWorkspaceId,
clickupAuthorizationToken,
String.join(",", "taskTimeTrackedUpdated")
)
.setHeader(KafkaConstants.KEY,
simple("${body.getData().getIntervalId()}"))
.marshal().json() // Serialization happens here
.simple("${body}"))
.toF(
"kafka:%s?brokers=%s:%s",
kafkaTopic,
kafkaHost,
kafkaPort
)
```
### Events processing route
```java
fromF(
"kafka:%s?brokers=%s:%s",
kafkaTopic,
kafkaHost,
kafkaPort
)
.unmarshal().json(TaskTimeTrackedUpdatedEvent.class) //
Deserialization happens here
// ... business logic
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]