@Override
  public Response processRemoveConsumer(ConsumerId id, long lastDeliveredSequenceId)
      throws Exception {
    SessionId sessionId = id.getParentId();
    SessionState ss = state.getSessionState(sessionId);
    if (ss == null) {
      throw new IllegalStateException(
          "Cannot remove a consumer from a session that had not been registered: " + sessionId);
    }
    ConsumerState consumerState = ss.removeConsumer(id);
    if (consumerState == null) {
      throw new IllegalStateException(
          "Cannot remove a consumer that had not been registered: " + id);
    }
    ConsumerInfo info = consumerState.getInfo();
    info.setLastDeliveredSequenceId(lastDeliveredSequenceId);

    AMQConsumerBrokerExchange consumerBrokerExchange = consumerExchanges.get(id);

    consumerBrokerExchange.removeConsumer();

    removeConsumerBrokerExchange(id);

    return null;
  }