@Override public ArtemisExecutor getExecutor() { if (pageSubscription != null && pageSubscription.isPaging()) { // When in page mode, we don't want to have concurrent IO on the same PageStore return pageSubscription.getExecutor(); } else { return executor; } }
@Override public void forceDelivery() { if (pageSubscription != null && pageSubscription.isPaging()) { if (logger.isTraceEnabled()) { logger.trace("Force delivery scheduling depage"); } scheduleDepage(false); } if (logger.isTraceEnabled()) { logger.trace("Force delivery delivering async"); } deliverAsync(); }
private void checkDepage() { if (pageIterator != null && pageSubscription.isPaging() && !depagePending && needsDepage() && pageIterator.hasNext()) { scheduleDepage(false); } }
if (deliveriesInTransit.getCount() == 0 && getExecutor().isFlushed() && intermediateMessageReferences.isEmpty() && messageReferences.isEmpty() && !pageIterator.hasNext() && !pageSubscription.isPaging()) {
@Test public void testExpireMessage() throws Exception { locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setReconnectAttempts(15); ClientSessionFactoryInternal sf = createSessionFactoryAndWaitForTopology(locator, 2); session = sf.createSession(true, true, 0); session.createQueue(PagingFailoverTest.ADDRESS, PagingFailoverTest.ADDRESS, true); ClientProducer prod = session.createProducer(PagingFailoverTest.ADDRESS); final int TOTAL_MESSAGES = 1000; for (int i = 0; i < TOTAL_MESSAGES; i++) { ClientMessage msg = session.createMessage(true); msg.putIntProperty(new SimpleString("key"), i); msg.setExpiration(System.currentTimeMillis() + 1000); prod.send(msg); } crash(session); session.close(); Queue queue = backupServer.getServer().locateQueue(ADDRESS); long timeout = System.currentTimeMillis() + 60000; while (timeout > System.currentTimeMillis() && queue.getPageSubscription().isPaging()) { Thread.sleep(100); // Simulating what would happen on expire queue.expireReferences(); } Assert.assertFalse(queue.getPageSubscription().isPaging()); }
Assert.assertTrue(purgeQueue.getPageSubscription().isPaging()); producer.send(session.createTextMessage("hello" + i)); if (i % 2 == 0) {
assertTrue(queue0.getPageSubscription().isPaging());