You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/09/18 09:16:01 UTC

[jira] [Commented] (CAMEL-11777) Transactional hazelcast:seda component uses not transaction aware queue

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

ASF GitHub Bot commented on CAMEL-11777:
----------------------------------------

GitHub user lanwen opened a pull request:

    https://github.com/apache/camel/pull/1936

    CAMEL-11777: Use transaction aware queue in hazelcast:seda component

    As mentioned in docs of hz (any version, current for example)
    http://docs.hazelcast.org/docs/3.8.4/manual/html-single/index.html#creating-a-transaction-interface
    Transaction do its work if queue initialized with help of transaction ctx

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/lanwen/camel CAMEL-11777

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/camel/pull/1936.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1936
    
----
commit c679eaf67acb129137b04b8199c4ddbafa5b28b5
Author: Kirill Merkushev <la...@yandex.ru>
Date:   2017-09-18T09:13:49Z

    CAMEL-11777: Use transaction aware queue in hazelcast:seda component
    
    As mentioned in docs of hz (any version, current for example)
    http://docs.hazelcast.org/docs/3.8.4/manual/html-single/index.html#creating-a-transaction-interface
    Transaction do its work if queue initialized with help of transaction ctx

----


> Transactional hazelcast:seda component uses not transaction aware queue
> -----------------------------------------------------------------------
>
>                 Key: CAMEL-11777
>                 URL: https://issues.apache.org/jira/browse/CAMEL-11777
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-hazelcast
>    Affects Versions: 2.19.2
>            Reporter: Kirill Merkushev
>
> As mentioned in docs 
> http://docs.hazelcast.org/docs/3.8.4/manual/html-single/index.html#creating-a-transaction-interface
> Data structures should be transaction-aware and initialized inside of transaction context. Now hazelcast seda component uses queue initialized externally for the transaction. So when we rollback transaction - things stay the same like we already committed changes (this simply noop).
> Patch should look like (but exactly this version fails tests, so I should investigate more)
> {code:none}
> index 7e3b24cc8f..cebd69ce16 100644
> --- a/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/seda/HazelcastSedaConsumer.java
> +++ b/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/seda/HazelcastSedaConsumer.java
> @@ -16,10 +16,10 @@
>   */
>  package org.apache.camel.component.hazelcast.seda;
>  
> -import java.util.concurrent.BlockingQueue;
>  import java.util.concurrent.ExecutorService;
>  import java.util.concurrent.TimeUnit;
>  
> +import com.hazelcast.core.BaseQueue;
>  import com.hazelcast.transaction.TransactionContext;
>  
>  import org.apache.camel.AsyncCallback;
> @@ -71,7 +71,7 @@ public class HazelcastSedaConsumer extends DefaultConsumer implements Runnable {
>      }
>  
>      public void run() {
> -        final BlockingQueue<?> queue = endpoint.getQueue();
> +        BaseQueue<?> queue = endpoint.getHazelcastInstance().getQueue(endpoint.getConfiguration().getQueueName());
>  
>          while (queue != null && isRunAllowed()) {
>              final Exchange exchange = this.getEndpoint().createExchange();
> @@ -85,6 +85,7 @@ public class HazelcastSedaConsumer extends DefaultConsumer implements Runnable {
>                      if (transactionCtx != null) {
>                          log.trace("Begin transaction: {}", transactionCtx.getTxnId());
>                          transactionCtx.beginTransaction();
> +                        queue = transactionCtx.getQueue(endpoint.getConfiguration().getQueueName());
>                      }
>                  }
>  
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)