I'm attempting to manage routes and endpoints in a camel context using
following components (Camel 2.9.0, CXF 2.5.1, AMQ 5.5.1 in karaf 2.2.5).  I
have a system that requires that the endpoints be dynamically reconfigured,
and this requires that I be able to add/remove routes and endpoints.  

I am able to remove routes from my camel context, but I'm not able to remove
all the endpoints.  The endpoints are a combination of the following:
  1-  jms:queue:jmsQueueEP
  2 - jms:topic:jmsTopicEP
  3 - seda:sedaEP
  4 - CxfEndpoint

1 - 3 are added to the context during route creation using RouteBuilder.  4
is explicitly added to the context.

Performing a camelContext.removeEndpoints("*") removes most of the lazy
created endpoints.  It removes (1) and (3).

Performing an explicit removal of (4) -
camelContext.removeEndpoints("cxf:https://foo...";) is then able to remove
the CxfEndpoint.  I'm not sure why the wildcard pattern initially used did
not work here.

Finally, even an explicit attempt to remove the jms topic endpoint was not
successful:

                Collection<Endpoint> removed, 
                      endpoints = camelContext.getEndpoints();
                
                for (Endpoint i : endpoints)
                {
                        String uri = i.getEndpointUri();
                        logger.debug("removing EP: {}", uri);
                        removed = 
camelContext.removeEndpoints(i.getEndpointUri());
                        if (removed != null)
                        {
                                logger.debug("EP not removed: {}", uri);
                        }
                }

Output:

       removing EP: jmsvm://topic:CORE_REQUEST_USRMGM
       EP not removed: jmsvm://topic:CORE_REQUEST_USRMGM
       removing EP: jmsvm://topic:CORE_ADD_USRMGM
       EP not removed: jmsvm://topic:CORE_ADD_USRMGM


Any ideas as to:
 - Why the wildcard uri pattern fails to remove the cxf endpoint?
 - How to remove the jms:topic endpoint?

TIA



--
View this message in context: 
http://camel.465427.n5.nabble.com/Problem-Removing-Endpoints-tp5455029p5455029.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to