@Override public Map<ActiveMQDestination, Destination> getDestinationMap() { return getNext().getDestinationMap(); }
@Override public Map<ActiveMQDestination, Destination> getDestinationMap(ActiveMQDestination destination) { return getNext().getDestinationMap(destination); }
public boolean checkQueueSize(String queueName) { long count = 0; long queueSize = 0; Map<ActiveMQDestination, Destination> destinationMap = regionBroker.getDestinationMap(); for (Map.Entry<ActiveMQDestination, Destination> entry : destinationMap.entrySet()) { if (entry.getKey().isQueue()) { if (entry.getValue().getName().matches(queueName)) { queueSize = entry.getValue().getDestinationStatistics().getMessages().getCount(); count += queueSize; if (queueSize > 0) { LOG.info("Queue has pending message: {} queueSize is: {}", entry.getValue().getName(), queueSize); } } } } return count == 0; }
public Map<ActiveMQDestination, Destination> getDestinationMap() { return next.getDestinationMap(); }
@Override public Map<ActiveMQDestination, Destination> getDestinationMap(ActiveMQDestination destination) { return getNext().getDestinationMap(destination); }
@Override public Map<ActiveMQDestination, Destination> getDestinationMap() { return getNext().getDestinationMap(); }
@Override public Map<ActiveMQDestination, Destination> getDestinationMap() { return getNext().getDestinationMap(); }
@Override public Map<ActiveMQDestination, Destination> getDestinationMap(ActiveMQDestination destination) { return getNext().getDestinationMap(destination); }
@Override public Map<ActiveMQDestination, Destination> getDestinationMap(ActiveMQDestination destination) { return getNext().getDestinationMap(destination); }
@Override public Map<ActiveMQDestination, Destination> getDestinationMap() { return getNext().getDestinationMap(); }
public Map<ActiveMQDestination, Destination> getDestinationMap() { return getNext().getDestinationMap(); }
public boolean checkQueueSize(String queueName) { long count = 0; long queueSize = 0; Map<ActiveMQDestination, Destination> destinationMap = regionBroker.getDestinationMap(); for (Map.Entry<ActiveMQDestination, Destination> entry : destinationMap.entrySet()) { if (entry.getKey().isQueue()) { if (entry.getValue().getName().matches(queueName)) { queueSize = entry.getValue().getDestinationStatistics().getMessages().getCount(); count += queueSize; if (queueSize > 0) { LOG.info("Queue has pending message: {} queueSize is: {}", entry.getValue().getName(), queueSize); } } } } return count == 0; }
public boolean checkQueueSize(String queueName) { long count = 0; long queueSize = 0; Map<ActiveMQDestination, Destination> destinationMap = regionBroker.getDestinationMap(); for (Map.Entry<ActiveMQDestination, Destination> entry : destinationMap.entrySet()) { if (entry.getKey().isQueue()) { if (entry.getValue().getName().matches(queueName)) { queueSize = entry.getValue().getDestinationStatistics().getMessages().getCount(); count += queueSize; if (queueSize > 0) { LOG.info("Queue has pending message: {} queueSize is: {}", entry.getValue().getName(), queueSize); } } } } return count == 0; }
public boolean checkQueueSize(String queueName) { long count = 0; long queueSize = 0; Map<ActiveMQDestination, Destination> destinationMap = regionBroker.getDestinationMap(); for (Map.Entry<ActiveMQDestination, Destination> entry : destinationMap.entrySet()) { if (entry.getKey().isQueue()) { if (entry.getValue().getName().matches(queueName)) { queueSize = entry.getValue().getDestinationStatistics().getMessages().getCount(); count += queueSize; if (queueSize > 0) { LOG.info("Queue has pending message: {} queueSize is: {}", entry.getValue().getName(), queueSize); } } } } return count == 0; }
public boolean checkQueueSize(String queueName) { long count = 0; long queueSize = 0; Map<ActiveMQDestination, Destination> destinationMap = regionBroker.getDestinationMap(); for (Map.Entry<ActiveMQDestination, Destination> entry : destinationMap.entrySet()) { if (entry.getKey().isQueue()) { if (entry.getValue().getName().matches(queueName)) { queueSize = entry.getValue().getDestinationStatistics().getMessages().getCount(); count += queueSize; if (queueSize > 0) { LOG.info("Queue has pending message:" + entry.getValue().getName() + " queueSize is:" + queueSize); } } } } return count == 0; }
public Set<String> processQueues () { BrokerService brokerService = getProvider(); if (brokerService == null) { log.debug("processQueues - JMS Server has not been started"); return null; } Set<String> badQueues = new HashSet<String>(); try { Broker broker = brokerService.getBroker(); Map<ActiveMQDestination, Destination> dstMap = broker.getDestinationMap(); for (Map.Entry<ActiveMQDestination, Destination> entry: dstMap.entrySet()) { ActiveMQDestination amqDestination = entry.getKey(); Destination destination = entry.getValue(); if (destinationLimitReached(destination)) { badQueues.add(destination.getName()); deleteDestination(broker, amqDestination, destination); } } } catch (Exception e) { log.error("Encounter exception while getting jms broker", e); } return badQueues; }
@Override protected void onRecovered(Tx tx) { for (RemoveMessageCommand removeMessageCommand: tx.acks) { if (removeMessageCommand instanceof LastAckCommand) { LastAckCommand lastAckCommand = (LastAckCommand) removeMessageCommand; JDBCTopicMessageStore jdbcTopicMessageStore = (JDBCTopicMessageStore) topicStores.get(lastAckCommand.getMessageAck().getDestination()); jdbcTopicMessageStore.pendingCompletion(lastAckCommand.getClientId(), lastAckCommand.getSubName(), lastAckCommand.getSequence(), lastAckCommand.getPriority()); lastAckCommand.setMessageStore(jdbcTopicMessageStore); } else { // when reading the store we ignore messages with non null XIDs but should include those with XIDS starting in - (pending acks in an xa transaction), // but the sql is non portable to match BLOB with LIKE etc // so we make up for it when we recover the ack ((JDBCPersistenceAdapter)persistenceAdapter).getBrokerService().getRegionBroker().getDestinationMap().get(removeMessageCommand.getMessageAck().getDestination()).getDestinationStatistics().getMessages().increment(); } } for (AddMessageCommand addMessageCommand : tx.messages) { ActiveMQDestination destination = addMessageCommand.getMessage().getDestination(); addMessageCommand.setMessageStore(destination.isQueue() ? queueStores.get(destination) : topicStores.get(destination)); } }
@Override protected void onRecovered(Tx tx) { for (RemoveMessageCommand removeMessageCommand: tx.acks) { if (removeMessageCommand instanceof LastAckCommand) { LastAckCommand lastAckCommand = (LastAckCommand) removeMessageCommand; JDBCTopicMessageStore jdbcTopicMessageStore = (JDBCTopicMessageStore) topicStores.get(lastAckCommand.getMessageAck().getDestination()); jdbcTopicMessageStore.pendingCompletion(lastAckCommand.getClientId(), lastAckCommand.getSubName(), lastAckCommand.getSequence(), lastAckCommand.getPriority()); lastAckCommand.setMessageStore(jdbcTopicMessageStore); } else { // when reading the store we ignore messages with non null XIDs but should include those with XIDS starting in - (pending acks in an xa transaction), // but the sql is non portable to match BLOB with LIKE etc // so we make up for it when we recover the ack ((JDBCPersistenceAdapter)persistenceAdapter).getBrokerService().getRegionBroker().getDestinationMap().get(removeMessageCommand.getMessageAck().getDestination()).getDestinationStatistics().getMessages().increment(); } } for (AddMessageCommand addMessageCommand : tx.messages) { ActiveMQDestination destination = addMessageCommand.getMessage().getDestination(); addMessageCommand.setMessageStore(destination.isQueue() ? queueStores.get(destination) : topicStores.get(destination)); } }
@Override protected void onRecovered(Tx tx) { for (RemoveMessageCommand removeMessageCommand: tx.acks) { if (removeMessageCommand instanceof LastAckCommand) { LastAckCommand lastAckCommand = (LastAckCommand) removeMessageCommand; JDBCTopicMessageStore jdbcTopicMessageStore = (JDBCTopicMessageStore) topicStores.get(lastAckCommand.getMessageAck().getDestination()); jdbcTopicMessageStore.pendingCompletion(lastAckCommand.getClientId(), lastAckCommand.getSubName(), lastAckCommand.getSequence(), lastAckCommand.getPriority()); lastAckCommand.setMessageStore(jdbcTopicMessageStore); } else { // when reading the store we ignore messages with non null XIDs but should include those with XIDS starting in - (pending acks in an xa transaction), // but the sql is non portable to match BLOB with LIKE etc // so we make up for it when we recover the ack ((JDBCPersistenceAdapter)persistenceAdapter).getBrokerService().getRegionBroker().getDestinationMap().get(removeMessageCommand.getMessageAck().getDestination()).getDestinationStatistics().getMessages().increment(); } } for (AddMessageCommand addMessageCommand : tx.messages) { ActiveMQDestination destination = addMessageCommand.getMessage().getDestination(); addMessageCommand.setMessageStore(destination.isQueue() ? queueStores.get(destination) : topicStores.get(destination)); } }