You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/03/13 22:43:41 UTC

[jira] [Commented] (CAMEL-11008) Consumer/Producer templates are not stopped when auto-configured in Spring Boot

    [ https://issues.apache.org/jira/browse/CAMEL-11008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15923108#comment-15923108 ] 

ASF GitHub Bot commented on CAMEL-11008:
----------------------------------------

GitHub user zregvart opened a pull request:

    https://github.com/apache/camel/pull/1534

    CAMEL-11008: Consumer/Producer templates are not stopped when auto-configured in Spring Boot

    In [CAMEL-9431|https://issues.apache.org/jira/browse/CAMEL-9431] producer/consumer templates did not receive their own `destroyMethod` methods. I've changed those to use `stop` for `destroyMethod`, a proper solution might be that `DefaultCamelContext` tracks all templates and stops them on shutdown, or make them `CamelContextAware` and `addService` them to CamelContext, or `addService` them in `createProducerTemplate` `createConsumerTemplate`.
    I've decided to do a simple fix here and provide a unit test that can be used to validate the best solution to the problem.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/zregvart/camel CAMEL-11008

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/camel/pull/1534.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1534
    
----
commit 2f265af02637864da93ec4c531cc5b95b5b41948
Author: Zoran Regvart <zr...@apache.org>
Date:   2017-03-13T22:42:12Z

    CAMEL-11008: Consumer/Producer templates are no...
    
    ...t stopped when auto-configured in Spring Boot
    
    In CAMEL-9431 producer/consumer templates did not receive their own
    `destroyMethod` methods. I've changed those to use `stop` for
    `destroyMethod`, a proper solution might be that `DefaultCamelContext`
    tracks all templates and stops them on shutdown, or make them
    `CamelContextAware` and `addService` them to CamelContext, or
    `addService` them in `createProducerTemplate` `createConsumerTemplate`.
    I've decided to do a simple fix here and provide a unit test that can be
    used to validate the best solution to the problem.

----


> Consumer/Producer templates are not stopped when auto-configured in Spring Boot
> -------------------------------------------------------------------------------
>
>                 Key: CAMEL-11008
>                 URL: https://issues.apache.org/jira/browse/CAMEL-11008
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-spring-boot
>    Affects Versions: 2.16.5, 2.17.5, 2.18.2, 2.19.0
>            Reporter: Zoran Regvart
>            Assignee: Zoran Regvart
>
> Consumer/Producer templates created in {{CamelAutoConfiguration}} as Spring beans are, contrary to the comment on the {{@Bean}} methods, not managed by Camel, the {{DefaultCamelContext}} in {{createProducerTemplate}} and {{createConsumerTemplate}} methods starts the returned templates but does not hold references to them and thus cannot stop them on shutdown.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)