Java Code Examples for org.apache.activemq.artemis.core.settings.impl.AddressSettings#getExpiryAddress()
The following examples show how to use
org.apache.activemq.artemis.core.settings.impl.AddressSettings#getExpiryAddress() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: QueueControlImpl.java From activemq-artemis with Apache License 2.0 | 6 votes |
@Override public String getExpiryAddress() { if (AuditLogger.isEnabled()) { AuditLogger.getExpiryAddress(queue); } checkStarted(); clearIO(); try { AddressSettings addressSettings = addressSettingsRepository.getMatch(address); if (addressSettings != null && addressSettings.getExpiryAddress() != null) { return addressSettings.getExpiryAddress().toString(); } else { return null; } } finally { blockOnIO(); } }
Example 2
Source File: QueueImpl.java From activemq-artemis with Apache License 2.0 | 5 votes |
private SimpleString expiryAddressFromAddressSettings(MessageReference ref) { SimpleString messageAddress = extractAddress(ref.getMessage()); SimpleString expiryAddress = null; if (messageAddress != null) { AddressSettings addressSettings = addressSettingsRepository.getMatch(messageAddress.toString()); expiryAddress = addressSettings.getExpiryAddress(); } return expiryAddress; }
Example 3
Source File: QueueImpl.java From activemq-artemis with Apache License 2.0 | 5 votes |
private void createExpiryResources() throws Exception { AddressSettings addressSettings = server.getAddressSettingsRepository().getMatch(getAddress().toString()); if (addressSettings.isAutoCreateExpiryResources() && !getAddress().equals(addressSettings.getExpiryAddress())) { if (addressSettings.getExpiryAddress() != null && addressSettings.getExpiryAddress().length() != 0) { SimpleString expiryQueueName = addressSettings.getExpiryQueuePrefix().concat(getAddress()).concat(addressSettings.getExpiryQueueSuffix()); SimpleString expiryFilter = new SimpleString(String.format("%s = '%s'", Message.HDR_ORIGINAL_ADDRESS, getAddress())); server.createQueue(new QueueConfiguration(expiryQueueName).setAddress(addressSettings.getExpiryAddress()).setFilterString(expiryFilter).setAutoCreated(true).setAutoCreateAddress(true), true); } } }
Example 4
Source File: QueueImpl.java From activemq-artemis with Apache License 2.0 | 5 votes |
private void checkDeadLetterAddressAndExpiryAddress(final AddressSettings settings) { if (!Env.isTestEnv() && !internalQueue && !address.equals(server.getConfiguration().getManagementNotificationAddress())) { if (settings.getDeadLetterAddress() == null) { ActiveMQServerLogger.LOGGER.AddressSettingsNoDLA(name); } if (settings.getExpiryAddress() == null) { ActiveMQServerLogger.LOGGER.AddressSettingsNoExpiryAddress(name); } } }
Example 5
Source File: ActiveMQServerControlImpl.java From activemq-artemis with Apache License 2.0 | 4 votes |
@Override public String getAddressSettingsAsJSON(final String address) throws Exception { if (AuditLogger.isEnabled()) { AuditLogger.getAddressSettingsAsJSON(this.server, address); } checkStarted(); AddressSettings addressSettings = server.getAddressSettingsRepository().getMatch(address); String policy = addressSettings.getAddressFullMessagePolicy() == AddressFullMessagePolicy.PAGE ? "PAGE" : addressSettings.getAddressFullMessagePolicy() == AddressFullMessagePolicy.BLOCK ? "BLOCK" : addressSettings.getAddressFullMessagePolicy() == AddressFullMessagePolicy.DROP ? "DROP" : "FAIL"; String consumerPolicy = addressSettings.getSlowConsumerPolicy() == SlowConsumerPolicy.NOTIFY ? "NOTIFY" : "KILL"; JsonObjectBuilder settings = JsonLoader.createObjectBuilder(); if (addressSettings.getDeadLetterAddress() != null) { settings.add("DLA", addressSettings.getDeadLetterAddress().toString()); } if (addressSettings.getExpiryAddress() != null) { settings.add("expiryAddress", addressSettings.getExpiryAddress().toString()); } return settings.add("expiryDelay", addressSettings.getExpiryDelay()) .add("minExpiryDelay", addressSettings.getMinExpiryDelay()) .add("maxExpiryDelay", addressSettings.getMaxExpiryDelay()) .add("maxDeliveryAttempts", addressSettings.getMaxDeliveryAttempts()) .add("pageCacheMaxSize", addressSettings.getPageCacheMaxSize()) .add("maxSizeBytes", addressSettings.getMaxSizeBytes()) .add("pageSizeBytes", addressSettings.getPageSizeBytes()) .add("redeliveryDelay", addressSettings.getRedeliveryDelay()) .add("redeliveryMultiplier", addressSettings.getRedeliveryMultiplier()) .add("maxRedeliveryDelay", addressSettings.getMaxRedeliveryDelay()) .add("redistributionDelay", addressSettings.getRedistributionDelay()) .add("lastValueQueue", addressSettings.isDefaultLastValueQueue()) .add("sendToDLAOnNoRoute", addressSettings.isSendToDLAOnNoRoute()) .add("addressFullMessagePolicy", policy) .add("slowConsumerThreshold", addressSettings.getSlowConsumerThreshold()) .add("slowConsumerCheckPeriod", addressSettings.getSlowConsumerCheckPeriod()) .add("slowConsumerPolicy", consumerPolicy) .add("autoCreateJmsQueues", addressSettings.isAutoCreateJmsQueues()) .add("autoDeleteJmsQueues", addressSettings.isAutoDeleteJmsQueues()) .add("autoCreateJmsTopics", addressSettings.isAutoCreateJmsTopics()) .add("autoDeleteJmsTopics", addressSettings.isAutoDeleteJmsTopics()) .add("autoCreateQueues", addressSettings.isAutoCreateQueues()) .add("autoDeleteQueues", addressSettings.isAutoDeleteQueues()) .add("autoCreateAddresses", addressSettings.isAutoCreateAddresses()) .add("autoDeleteAddresses", addressSettings.isAutoDeleteAddresses()) .add("configDeleteQueues", addressSettings.getConfigDeleteQueues().toString()) .add("configDeleteAddresses", addressSettings.getConfigDeleteAddresses().toString()) .add("maxSizeBytesRejectThreshold", addressSettings.getMaxSizeBytesRejectThreshold()) .add("defaultLastValueKey", addressSettings.getDefaultLastValueKey() == null ? "" : addressSettings.getDefaultLastValueKey().toString()) .add("defaultNonDestructive", addressSettings.isDefaultNonDestructive()) .add("defaultExclusiveQueue", addressSettings.isDefaultExclusiveQueue()) .add("defaultGroupRebalance", addressSettings.isDefaultGroupRebalance()) .add("defaultGroupBuckets", addressSettings.getDefaultGroupBuckets()) .add("defaultGroupFirstKey", addressSettings.getDefaultGroupFirstKey() == null ? "" : addressSettings.getDefaultGroupFirstKey().toString()) .add("defaultMaxConsumers", addressSettings.getDefaultMaxConsumers()) .add("defaultPurgeOnNoConsumers", addressSettings.isDefaultPurgeOnNoConsumers()) .add("defaultConsumersBeforeDispatch", addressSettings.getDefaultConsumersBeforeDispatch()) .add("defaultDelayBeforeDispatch", addressSettings.getDefaultDelayBeforeDispatch()) .add("defaultQueueRoutingType", addressSettings.getDefaultQueueRoutingType().toString()) .add("defaultAddressRoutingType", addressSettings.getDefaultAddressRoutingType().toString()) .add("defaultConsumerWindowSize", addressSettings.getDefaultConsumerWindowSize()) .add("defaultRingSize", addressSettings.getDefaultRingSize()) .add("autoDeleteCreatedQueues", addressSettings.isAutoDeleteCreatedQueues()) .add("autoDeleteQueuesDelay", addressSettings.getAutoDeleteQueuesDelay()) .add("autoDeleteQueuesMessageCount", addressSettings.getAutoDeleteQueuesMessageCount()) .add("autoDeleteAddressesDelay", addressSettings.getAutoDeleteAddressesDelay()) .add("redeliveryCollisionAvoidanceFactor", addressSettings.getRedeliveryCollisionAvoidanceFactor()) .add("retroactiveMessageCount", addressSettings.getRetroactiveMessageCount()) .add("autoCreateDeadLetterResources", addressSettings.isAutoCreateDeadLetterResources()) .add("deadLetterQueuePrefix", addressSettings.getDeadLetterQueuePrefix().toString()) .add("deadLetterQueueSuffix", addressSettings.getDeadLetterQueueSuffix().toString()) .add("autoCreateExpiryResources", addressSettings.isAutoCreateExpiryResources()) .add("expiryQueuePrefix", addressSettings.getExpiryQueuePrefix().toString()) .add("expiryQueueSuffix", addressSettings.getExpiryQueueSuffix().toString()) .add("enableMetrics", addressSettings.isEnableMetrics()) .build() .toString(); }
Example 6
Source File: QueueImpl.java From activemq-artemis with Apache License 2.0 | 4 votes |
private void configureExpiry(final AddressSettings settings) { this.expiryAddress = settings == null ? null : settings.getExpiryAddress(); }