use of org.mule.runtime.core.api.util.queue.DefaultQueueConfiguration in project mule by mulesoft.
the class LocalTxQueueTransactionRecovererTestCase method offerAndFailThenRecover.
@Test
public void offerAndFailThenRecover() throws Exception {
final DefaultQueueStore outQueue = new DefaultQueueStore(QUEUE_NAME, muleContext, new DefaultQueueConfiguration(0, true));
persistentTransactionContext = new PersistentQueueTransactionContext(txLog, createQueueProvider(outQueue));
persistentTransactionContext.offer(outQueue, testEvent(), TIMEOUT);
assertThat(outQueue.poll(TIMEOUT), nullValue());
txLog.close();
txLog = new LocalTxQueueTransactionJournal(temporaryFolder.getRoot().getAbsolutePath(), muleContext);
queueTransactionRecoverer = new LocalTxQueueTransactionRecoverer(txLog, createQueueProvider(outQueue));
queueTransactionRecoverer.recover();
Serializable muleEvent = outQueue.poll(TIMEOUT);
assertThat(muleEvent, nullValue());
}
use of org.mule.runtime.core.api.util.queue.DefaultQueueConfiguration in project mule by mulesoft.
the class NoPersistenceTestCase method createQueueManager.
@Override
protected TransactionalQueueManager createQueueManager() throws Exception {
TransactionalQueueManager mgr = new TransactionalQueueManager();
mgr.setMuleContext(muleContext);
mgr.initialise();
mgr.setDefaultQueueConfiguration(new DefaultQueueConfiguration(0, false));
return mgr;
}
use of org.mule.runtime.core.api.util.queue.DefaultQueueConfiguration in project mule by mulesoft.
the class TransactionalQueueManagerTestCase method allowChangingConfigurationOnDisposedQueue.
@Test
public void allowChangingConfigurationOnDisposedQueue() throws Exception {
QueueManager queueManager = muleContext.getQueueManager();
queueManager.setQueueConfiguration(TEST_QUEUE_NAME, new DefaultQueueConfiguration(0, true));
QueueSession queueSession = queueManager.getQueueSession();
Queue queue = queueSession.getQueue(TEST_QUEUE_NAME);
queue.dispose();
queueManager.setQueueConfiguration(TEST_QUEUE_NAME, new DefaultQueueConfiguration(0, false));
}
use of org.mule.runtime.core.api.util.queue.DefaultQueueConfiguration in project mule by mulesoft.
the class TransactionalQueueManagerTestCase method createDanglingTx.
private void createDanglingTx() throws InterruptedException, MuleException {
QueueManager queueManager = muleContext.getQueueManager();
queueManager.setDefaultQueueConfiguration(new DefaultQueueConfiguration(0, true));
QueueSession queueSession = queueManager.getQueueSession();
queueSession.getQueue(TEST_QUEUE_NAME).put("value");
queueSession.begin();
queueSession.getQueue(TEST_QUEUE_NAME).poll(10);
queueManager.stop();
}
use of org.mule.runtime.core.api.util.queue.DefaultQueueConfiguration in project mule by mulesoft.
the class TransactionalQueueManagerTestCase method clearRecoveryQueuesAfterRecovery.
@Test
public void clearRecoveryQueuesAfterRecovery() throws Exception {
createDanglingTx();
QueueManager queueManager = muleContext.getQueueManager();
QueueSession queueSession = queueManager.getQueueSession();
queueSession.getQueue(TEST_QUEUE_NAME).dispose();
queueManager.setQueueConfiguration(TEST_QUEUE_NAME, new DefaultQueueConfiguration());
queueManager.start();
}
Aggregations