title: Getting lock on Camel Processor
body: <p>I would like to know the approaches to get synchronization on Camel Processor.</p>
  
  <p>The only related thing that I found at <a href="http://camel.apache.org/parallel-processing-and-ordering.html" rel="nofollow">docs</a>:</p>
  
  <blockquote>
    <p>Note that there is no concurrency or locking issue when using
    ActiveMQ, JMS or SEDA by design; they are designed for highly
    concurrent use. However there are possible concurrency issues in the
    Processor of the messages i.e. what the processor does with the
    message?</p>
  </blockquote>
  
  <p>So if I want to get lock on <em>org.apache.camel.Processor.process(Exchange)</em> , i.e. I would like other threads wait for <strong>process</strong> method finishing while it is busy. Is that possible?</p>
  
  <p><strong>UPDATE</strong>: Actually I tried to make synchronized (lock) inside of <em>process</em> method - that works on JVM side. But my Processor is part of transaction-ed route and that is a problem - all changes to Persistence Layer become visible only after exiting Processor (or even maybe route). So I thought there are some Camel-like solutions for this problem.</p>