@Override public CompletableFuture<Void> doUnsubscribe(Consumer consumer){
  CompletableFuture<Void> future=new CompletableFuture<>();
  try {
    if (dispatcher.canUnsubscribe(consumer)) {
      consumer.close();
      return delete();
    }
    future.completeExceptionally(new ServerMetadataException("Unconnected or shared consumer attempting to unsubscribe"));
  }
 catch (  BrokerServiceException e) {
    log.warn("Error removing consumer {}",consumer);
    future.completeExceptionally(e);
  }
  return future;
}

@ Override public CompletableFuture < Void > doUnsubscribe ( Consumer consumer ) { CompletableFuture < Void > future = new CompletableFuture < > ( ) ; try { if ( dispatcher . canUnsubscribe ( consumer ) ) { consumer . close ( ) ; return delete ( ) ; } future . completeExceptionally ( new ServerMetadataException ( "Unconnected or shared consumer attempting to unsubscribe" ) ) ; } catch ( BrokerServiceException e ) { log . warn ( "Error removing consumer {}" , consumer ) ; future . completeExceptionally ( e ) ; } return future ; }
handle unsubscribe command from the client api check with the dispatcher is this consumer can proceed with unsubscribe
