public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { trace(info.createRemoveCommand()); super.removeConsumer(context, info); }
public synchronized void dispose() { if (!closed) { try { this.connection.asyncSendPacket(info.createRemoveCommand()); } catch (JMSException e) { LOG.debug("Failed to send remove command: " + e, e); } this.connection.removeDispatcher(info.getConsumerId()); closed = true; } }
/** * Closes the connection consumer. <p/> * <P> * Since a provider may allocate some resources on behalf of a connection * consumer outside the Java virtual machine, clients should close these * resources when they are not needed. Relying on garbage collection to * eventually reclaim these resources may not be timely enough. * * @throws JMSException */ public void close() throws JMSException { if (!closed) { dispose(); this.connection.asyncSendPacket(this.consumerInfo.createRemoveCommand()); } }
private void fireVirtualDestinationRemoveAdvisory(ConnectionContext context, ConsumerInfo info) throws Exception { VirtualDestination virtualDestination = virtualDestinationConsumers.remove(info); if (virtualDestination != null) { LOG.debug("Virtual consumer removed: {}, for virtual destination: {}", info, virtualDestination); ActiveMQTopic topic = AdvisorySupport.getVirtualDestinationConsumerAdvisoryTopic(virtualDestination.getVirtualDestination()); ActiveMQDestination dest = info.getDestination(); if (!dest.isTemporary() || destinations.containsKey(dest)) { fireConsumerAdvisory(context, dest, topic, info.createRemoveCommand()); } } }
void doClose() throws JMSException { dispose(); RemoveInfo removeCommand = info.createRemoveCommand(); LOG.debug("remove: {}, lastDeliveredSequenceId: {}", getConsumerId(), lastDeliveredSequenceId); removeCommand.setLastDeliveredSequenceId(lastDeliveredSequenceId); this.session.asyncSendPacket(removeCommand); }
@Override public void run() { sub.waitForCompletion(); try { localBroker.oneway(sub.getLocalInfo().createRemoveCommand()); } catch (IOException e) { LOG.warn("failed to deliver remove command for local subscription, for remote {}", sub.getRemoteInfo().getConsumerId(), e); } } });
@Override public void run() { try { RemoveInfo removeCommand = subToClose.getConsumerInfo().createRemoveCommand(); if (connection instanceof CommandVisitor) { // avoid service exception handling and logging removeCommand.visit((CommandVisitor) connection); } else { connection.service(removeCommand); } } catch (IllegalStateException ignoredAsRemoteHasDoneTheJob) { } catch (Exception e) { LOG.info("exception on local remove of slow consumer: {}", subToClose.getConsumerInfo().getConsumerId(), e); } }}, 1000l);
@Override public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { super.removeConsumer(context, info); // Don't advise advisory topics. ActiveMQDestination dest = info.getDestination(); if (!AdvisorySupport.isAdvisoryTopic(dest)) { ActiveMQTopic topic = AdvisorySupport.getConsumerAdvisoryTopic(dest); consumersLock.writeLock().lock(); try { consumers.remove(info.getConsumerId()); //remove the demand for this consumer if it matches a virtual destination if(getBrokerService().isUseVirtualDestSubs()) { fireVirtualDestinationRemoveAdvisory(context, info); } } finally { consumersLock.writeLock().unlock(); } if (!dest.isTemporary() || destinations.containsKey(dest)) { fireConsumerAdvisory(context, dest, topic, info.createRemoveCommand()); } } }
public void removeConsumer(ConnectionContext context, ConsumerInfo info) throws Exception { trace(info.createRemoveCommand()); super.removeConsumer(context, info); }
public synchronized void dispose() { if (!closed) { try { this.connection.asyncSendPacket(info.createRemoveCommand()); } catch (JMSException e) { LOG.debug("Failed to send remove command: " + e, e); } this.connection.removeDispatcher(info.getConsumerId()); closed = true; } }
public synchronized void dispose() { if (!closed) { try { this.connection.asyncSendPacket(info.createRemoveCommand()); } catch (JMSException e) { LOG.debug("Failed to send remove command: " + e, e); } this.connection.removeDispatcher(info.getConsumerId()); closed = true; } }
public synchronized void dispose() { if (!closed) { try { this.connection.asyncSendPacket(info.createRemoveCommand()); } catch (JMSException e) { LOG.debug("Failed to send remove command: " + e, e); } this.connection.removeDispatcher(info.getConsumerId()); closed = true; } }
private void fireVirtualDestinationRemoveAdvisory(ConnectionContext context, ConsumerInfo info) throws Exception { VirtualDestination virtualDestination = virtualDestinationConsumers.remove(info); if (virtualDestination != null) { LOG.debug("Virtual consumer removed: {}, for virtual destination: {}", info, virtualDestination); ActiveMQTopic topic = AdvisorySupport.getVirtualDestinationConsumerAdvisoryTopic(virtualDestination.getVirtualDestination()); ActiveMQDestination dest = info.getDestination(); if (!dest.isTemporary() || destinations.containsKey(dest)) { fireConsumerAdvisory(context, dest, topic, info.createRemoveCommand()); } } }
private void fireVirtualDestinationRemoveAdvisory(ConnectionContext context, ConsumerInfo info) throws Exception { VirtualDestination virtualDestination = virtualDestinationConsumers.remove(info); if (virtualDestination != null) { LOG.debug("Virtual consumer removed: {}, for virtual destination: {}", info, virtualDestination); ActiveMQTopic topic = AdvisorySupport.getVirtualDestinationConsumerAdvisoryTopic(virtualDestination.getVirtualDestination()); ActiveMQDestination dest = info.getDestination(); if (!dest.isTemporary() || destinations.containsKey(dest)) { fireConsumerAdvisory(context, dest, topic, info.createRemoveCommand()); } } }
void doClose() throws JMSException { dispose(); RemoveInfo removeCommand = info.createRemoveCommand(); if (LOG.isDebugEnabled()) { LOG.debug("remove: " + this.getConsumerId() + ", lastDeliveredSequenceId:" + lastDeliveredSequenceId); } removeCommand.setLastDeliveredSequenceId(lastDeliveredSequenceId); this.session.asyncSendPacket(removeCommand); }
void doClose() throws JMSException { dispose(); RemoveInfo removeCommand = info.createRemoveCommand(); LOG.debug("remove: {}, lastDeliveredSequenceId: {}", getConsumerId(), lastDeliveredSequenceId); removeCommand.setLastDeliveredSequenceId(lastDeliveredSequenceId); this.session.asyncSendPacket(removeCommand); }
void doClose() throws JMSException { dispose(); RemoveInfo removeCommand = info.createRemoveCommand(); LOG.debug("remove: {}, lastDeliveredSequenceId: {}", getConsumerId(), lastDeliveredSequenceId); removeCommand.setLastDeliveredSequenceId(lastDeliveredSequenceId); this.session.asyncSendPacket(removeCommand); }
@Override public void run() { sub.waitForCompletion(); try { localBroker.oneway(sub.getLocalInfo().createRemoveCommand()); } catch (IOException e) { LOG.warn("failed to deliver remove command for local subscription, for remote {}", sub.getRemoteInfo().getConsumerId(), e); } } });
@Override public void run() { sub.waitForCompletion(); try { localBroker.oneway(sub.getLocalInfo().createRemoveCommand()); } catch (IOException e) { LOG.warn("failed to deliver remove command for local subscription, for remote {}", sub.getRemoteInfo().getConsumerId(), e); } } });
@Override public void run() { sub.waitForCompletion(); try { localBroker.oneway(sub.getLocalInfo().createRemoveCommand()); } catch (IOException e) { LOG.warn("failed to deliver remove command for local subscription, for remote {}", sub.getRemoteInfo().getConsumerId(), e); } } });