title: Apache Camel: Multiple Transactions within a Route
body: <p>I have a need to create multiple transaction scopes within a Route. Something like below.</p>
  
  <pre><code>&lt;route&gt;
    &lt;from uri="activemq:queue:foo"/&gt;
    &lt;transacted ref="required"/&gt;
    &lt;to uri="activemq:queue:bar"/&gt;
    &lt;to uri="bean:database1?method=insert(*,*)"/&gt;
    &lt;transacted ref="requiresNew"/&gt;
    &lt;to uri="bean:database2?method=insert(*,*)"/&gt;
  &lt;/route&gt;
  </code></pre>
  
  <p>If I create above route, I get below error.</p>
  
  <blockquote>
    <p>ERROR 2016-09-13 14:32:32 servlet.FrameworkServlet - Context initialization failed
    org.apache.camel.RuntimeCamelException: java.lang.IllegalArgumentException: The output must be added as top-level on the route. Try moving Transacted[ref:requiresNew] to the top of route.
                    at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1642)</p>
  </blockquote>
  
  <p>Looked up the documentation and forums and looks like only one transaction scope is allowed within a Route. Am looking for a solution where transaction can be controlled from the Route and multiple transaction scopes can be created. </p>
  
  <p>Is this currently allowed?</p>