org.apache.activemq.broker.Broker.removeConsumer()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(9.2k)|赞(0)|评价(0)|浏览(145)

本文整理了Java中org.apache.activemq.broker.Broker.removeConsumer()方法的一些代码示例,展示了Broker.removeConsumer()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Broker.removeConsumer()方法的具体详情如下:
包路径:org.apache.activemq.broker.Broker
类名称:Broker
方法名:removeConsumer

Broker.removeConsumer介绍

暂无

代码示例

代码示例来源:origin: apache/activemq

@Override
public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception {
  next.removeConsumer(context, info);
  Broker brokers[] = getListeners();
  for (int i = 0; i < brokers.length; i++) {
    brokers[i].removeConsumer(context, info);
  }
}

代码示例来源:origin: apache/activemq

@Override
public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception {
  getNext().removeConsumer(context, info);
}

代码示例来源:origin: apache/activemq

@Override
public Response processRemoveConsumer(ConsumerId id, long lastDeliveredSequenceId) throws Exception {
  SessionId sessionId = id.getParentId();
  ConnectionId connectionId = sessionId.getParentId();
  TransportConnectionState cs = lookupConnectionState(connectionId);
  if (cs == null) {
    throw new IllegalStateException("Cannot remove a consumer from a connection that had not been registered: "
        + connectionId);
  }
  SessionState ss = cs.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);
  broker.removeConsumer(cs.getContext(), consumerState.getInfo());
  removeConsumerBrokerExchange(id);
  return null;
}

代码示例来源:origin: apache/activemq

addConsumerBrokerExchange(cs, info.getConsumerId());
} catch (IllegalStateException e) {
  broker.removeConsumer(cs.getContext(), info);

代码示例来源:origin: pierre/meteo

public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception {
  next.removeConsumer(context, info);
}

代码示例来源:origin: org.apache.activemq/activemq-broker

@Override
public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception {
  next.removeConsumer(context, info);
  Broker brokers[] = getListeners();
  for (int i = 0; i < brokers.length; i++) {
    brokers[i].removeConsumer(context, info);
  }
}

代码示例来源:origin: org.apache.activemq/activemq-osgi

@Override
public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception {
  next.removeConsumer(context, info);
  Broker brokers[] = getListeners();
  for (int i = 0; i < brokers.length; i++) {
    brokers[i].removeConsumer(context, info);
  }
}

代码示例来源:origin: pierre/meteo

@Override
public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception {
  next.removeConsumer(context, info);
  Broker brokers[] = getListeners();
  for (int i = 0; i < brokers.length; i++) {
    brokers[i].removeConsumer(context, info);
  }
}

代码示例来源:origin: org.apache.activemq/activemq-all

@Override
public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception {
  next.removeConsumer(context, info);
  Broker brokers[] = getListeners();
  for (int i = 0; i < brokers.length; i++) {
    brokers[i].removeConsumer(context, info);
  }
}

代码示例来源:origin: org.apache.activemq/activemq-broker

@Override
public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception {
  getNext().removeConsumer(context, info);
}

代码示例来源:origin: org.apache.activemq/activemq-osgi

@Override
public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception {
  getNext().removeConsumer(context, info);
}

代码示例来源:origin: org.apache.activemq/activemq-all

@Override
public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception {
  getNext().removeConsumer(context, info);
}

代码示例来源:origin: pierre/meteo

public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception {
  getNext().removeConsumer(context, info);
}

代码示例来源:origin: org.apache.activemq/activemq-osgi

@Override
public Response processRemoveConsumer(ConsumerId id, long lastDeliveredSequenceId) throws Exception {
  SessionId sessionId = id.getParentId();
  ConnectionId connectionId = sessionId.getParentId();
  TransportConnectionState cs = lookupConnectionState(connectionId);
  if (cs == null) {
    throw new IllegalStateException("Cannot remove a consumer from a connection that had not been registered: "
        + connectionId);
  }
  SessionState ss = cs.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);
  broker.removeConsumer(cs.getContext(), consumerState.getInfo());
  removeConsumerBrokerExchange(id);
  return null;
}

代码示例来源:origin: org.apache.activemq/activemq-broker

@Override
public Response processRemoveConsumer(ConsumerId id, long lastDeliveredSequenceId) throws Exception {
  SessionId sessionId = id.getParentId();
  ConnectionId connectionId = sessionId.getParentId();
  TransportConnectionState cs = lookupConnectionState(connectionId);
  if (cs == null) {
    throw new IllegalStateException("Cannot remove a consumer from a connection that had not been registered: "
        + connectionId);
  }
  SessionState ss = cs.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);
  broker.removeConsumer(cs.getContext(), consumerState.getInfo());
  removeConsumerBrokerExchange(id);
  return null;
}

代码示例来源:origin: org.apache.activemq/activemq-all

@Override
public Response processRemoveConsumer(ConsumerId id, long lastDeliveredSequenceId) throws Exception {
  SessionId sessionId = id.getParentId();
  ConnectionId connectionId = sessionId.getParentId();
  TransportConnectionState cs = lookupConnectionState(connectionId);
  if (cs == null) {
    throw new IllegalStateException("Cannot remove a consumer from a connection that had not been registered: "
        + connectionId);
  }
  SessionState ss = cs.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);
  broker.removeConsumer(cs.getContext(), consumerState.getInfo());
  removeConsumerBrokerExchange(id);
  return null;
}

代码示例来源:origin: pierre/meteo

public Response processRemoveConsumer(ConsumerId id, long lastDeliveredSequenceId) throws Exception {
  SessionId sessionId = id.getParentId();
  ConnectionId connectionId = sessionId.getParentId();
  TransportConnectionState cs = lookupConnectionState(connectionId);
  if (cs == null) {
    throw new IllegalStateException("Cannot remove a consumer from a connection that had not been registered: "
        + connectionId);
  }
  SessionState ss = cs.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);
  broker.removeConsumer(cs.getContext(), consumerState.getInfo());
  removeConsumerBrokerExchange(id);
  return null;
}

代码示例来源:origin: pierre/meteo

public Response processAddConsumer(ConsumerInfo info) throws Exception {
  SessionId sessionId = info.getConsumerId().getParentId();
  ConnectionId connectionId = sessionId.getParentId();
  TransportConnectionState cs = lookupConnectionState(connectionId);
  SessionState ss = cs.getSessionState(sessionId);
  if (ss == null) {
    throw new IllegalStateException(broker.getBrokerName()
        + " Cannot add a consumer to a session that had not been registered: " + sessionId);
  }
  // Avoid replaying dup commands
  if (!ss.getConsumerIds().contains(info.getConsumerId())) {
    broker.addConsumer(cs.getContext(), info);
    try {
      ss.addConsumer(info);
    } catch (IllegalStateException e) {
      broker.removeConsumer(cs.getContext(), info);
    }
  }
  return null;
}

代码示例来源:origin: powertac/powertac-server

private void deleteDestination (Broker broker,
                 ActiveMQDestination amqDestination,
                 Destination destination) throws Exception
 {
  List<Subscription> subscriptions = destination.getConsumers();
  for (Subscription subscription: subscriptions) {
   ConsumerInfo info = new ConsumerInfo();
   info.setDestination(amqDestination);
   info.setConsumerId(subscription.getConsumerInfo().getConsumerId());
   broker.removeConsumer(subscription.getContext(), info);
  }
  ConnectionContext context = new ConnectionContext();
  context.setBroker(broker);
  broker.removeDestination(context, amqDestination, 0);
  log.info("processQueues - successfully remove queue " + destination.getName());
 }
}

代码示例来源:origin: org.apache.activemq/activemq-broker

addConsumerBrokerExchange(cs, info.getConsumerId());
} catch (IllegalStateException e) {
  broker.removeConsumer(cs.getContext(), info);

相关文章

微信公众号

最新文章

更多

Broker类方法