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

Claus Ibsen commented on CAMEL-16571:
-------------------------------------

Yes so if you do not do field injection you can do it on the setter method 
instead (probably not so often used).

{code}
        private ProducerTemplate producer;

        @EndpointInject("mock:result")
        public void setProducer(ProducerTemplate producer) {
            this.producer = producer;
        }

        public ProducerTemplate getProducer() {
            return producer;
        }
{code}

I added the changes in the upgrade guide, see section API changes at
https://github.com/apache/camel/blob/40d701b10817fb3e5bbd7d4c8f00ebfd13648b08/docs/user-manual/modules/ROOT/pages/camel-3x-upgrade-guide-3_10.adoc#api-changes

> camel-core - @Consume annotation should not be marked for constructor 
> injection
> -------------------------------------------------------------------------------
>
>                 Key: CAMEL-16571
>                 URL: https://issues.apache.org/jira/browse/CAMEL-16571
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 3.10.0
>
>
> This does not make sense, as its really only for methods, eg to Camel call a 
> methods when a message is consumed.
> The @Produce is for field/constructor injection and not method.
> And same for @EndpointInject



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to