[ 
https://issues.apache.org/jira/browse/CAMEL-12927?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16713253#comment-16713253
 ] 

Craig commented on CAMEL-12927:
-------------------------------

That's code I'm submitting for consideration to solve the issue.

 It is not currently in 
[SqsProducer|https://github.com/apache/camel/blob/camel-2.23.0/components/camel-aws/src/main/java/org/apache/camel/component/aws/sqs/SqsProducer.java].

> SQS: Optionally wait for transaction complete to send messages in SqsProducer
> -----------------------------------------------------------------------------
>
>                 Key: CAMEL-12927
>                 URL: https://issues.apache.org/jira/browse/CAMEL-12927
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-aws
>    Affects Versions: 2.22.1
>            Reporter: Craig
>            Priority: Major
>
> Currently, SQS sends messages immediately not waiting for the transaction to 
> commit. Since SQS doesn't support transactional message sending, this 
> behavior is as expected. However, Camel could emulate transaction support for 
> SQS by waiting for the current transaction to commit before sending the 
> message. This would make SQS behave more in line with JMS.
> In SqsConfiguration, add one new property:
>  * transacted
> When transactioned=false (default), behavior is as it is today.
> When transaction=true, don't send the message until the transaction 
> completes. In SqsProducer, wrap the call to
> {code:java}
> SendMessageResult result = getClient().sendMessage(request);{code}
> like so:
> {code:java}
>         
> org.springframework.transaction.support.TransactionSynchronizationManager.registerSynchronization(new
>  org.springframework.transaction.support.TransactionSynchronizationAdapter() {
>             @Override
>             public void afterCommit() {
>                 SendMessageResult result = getClient().sendMessage(request);
>             }
>             
>         });{code}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to