oscerd commented on code in PR #29165:
URL: https://github.com/apache/camel/pull/29165#discussion_r4470923062
##########
components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyPayloadHelper.java:
##########
@@ -108,15 +108,15 @@ private static Object getBody(NettyEndpoint endpoint,
Message message) throws In
}
}
- public static void setIn(Exchange exchange, Object payload) {
- if (payload instanceof DefaultExchangeHolder defaultExchangeHolder) {
- unmarshal(exchange, defaultExchangeHolder);
+ public static void setIn(NettyEndpoint endpoint, Exchange exchange, Object
payload) {
Review Comment:
Javadoc added in 3922082b5314 (`CAMEL-26587: Address review feedback -
document the NettyPayloadHelper entry points and what the deprecated overloads
do`). It says that a `DefaultExchangeHolder` rebuilds the exchange only when
the endpoint has `transferExchange=true` and that it is otherwise set as the
message body like any other payload, which covers a `null` endpoint, and it has
the `@param` tags. The deprecated two-argument overloads now carry
`@Deprecated(since = "4.24.0", forRemoval = true)` and their Javadoc states
that they never unmarshal a holder any more and what a caller that relied on
that has to do.
_Claude Code on behalf of oscerd_
##########
components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyPayloadHelper.java:
##########
@@ -131,15 +131,15 @@ public static void setIn(Exchange exchange, Object
payload) {
}
}
- public static void setOut(Exchange exchange, Object payload) {
- if (payload instanceof DefaultExchangeHolder defaultExchangeHolder) {
- unmarshal(exchange, defaultExchangeHolder);
+ public static void setOut(NettyEndpoint endpoint, Exchange exchange,
Object payload) {
Review Comment:
Javadoc added in 3922082b5314 (`CAMEL-26587: Address review feedback -
document the NettyPayloadHelper entry points and what the deprecated overloads
do`), the same way as for `setIn`: a `DefaultExchangeHolder` rebuilds the
exchange only when the endpoint has `transferExchange=true`, otherwise it is
the message body, which covers a `null` endpoint; it also notes that a plain
body keeps the headers of the inbound message, and has the `@param` tags.
_Claude Code on behalf of oscerd_
##########
components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyPayloadHelper.java:
##########
@@ -108,15 +108,15 @@ private static Object getBody(NettyEndpoint endpoint,
Message message) throws In
}
}
- public static void setIn(Exchange exchange, Object payload) {
- if (payload instanceof DefaultExchangeHolder defaultExchangeHolder) {
- unmarshal(exchange, defaultExchangeHolder);
+ public static void setIn(NettyEndpoint endpoint, Exchange exchange, Object
payload) {
Review Comment:
Same point as the earlier thread on this line: the Javadoc is in
3922082b5314, with the `null` endpoint case covered by the "otherwise it is set
as the message body" sentence and by the Javadoc of the deprecated two-argument
overloads.
_Claude Code on behalf of oscerd_
##########
components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyPayloadHelper.java:
##########
@@ -131,15 +131,15 @@ public static void setIn(Exchange exchange, Object
payload) {
}
}
- public static void setOut(Exchange exchange, Object payload) {
- if (payload instanceof DefaultExchangeHolder defaultExchangeHolder) {
- unmarshal(exchange, defaultExchangeHolder);
+ public static void setOut(NettyEndpoint endpoint, Exchange exchange,
Object payload) {
Review Comment:
Same point as the earlier thread on this line: the Javadoc is in
3922082b5314, with the `null` endpoint case covered by the "otherwise it is set
as the message body" sentence and by the Javadoc of the deprecated two-argument
overloads.
_Claude Code on behalf of oscerd_
--
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]