[ 
https://issues.apache.org/activemq/browse/SMX4-516?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=58805#action_58805
 ] 

Claus Ibsen commented on SMX4-516:
----------------------------------

Its probably best to create the channel in {{doStart}} to avoid a race 
condition in the process, eg if the producer is shared and multiple threads 
invoke it.

This also ensures that you can restart it at runtime as doStart will create it, 
and doStop will stop it.

> The camel-nmr ServiceMixProducer creates a new Channel per-exchange, also 
> doesn't close it.
> -------------------------------------------------------------------------------------------
>
>                 Key: SMX4-516
>                 URL: https://issues.apache.org/activemq/browse/SMX4-516
>             Project: ServiceMix 4
>          Issue Type: Bug
>    Affects Versions: 4.0.0
>            Reporter: Stan Lewis
>         Attachments: SMX4-516.diff
>
>
> In ServiceMixProducer.java we create a Channel for each exchange passed into 
> process(). Under the covers this will cause a new thread pool to be created, 
> as when you create a Channel that creates a new Executor instance, have a 
> look in ServiceMixImpl.createChannel() in the NMR.
> Instead this component should just create the Channel once and re-use it for 
> subsequent exchanges.
> Also ServiceMixProducer doesn't properly close the Channel it's creating 
> which may lead to leaking resources.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://issues.apache.org/activemq/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to