public CompletableFuture asyncSend()

in rocketmq-v5-client-spring-boot/src/main/java/org/apache/rocketmq/client/core/RocketMQClientTemplate.java [304:326]


    public CompletableFuture<SendReceipt> asyncSend(String destination, Message<?> message, Duration messageDelayTime, String messageGroup, CompletableFuture<SendReceipt> future) {
        if (Objects.isNull(message) || Objects.isNull(message.getPayload())) {
            throw new IllegalArgumentException("`message` and `message.payload` cannot be null");
        }
        Producer grpcProducer = this.getProducer();
        CompletableFuture<SendReceipt> future0;
        try {
            org.apache.rocketmq.client.apis.message.Message rocketMsg = this.createRocketMQMessage(destination, message, messageDelayTime, messageGroup);
            future0 = grpcProducer.sendAsync(rocketMsg);
            if (null != future) {
                future0.whenComplete((sendReceipt, throwable) -> {
                    if (null != throwable) {
                        future.completeExceptionally(throwable);
                    } else {
                        future.complete(sendReceipt);
                    }
                });
            }
        } catch (Exception e) {
            throw new MessagingException(e.getMessage(), e);
        }
        return future0;
    }