gnodet-bot commented on code in PR #29165:
URL: https://github.com/apache/camel/pull/29165#discussion_r4468211227


##########
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:
   💡 **Missing Javadoc on new public API.** This is now the canonical entry 
point — it needs at minimum a one-liner and `@param` tags describing what 
`null` means for `endpoint`.
   
   ```suggestion
       /**
        * Sets the inbound message on the given exchange from a Netty payload, 
unmarshalling a
        * {@link DefaultExchangeHolder} only when {@code 
endpoint.getConfiguration().isTransferExchange()} is {@code true}.
        * When {@code endpoint} is {@code null} or {@code 
transferExchange=false}, the payload is set as-is.
        *
        * @param endpoint the Netty endpoint (may be {@code null}; suppresses 
exchange transfer)
        * @param exchange the target exchange
        * @param payload  the decoded Netty payload
        */
       public static void setIn(NettyEndpoint endpoint, Exchange exchange, 
Object payload) {
   ```



##########
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:
   💡 **Missing Javadoc on new public API** (same as `setIn`).
   
   ```suggestion
       /**
        * Sets the outbound message on the given exchange from a Netty payload, 
unmarshalling a
        * {@link DefaultExchangeHolder} only when {@code 
endpoint.getConfiguration().isTransferExchange()} is {@code true}.
        * When {@code endpoint} is {@code null} or {@code 
transferExchange=false}, the payload is set as-is.
        *
        * @param endpoint the Netty endpoint (may be {@code null}; suppresses 
exchange transfer)
        * @param exchange the target exchange
        * @param payload  the decoded Netty payload
        */
       public static void setOut(NettyEndpoint endpoint, Exchange exchange, 
Object payload) {
   ```



-- 
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]

Reply via email to