shashank created CAMEL-27324:
--------------------------------

             Summary: camel-hazelcast - HazelcastIdempotentRepository without a 
Hazelcast instance cannot be started again: a route added again or a restarted 
CamelContext fails to start
                 Key: CAMEL-27324
                 URL: https://issues.apache.org/jira/browse/CAMEL-27324
             Project: Camel
          Issue Type: Bug
          Components: camel-hazelcast
            Reporter: shashank
            Assignee: shashank


h3. What happens

{{HazelcastIdempotentRepository}} created without a {{HazelcastInstance}} (the 
no-argument constructor, as a bean in XML/YAML) creates a local Hazelcast 
member when it starts and shuts it down when it stops, but keeps the field. The 
idempotent consumer stops its repository when the route is removed (a reload in 
dev mode, routes removed and added at runtime) and when CamelContext stops. The 
next start finds the instance set, does not create a new one and calls 
{{getMap}} on the instance that was shut down: 
{{HazelcastInstanceNotActiveException: Hazelcast instance is not active!}}, so 
the route added again (or the restarted CamelContext) fails to start.

{{HazelcastAggregationRepository}} and {{HazelcastKeyValueRepository}} already 
clear the field when they shut their local instance down.

h3. How to reproduce

{{HazelcastIdempotentRepositoryRestartTest}} (camel-hazelcast): start, stop and 
start the repository; and a route with an idempotent consumer removed and added 
again with the same repository.

h3. Fix

{{doStop}} clears the local instance (and the flag), so the next start creates 
a new local instance, as the sibling repositories do.

_Filed with Claude Code on behalf of allthingssecurity._



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to