command callback execution within gateway

use it like this…

`

public class CompleteableFutureCallback<R> implements CommandCallback<R> {

    @Getter
    private CompletableFuture<R> future = new CompletableFuture<R>();

    @Override
    public void onSuccess(R result) {
        future.complete(result);
    }

    @Override
    public void onFailure(Throwable cause) {
        future.completeExceptionally(cause);
    }
}

CompleteableFutureCallback callback = new CompleteableFutureCallback();commandGateway.send(command, callback);
callback.getFuture().thenAccept(e -> {
//execute on other thread on accepted
});

`