private CompletableFuture<String> send(final Message message){
  final CompletableFuture<String> future=new CompletableFuture<>();
  int currentSize;
  int newSize;
  do {
    currentSize=size.get();
    newSize=currentSize + 1;
    if (newSize > queueSize) {
      future.completeExceptionally(new QueueFullException());
      return future;
    }
  }
 while (!size.compareAndSet(currentSize,newSize));
  queue.add(new QueuedMessage(message,future));
  scheduleSend(newSize);
  return future;
}

private CompletableFuture < String > send ( final Message message ) { final CompletableFuture < String > future = new CompletableFuture < > ( ) ; int currentSize ; int newSize ; do { currentSize = size . get ( ) ; newSize = currentSize + 1 ; if ( newSize > queueSize ) { future . completeExceptionally ( new QueueFullException ( ) ) ; return future ; } } while ( ! size . compareAndSet ( currentSize , newSize ) ) ; queue . add ( new QueuedMessage ( message , future ) ) ; scheduleSend ( newSize ) ; return future ; }
enqueue a message for sending on this topic queue .
