rocketmq-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (ROCKETMQ-26) add a new way to send message in async
Date Sun, 01 Jan 2017 04:03:58 GMT

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

ASF GitHub Bot commented on ROCKETMQ-26:
----------------------------------------

GitHub user thisisbaozi opened a pull request:

    https://github.com/apache/incubator-rocketmq/pull/26

    [ROCKETMQ-26]add new way to send messages in asynchronous way 

    Jira issue: https://issues.apache.org/jira/browse/ROCKETMQ-26

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

    $ git pull https://github.com/thisisbaozi/incubator-rocketmq master

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

    https://github.com/apache/incubator-rocketmq/pull/26.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 #26
    
----
commit 67545d976c608211eeb07feca0b9e39b5f04c2b1
Author: thisisbaozi <thisisbaozi@gmail.com>
Date:   2017-01-01T02:52:47Z

    add new way to send message in asynchronous way

commit 0ddbc4471a6ed1305bade5bb5eb58c8182066990
Author: thisisbaozi <thisisbaozi@gmail.com>
Date:   2017-01-01T03:39:44Z

    [ROCKETMQ-26]add a new way to send message in asynchronous

commit 85eb28f0500bd2c73fefded7d845736b5d3fc46b
Author: thisisbaozi <thisisbaozi@gmail.com>
Date:   2017-01-01T04:01:36Z

    [ROCKETMQ-26]add new way to send messages in asynchronous way

----


> add a new way to send message in async
> --------------------------------------
>
>                 Key: ROCKETMQ-26
>                 URL: https://issues.apache.org/jira/browse/ROCKETMQ-26
>             Project: Apache RocketMQ
>          Issue Type: New Feature
>            Reporter: stone
>            Assignee: vongosling
>
> an new way to send message in async way, it looks like:
> MQProducer producer = ...;
> ExecutorService sharedExecutorService = ...
> SendFuture future = producer.send(msg, sharedExecutorService, timeout);
> future.addCallback(new SendCallback() {
>             @Override
>             public void onSuccess(SendResult sendResult) {
>                   // do sth 
>             }
>             @Override
>             public void onException(Throwable e) {
>                    // do sth
>             }
> })
> There are three advantages for this way:
> 0. Executes the callback logic in exclusive thread pool
> 1. Multiple callbacks are allowed
> 2. Gets the result of sending in synchronous API(get/get(time, unit))



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message