allthingssecurity commented on PR #27463:
URL: https://github.com/apache/camel/pull/27463#issuecomment-6033330323

   Thanks @davsclaus. I checked the claim in the code before adding it, and the 
default of camel-main and Spring Boot works the other way: a clash with it 
picks the next free name, so the start is not vetoed.
   - camel-main and Spring Boot set `jmxManagementNamePattern` (default 
`#name#`) on the **management agent** (`DefaultConfigurationConfigurer` calls 
`ManagementAgent.setManagementNamePattern`).
   - `DefaultManagementNameStrategy.isFixedName()` only looks at the pattern of 
the **strategy**, and that pattern is `null` unless it is set on the strategy. 
So `findFreeName` uses `#name#-#counter#` and the second `foo` gets a free name.
   - The start is only vetoed with a pattern without `#counter#` set on the 
`ManagementNameStrategy`, for example `managementNamePattern` of 
`<camelContext>` in Spring XML (`AbstractCamelContextFactoryBean`), or 
`getManagementNameStrategy().setNamePattern(...)`.
   
   The upgrade guide now says this in 1f9de96d886d. Two new tests pin both 
cases: agent pattern `#name#` gives a free name, strategy pattern `#name#` 
vetoes. `org.apache.camel.management` tests: 428, 0 failures (one unrelated 
flaky `BacklogTracerMessageHistoryMulticastSedaTest` passed on the rerun).
   
   _Claude Code on behalf of allthingssecurity_
   


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