camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Posta <christian.po...@gmail.com>
Subject Re: Apache Camel and Synchronized methods in processor
Date Wed, 30 Oct 2013 15:52:06 GMT
if you have multiple threads running the route (maybe show the full route,
and explain how it gets invoked) and you're sharing state in your beans,
then you'll probably want some kind of locking/mutex. adding a synchronized
keyword to the java method could help. maybe you could explain a little
more about the myMethod/myBean and what it does/looks like?


On Wed, Oct 30, 2013 at 4:48 AM, M314 <maciej.pietron@gmail.com> wrote:

> In my routing messages pass myBean twice. Once I have:
>
> ... //some code
> .process(myBean)
> ... //some code
> .method("myBean", "myMethod")
> ... //some code
>
> This bean have to be synchronized. I whould like just to add key word:
> 'synchronized' to methods: 'myMethod' and 'process', but those mehods are
> invoked by framewok itself (Camel), so I'm a bit afraid if I can do that
> without any consequences. I do not know how exaclly Camel works. So can I
> add to those methods word 'synchronized', and what problems can I come
> across?
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Apache-Camel-and-Synchronized-methods-in-processor-tp5742401.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message