use of org.apache.activemq.broker.region.policy.FilePendingQueueMessageStoragePolicy in project activemq-artemis by apache.
the class RecoverExpiredMessagesTest method initCombosForTestRecovery.
public void initCombosForTestRecovery() throws Exception {
addCombinationValues("queuePendingPolicy", new PendingQueueMessageStoragePolicy[] { new FilePendingQueueMessageStoragePolicy(), new VMPendingQueueMessageStoragePolicy() });
PersistenceAdapter[] persistenceAdapters = new PersistenceAdapter[] { new KahaDBPersistenceAdapter(), new JDBCPersistenceAdapter(DataSourceServiceSupport.createDataSource(IOHelper.getDefaultDataDirectory()), new OpenWireFormat()) };
for (PersistenceAdapter adapter : persistenceAdapters) {
adapter.setDirectory(new File(IOHelper.getDefaultDataDirectory()));
}
addCombinationValues("persistenceAdapter", persistenceAdapters);
}
use of org.apache.activemq.broker.region.policy.FilePendingQueueMessageStoragePolicy in project activemq-artemis by apache.
the class UnlimitedEnqueueTest method createBrokerService.
@Before
public void createBrokerService() throws Exception {
brokerService = new BrokerService();
brokerService.setDeleteAllMessagesOnStartup(true);
brokerService.setAdvisorySupport(false);
// optional, reduce the usage limit so that spooling will occur faster
brokerService.getSystemUsage().getMemoryUsage().setLimit(10 * 1024 * 1024);
brokerService.getSystemUsage().getTempUsage().setLimit((numMessages * payLoadSize) + (1000 * payLoadSize));
PolicyMap policyMap = new PolicyMap();
List<PolicyEntry> entries = new ArrayList<>();
PolicyEntry policy = new PolicyEntry();
// NB: ensure queue cursor limit is below the default 70% usage that the destination will use
// if they are the same, the queue memory limit and flow control will kick in first
policy.setCursorMemoryHighWaterMark(20);
// on by default
// policy.setProducerFlowControl(true);
policy.setQueue(">");
// policy that will spool references to disk
policy.setPendingQueuePolicy(new FilePendingQueueMessageStoragePolicy());
entries.add(policy);
policyMap.setPolicyEntries(entries);
brokerService.setDestinationPolicy(policyMap);
brokerService.start();
}
use of org.apache.activemq.broker.region.policy.FilePendingQueueMessageStoragePolicy in project activemq-artemis by apache.
the class ExpiredMessagesWithNoConsumerTest method initCombosForTestExpiredMessagesWithNoConsumer.
public void initCombosForTestExpiredMessagesWithNoConsumer() {
addCombinationValues("optimizedDispatch", new Object[] { Boolean.TRUE, Boolean.FALSE });
addCombinationValues("pendingQueuePolicy", new Object[] { null, new VMPendingQueueMessageStoragePolicy(), new FilePendingQueueMessageStoragePolicy() });
}
use of org.apache.activemq.broker.region.policy.FilePendingQueueMessageStoragePolicy in project activemq-artemis by apache.
the class QueuePurgeTest method applyBrokerSpoolingPolicy.
private void applyBrokerSpoolingPolicy() {
PolicyMap policyMap = new PolicyMap();
PolicyEntry defaultEntry = new PolicyEntry();
defaultEntry.setProducerFlowControl(false);
PendingQueueMessageStoragePolicy pendingQueuePolicy = new FilePendingQueueMessageStoragePolicy();
defaultEntry.setPendingQueuePolicy(pendingQueuePolicy);
policyMap.setDefaultEntry(defaultEntry);
broker.setDestinationPolicy(policyMap);
}
Aggregations