oscerd opened a new pull request, #1808:
URL: https://github.com/apache/camel-kafka-connector/pull/1808
Fixes #1795.
## What
The `ckcUnMarshal` route template was calling `.marshal("{{unmarshal}}")`:
```java
routeTemplate("ckcUnMarshal")
.templateParameter("unmarshal", "dummyDataformat")
.from("kamelet:source")
.marshal("{{unmarshal}}") // <- applied the wrong direction
.to("kamelet:sink");
```
so every connector configured with `camel.sink.unmarshal` or
`camel.source.unmarshal` got a route
that marshalled the payload instead of unmarshalling it. The reporter hit
this as a
`NoTypeConversionAvailableException` on `CamelSyslogSourceConnector`, but it
affects every use of
either option.
## Why it regressed
`ca4e784352` ("Related to #423 modularized kamelets and composed them to
better autogenerate
connectors from kamelets catalog") extracted the marshal and unmarshal steps
into standalone route
templates. Before that commit the route was built directly and was correct:
```java
rdInTemplateSource = rdInTemplateSource.unmarshal("{{unmarshal}}");
```
The new `ckcUnMarshal` template was copied from `ckcMarshal` directly above
it and the operation was
never switched over. This PR restores the pre-`ca4e784352` behaviour.
## Test coverage
The existing `DataFormatTest` cases only assert that the context starts and
that the data format
resolves — never which direction it is applied in — which is why this passed
CI for so long.
Added two tests that push a message through the built route with a data
format that records which
direction it was invoked in:
- `testUnmarshalDataFormatIsAppliedInTheUnmarshalDirection`
- `testMarshalDataFormatIsAppliedInTheMarshalDirection`
Confirmed that the first one fails on the unpatched template (`expected:
<true> but was: <false>`)
and passes with the fix, so it is a real regression guard.
## Verification
- `core` module: 103/103 tests pass.
- Full reactor build from the repository root (`./mvnw clean install`, all
tests): BUILD SUCCESS.
Note the root build also surfaced pre-existing regeneration drift in the
checked-in connector tree
(unrelated to this change, and left out of this PR) — filed separately as
#1798.
--
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]