You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Mark Nuttall <mk...@gmail.com> on 2016/07/20 12:29:17 UTC

how to poll a Spring Bean in a "from" in a route to get a List to process

As part of a "From" in a route, I need to able to "poll" (either by time or
schedule) a spring bean (i.e. a Spring Service)  and get a List<> by
calling a bean's method,so that i can process each item in the list.  I've
looked at "bean" and "jpa" but i am not seeing this in "bean" and I am not
using JPA per se (i.e. the Service class might modify/enhance the list and
thus is not a pure query).

1. can this be done?
2. is there i a link to an example?


Mark

Re: how to poll a Spring Bean in a "from" in a route to get a List to process

Posted by Mark Nuttall <mk...@gmail.com>.
Antoine. Thx. I might just not have been doing "bean" right.  Will give it
ago again.

On Wed, Jul 20, 2016 at 9:18 AM, Antoine DESSAIGNE <
antoine.dessaigne@gmail.com> wrote:

> Hello Mark,
>
> You can use a timer [1] to trigger the processing of the route, then call
> the bean to retrieve the list of elements to process and finally process
> your elements.
>
> [1] http://camel.apache.org/timer.html
>
>
> 2016-07-20 14:29 GMT+02:00 Mark Nuttall <mk...@gmail.com>:
>
> > As part of a "From" in a route, I need to able to "poll" (either by time
> or
> > schedule) a spring bean (i.e. a Spring Service)  and get a List<> by
> > calling a bean's method,so that i can process each item in the list.
> I've
> > looked at "bean" and "jpa" but i am not seeing this in "bean" and I am
> not
> > using JPA per se (i.e. the Service class might modify/enhance the list
> and
> > thus is not a pure query).
> >
> > 1. can this be done?
> > 2. is there i a link to an example?
> >
> >
> > Mark
> >
>

Re: how to poll a Spring Bean in a "from" in a route to get a List to process

Posted by Antoine DESSAIGNE <an...@gmail.com>.
Hello Mark,

You can use a timer [1] to trigger the processing of the route, then call
the bean to retrieve the list of elements to process and finally process
your elements.

[1] http://camel.apache.org/timer.html


2016-07-20 14:29 GMT+02:00 Mark Nuttall <mk...@gmail.com>:

> As part of a "From" in a route, I need to able to "poll" (either by time or
> schedule) a spring bean (i.e. a Spring Service)  and get a List<> by
> calling a bean's method,so that i can process each item in the list.  I've
> looked at "bean" and "jpa" but i am not seeing this in "bean" and I am not
> using JPA per se (i.e. the Service class might modify/enhance the list and
> thus is not a pure query).
>
> 1. can this be done?
> 2. is there i a link to an example?
>
>
> Mark
>