You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Steve973 <st...@gmail.com> on 2021/12/19 18:19:14 UTC

Consume annotation not working when used with Spring XML

Hello.  I have a component class that includes a method that is annotated
with @Consume.  In tests, if I manually wire things up, and then invoke a
bean post processor, it does indeed consume from the URI obtained from the
specified property.  However, I am writing some Spring XML (not spring
boot) integration tests, and when it runs, it is not consuming from the
URI.  What am I missing?

Thanks,
Steve

Re: Consume annotation not working when used with Spring XML

Posted by Steve973 <st...@gmail.com>.
Hi, Claus.  Thanks for the reply, and apologies for any ambiguity in my
previous email.  This is the dynamic router component that I am writing.  I
got this test working by extending CamelTestSupport in my @CamelSpringTest
class.  I am not sure which particular magic of the CamelTestSupport class
made the post-processing happen, but everything is pretty much good to go,
now.  I am ready for a review of this component, but since this is my first
substantial contribution to Camel, I would like to make sure that what I
have done is appropriate, and done in standard "camel ways".  I saw that
3.14 has been released, so we should discuss this when you have some time.
No hurry, but I think this is pretty solid for a first release, maybe in
3.15?

Thanks,
Steve

On Mon, Dec 20, 2021 at 3:37 AM Claus Ibsen <cl...@gmail.com> wrote:

> Hi
>
> It depends how this bean is created - as it needs to be created either
> by camel or spring to kick in the bean post processor that scans for
> those annotations.
> If the bean is created via new XXX or some other way then this does not
> happen.
>
> And when you say component class not sure what that is, a camel
> component or spring component or what?
>
>
> On Sun, Dec 19, 2021 at 7:19 PM Steve973 <st...@gmail.com> wrote:
> >
> > Hello.  I have a component class that includes a method that is annotated
> > with @Consume.  In tests, if I manually wire things up, and then invoke a
> > bean post processor, it does indeed consume from the URI obtained from
> the
> > specified property.  However, I am writing some Spring XML (not spring
> > boot) integration tests, and when it runs, it is not consuming from the
> > URI.  What am I missing?
> >
> > Thanks,
> > Steve
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2
>

Re: Consume annotation not working when used with Spring XML

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

It depends how this bean is created - as it needs to be created either
by camel or spring to kick in the bean post processor that scans for
those annotations.
If the bean is created via new XXX or some other way then this does not happen.

And when you say component class not sure what that is, a camel
component or spring component or what?


On Sun, Dec 19, 2021 at 7:19 PM Steve973 <st...@gmail.com> wrote:
>
> Hello.  I have a component class that includes a method that is annotated
> with @Consume.  In tests, if I manually wire things up, and then invoke a
> bean post processor, it does indeed consume from the URI obtained from the
> specified property.  However, I am writing some Spring XML (not spring
> boot) integration tests, and when it runs, it is not consuming from the
> URI.  What am I missing?
>
> Thanks,
> Steve



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2