Hi,

Can you also post the code with which you were invoking the "direct:start"
endpoint? Are you initiating a JTA transaction from there?

Typically JTA TransactionManagers bind transactions to threads. Messages
sent to a "direct:..." endpoint continue processing in the same thread as
the calling code, but Jetty is probably spawning a new thread. Hence, the
Tx might not be propagated.

Also, take a look at explicitly setting Transaction Policies [1]. For each
<transacted /> block, you can indicate a Transaction Policy which specifies
various options like the propagation behaviour and the underlying TxManager
to use.

Additionally, there will be a webinar on Camel Persistence on November 22nd
which will demo advanced Camel TX functionality on top of standalone
transaction managers as well as JTA. You can sign up at [2] if you wish.

Regards,
Raúl.

[1] http://camel.apache.org/transactional-client.html.
[2] http://fusesource.com/enterprise-support/getting-started/

On 13 November 2011 17:01, Claus Ibsen <claus.ib...@gmail.com> wrote:

> Hi
>
> Can you post the stack trace?
> What server/container are you using?
> And what version of Camel and ActiveMQ are you using?
>
>
>
> On Fri, Nov 11, 2011 at 12:38 PM, simon godden <sgod...@gmail.com> wrote:
> > I have had a context happily set up using XA transactions for several
> days.
> >
> > As long as I am triggering it from a "direct:start" producer, then
> > everything is fine - my XA transactions work.
> >
> > As soon as I change it to trigger from the jetty http endpoint
> > producer, I get an error when I do my first queue write:  Session's
> > XAResource has not been enlisted in a distributed transaction.  If I
> > switch it back to "direct:start", then no problem.
> >
> > I have tried playing about with this every which way to no avail.  Can
> > anyone help?
> >
> >        <camelContext id="cargo-publish-new-polices-context"
> > xmlns="http://camel.apache.org/schema/spring";>
> >
> >                <errorHandler id="deadLetterChannel"
> type="DeadLetterChannel"
> > deadLetterUri="vm:frameError"
> >                        useOriginalMessage="true">
> >                        <redeliveryPolicy maximumRedeliveries="5"
> > retryAttemptedLogLevel="WARN" redeliveryDelay="500" />
> >                </errorHandler>
> >
> >                <dataFormats>
> >                        <jaxb id="jaxb"
> contextPath="com.catlincargo.cargopolicy._1" />
> >                </dataFormats>
> >
> >                <route id="getNewPolicies">
> >                        <!--
> >                        <from uri="direct:start" />
> >                        -->
> >                        <from uri="jetty:
> http://localhost:11000/cargoFrameIntegration"/>
> >                        <to uri="vm:cargoNewPoliciesIn" />
> >                </route>
> >
> >                <route id="publishNewPolicies">
> >                        <from uri="vm:cargoNewPoliciesIn" />
> >                        <transacted />
> >                        <bean ref="policyProducer" />
> >                        <split>
> >                                <simple>${body}</simple>
> >                                <process ref="preMarshalingProcessor" />
> >                                <marshal ref="jaxb" />
> >                                <to uri="activemq:queue:cargoNewPolicies"
> />
> >                        </split>
> >                        <process ref="processedModVersionUpdateProcessor"
> />
> >                </route>
> >
> >                <route id="invokeFrame"
> errorHandlerRef="deadLetterChannel">
> >                        <from uri="activemq:queue:cargoNewPolicies" />
> >                        <transacted />
> >                        <unmarshal ref="jaxb" />
> >                        <process ref="frameInvocationProcessor" />
> >                </route>
> >
> >                <route id="handleFrameError">
> >                        <from uri="vm:frameError" />
> >                        <transacted />
> >                        <unmarshal ref="jaxb" />
> >                        <process ref="errorLogProcessor" />
> >                        <process ref="preMarshalingProcessor" />
> >                        <marshal ref="jaxb" />
> >                        <to uri="activemq:queue:cargoNewPoliciesError" />
> >                </route>
> >
> >        </camelContext>
> >
> >
> > --
> > Simon Godden
> >
>
>
>
> --
> Claus Ibsen
> -----------------
> FuseSource
> Email: cib...@fusesource.com
> Web: http://fusesource.com
> Twitter: davsclaus, fusenews
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/
>

Reply via email to