camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Catalina-Alina Dobrica (JIRA)" <>
Subject [jira] [Commented] (CAMEL-9916) SJMS component is not currently nodev/XML route compatible
Date Thu, 28 Apr 2016 09:35:13 GMT


Catalina-Alina Dobrica commented on CAMEL-9916:

I don't set up the connection pool - it is currently handled in SJMS, in the component's doStart
and doStop methods. What I propose is doing it in the endpoint's doStart and doStop, as I
suggest the ConnectionFactory should belong to the endpoint instead of the component. Keeping,
of course, the backward compatibility.
Here's a simple use-case of the restart issue (which is not restricted to XML usage):
     * Using a basic use-case of SJMS component + ActiveMQConnectionFactory, context cannot
be restarted
    public void useCase() throws Exception {
        SimpleRegistry registry = new SimpleRegistry();
        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("vm://broker?broker.persistent=false&broker.useJmx=false");
        registry.put("activemq", connectionFactory);

        DefaultCamelContext context = new DefaultCamelContext(registry);
        //adding a connection factory to a SJMS component instance, as per the current usage
of this component
        SjmsComponent sjmsComponent = new SjmsComponent();
        context.addComponent("sjms", sjmsComponent);

        //with no added complexity in the route
        RouteBuilder routeBuilder = new RouteBuilder(context) {
            public void configure() throws Exception {

        //when the context starts, SjmsComponent.doStart creates a ConnectionFactoryResource
with an underlying GenericObjectPool<Connection>, even if the pool size is 1 (default
= this use-case) and fills the pool
        //when the context starts, SjmsComponent.doStop drains the pool
        //FAIL - the context cannot start again because of an NPE in SjmsConsumer when trying
to borrowConnection from the ConnectionFactoryResource

> SJMS component is not currently nodev/XML route compatible
> ----------------------------------------------------------
>                 Key: CAMEL-9916
>                 URL:
>             Project: Camel
>          Issue Type: New Feature
>          Components: camel-sjms
>            Reporter: Catalina-Alina Dobrica
> SJMS component is currently not friendly for XML route usage because:
> * You need a component instance which has been "activated" - has had a connection factory
> * On route restart, the component cannot be reused because the underlying pool is closed
and not recreated

This message was sent by Atlassian JIRA

View raw message