Re: Communicating a value between a route and the RouteBuilder class

2019-12-13 Thread Mark Nuttall
I'm not seeing all the code of course but remember that spring beans by default are Singletons. So values set at the class level are not thread safe. On Fri, Dec 13, 2019, 1:05 AM Ron Cecchini wrote: > > On December 12, 2019 at 11:16 AM Claus Ibsen > wrote: > > > > You can also name your RouteB

Re: Communicating a value between a route and the RouteBuilder class

2019-12-12 Thread Ron Cecchini
> On December 12, 2019 at 11:16 AM Claus Ibsen wrote: > > You can also name your RouteBuilder class with a bean id, if you use > spring / spring-boot or cdi etc. And then refer to this bean ids, > where you can have methods that you can refer to in the simple bean > function. Then you dont need

Re: Communicating a value between a route and the RouteBuilder class

2019-12-12 Thread Claus Ibsen
You can also name your RouteBuilder class with a bean id, if you use spring / spring-boot or cdi etc. And then refer to this bean ids, where you can have methods that you can refer to in the simple bean function. Then you dont need to add new classes. On Thu, Dec 12, 2019 at 4:03 PM Ron Cecchini

Re: Communicating a value between a route and the RouteBuilder class

2019-12-12 Thread Ron Cecchini
Thanks. Yeah, that would definitely make the route cleaner and would have been easier to implement... I guess I should have mentioned that I’ve been playing a game with myself and have been refusing to add any new classes/beans unless I utterly had to. I’m sort of “obsessed” with refactorin

Re: Communicating a value between a route and the RouteBuilder class

2019-12-12 Thread Claus Ibsen
You can use bean function in the simple language ${bean:xxx} to refer to a bean by its id, then you can store your offset cache with some bean id. On Thu, Dec 12, 2019 at 7:08 AM Ron Cecchini wrote: > > The use case is simply this: I need to poll and hit an HTTP endpoint with an > initial "offse

Communicating a value between a route and the RouteBuilder class

2019-12-11 Thread Ron Cecchini
The use case is simply this: I need to poll and hit an HTTP endpoint with an initial "offset" param of -1. The response header contains a new offset ("NEXT_OFFSET") to use the next time I hit the endpoint. Sounds simple enough... Until you start trying to do it... playing around with propertie