SQS - possible thread handling confusion with transactions

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

SQS - possible thread handling confusion with transactions

James Green
Hi,

I am looking at Spring Boot app that has been extended to include an
@SqsListener that uses ProducerTemplate to forward messages into a Camel
route.

An integration test was hooked up with ElasticMQ and all _appears_ correct
except assertions that the database records are correct - they in fact
appear to have been rolled back.

Logs indicate one thing - the SQS Listener is in one thread, camel another.

The camel route includes:

.transacted("springTransactionPolicyRequiresNew") // Start a new transaction

This works fine with Camel receiving messages from an ActiveMQ, however
clearly inadequate for SQS purposes.

Can anyone point me in the right direction?

Incidentally, the sqs component claims existance since Camel 2.6 yet I
cannot find it before 3.0. Am i missing something?

Thanks,

James
Reply | Threaded
Open this post in threaded view
|

Re: SQS - possible thread handling confusion with transactions

Claus Ibsen-2
Hi

In Camel 2.x the aws components are all together in one giant
camel-aws component JAR

On Mon, Mar 30, 2020 at 6:23 PM James Green <[hidden email]> wrote:

>
> Hi,
>
> I am looking at Spring Boot app that has been extended to include an
> @SqsListener that uses ProducerTemplate to forward messages into a Camel
> route.
>
> An integration test was hooked up with ElasticMQ and all _appears_ correct
> except assertions that the database records are correct - they in fact
> appear to have been rolled back.
>
> Logs indicate one thing - the SQS Listener is in one thread, camel another.
>
> The camel route includes:
>
> .transacted("springTransactionPolicyRequiresNew") // Start a new transaction
>
> This works fine with Camel receiving messages from an ActiveMQ, however
> clearly inadequate for SQS purposes.
>
> Can anyone point me in the right direction?
>
> Incidentally, the sqs component claims existance since Camel 2.6 yet I
> cannot find it before 3.0. Am i missing something?
>
> Thanks,
>
> James



--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2