davsclaus opened a new pull request, #30428:
URL: https://github.com/apache/camel/pull/30428

   ## Summary
   
   [CAMEL-27255](https://issues.apache.org/jira/browse/CAMEL-27255)
   
   When a client connection is accepted, `TcpServerConsumerValidationRunnable` 
does an initial read. If that read ends without a complete MLLP envelope, it 
logs the bytes it received:
   
   - data without a START_OF_BLOCK (INFO)
   - a socket error after a partial read (WARN)
   - a timeout after a partial read (WARN)
   
   These three statements used 
`MllpSocketBuffer.toPrintFriendlyStringAndReset()`, so they showed the data 
even with `logPhi=false`, the default since CAMEL-24454. They now use 
`toLoggableStringAndReset()`, as the other paths of the component do: the data 
is shown only with `logPhi=true`, otherwise the suppression placeholder is 
logged. The buffer is reset either way, as before.
   
   No other path of the component logs the buffer without the `logPhi` check.
   
   ## Tests
   
   - New `TcpServerConsumerValidationRunnableLogPhiTest` (6) covers the three 
ways the initial read ends, with the default (`logPhi=false`) and with 
`logPhi=true`.
     - The runnable's buffer is scripted, and its log is captured on the 
runnable itself, because the tests of this module run in parallel in one JVM.
     - Without the change, the three `logPhi=false` cases fail.
   - The full camel-mllp build passes.
   
   Backports for `camel-4.22.x` and `camel-4.18.x` follow.
   
   _Claude Code on behalf of Claus Ibsen_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


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