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

   # Description
   
   JIRA: [CAMEL-26518](https://issues.apache.org/jira/browse/CAMEL-26518)
   
   `OSSConsumer.doStart()` called `super.doStart()`, which starts the 
scheduler, before it set the `ossClient` field. With `initialDelay=0` the first 
poll could run before the client was set, so it failed with a 
`NullPointerException` ("this.ossClient is null"). The scheduled consumer 
logged it as a WARN, and the next poll worked.
   
   The consumer now checks the bucket name and sets the client first, and calls 
`super.doStart()` last.
   
   ## Test
   
   `OSSConsumerFirstPollTest` uses a scheduler that runs the first poll as soon 
as it is started, in the thread that starts the consumer. So the race happens 
on every run, not only sometimes. Without the fix the test fails with the NPE 
from the JIRA. With the fix, all 27 tests of the module pass.
   
   _Claude Code on behalf of Claus Ibsen_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_0128ThHB3iQdrvSRLVBGRrdP
   


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

  • [PR] CAMEL-26518: camel-aliba... davsclaus (via GitHub) via commits

Reply via email to