コード例 #1
0
  private void handleRegularMessage(ClientMessageInternal message) {
    if (message.getAddress() == null) {
      message.setAddressTransient(queueInfo.getAddress());
    }

    message.onReceipt(this);

    if (!ackIndividually
        && message.getPriority() != 4
        && !message.containsProperty(ClientConsumerImpl.FORCED_DELIVERY_MESSAGE)) {
      // We have messages of different priorities so we need to ack them individually since the
      // order
      // of them in the ServerConsumerImpl delivery list might not be the same as the order they are
      // consumed in, which means that acking all up to won't work
      ackIndividually = true;
    }

    // Add it to the buffer
    buffer.addTail(message, message.getPriority());

    if (handler != null) {
      // Execute using executor
      if (!stopped) {
        queueExecutor();
      }
    } else {
      notify();
    }
  }