public void messageArrived(MqttPublish sendMessage){
  final String methodName="messageArrived";
  if (mqttCallback != null || callbacks.size() > 0) {
synchronized (spaceAvailable) {
      while (running && !quiescing && messageQueue.size() >= INBOUND_QUEUE_SIZE) {
        try {
          log.fine(CLASS_NAME,methodName,"709");
          spaceAvailable.wait(200);
        }
 catch (        InterruptedException ex) {
        }
      }
    }
    if (!quiescing) {
      messageQueue.addElement(sendMessage);
synchronized (workAvailable) {
        log.fine(CLASS_NAME,methodName,"710");
        workAvailable.notifyAll();
      }
    }
  }
}

public void messageArrived ( MqttPublish sendMessage ) { final String methodName = "messageArrived" ; if ( mqttCallback != null || callbacks . size ( ) > 0 ) { synchronized ( spaceAvailable ) { while ( running && ! quiescing && messageQueue . size ( ) >= INBOUND_QUEUE_SIZE ) { try { log . fine ( CLASS_NAME , methodName , "709" ) ; spaceAvailable . wait ( 200 ) ; } catch ( InterruptedException ex ) { } } } if ( ! quiescing ) { messageQueue . addElement ( sendMessage ) ; synchronized ( workAvailable ) { log . fine ( CLASS_NAME , methodName , "710" ) ; workAvailable . notifyAll ( ) ; } } } }
this method is called when a message arrives on a topic . messages are only added to the queue for inbound messages if the client is not quiescing .
