[
https://issues.apache.org/jira/browse/ROCKETMQ-26?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
stone updated ROCKETMQ-26:
--------------------------
Description:
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))
> 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)