@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); } }
@Override public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { getNext().removeConsumer(context, info); }
@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; }
addConsumerBrokerExchange(cs, info.getConsumerId()); } catch (IllegalStateException e) { broker.removeConsumer(cs.getContext(), info);
public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { next.removeConsumer(context, info); }
@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); } }
@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); } }
@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); } }
@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); } }
@Override public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { getNext().removeConsumer(context, info); }
@Override public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { getNext().removeConsumer(context, info); }
@Override public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { getNext().removeConsumer(context, info); }
public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { getNext().removeConsumer(context, info); }
@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; }
@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; }
@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; }
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; }
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; }
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()); } }
addConsumerBrokerExchange(cs, info.getConsumerId()); } catch (IllegalStateException e) { broker.removeConsumer(cs.getContext(), info);