@Test public void testRepairProcessingMessagesOne() throws Exception { Message message = createAndSaveMessages(1, MsgStateEnum.PROCESSING)[0]; messageService.repairProcessingMessages(); Message found = messageDao.findMessage(message.getMsgId()); assertThat(found, notNullValue()); assertThat(found.getState(), is(MsgStateEnum.PARTLY_FAILED)); }
@Override public void repairProcessingMessages() { List<Message> messages = findProcessingMessages(); Log.debug("Found {} message(s) for repairing ...", messages.size()); int batchStartIncl = 0; int batchEndExcl; while (batchStartIncl < messages.size()) { batchEndExcl = min(batchStartIncl + BATCH_SIZE, messages.size()); updateMessagesInDB(messages.subList(batchStartIncl, batchEndExcl)); batchStartIncl = batchEndExcl; } }
RepairMessageServiceDbImpl implements RepairMessageService { @Override public void repairProcessingMessages() { List<Message> messages = findProcessingMessages(); Log.debug("Found {} message(s) for repairing ...", messages.size()); int batchStartIncl = 0; int batchEndExcl; while (batchStartIncl < messages.size()) { batchEndExcl = min(batchStartIncl + BATCH_SIZE, messages.size()); updateMessagesInDB(messages.subList(batchStartIncl, batchEndExcl)); batchStartIncl = batchEndExcl; } } }
RepairMessageServiceDbImpl implements RepairMessageService { @Override public void repairProcessingMessages() { List<Message> messages = findProcessingMessages(); Log.debug("Found {} message(s) for repairing ...", messages.size()); int batchStartIncl = 0; int batchEndExcl; while (batchStartIncl < messages.size()) { batchEndExcl = min(batchStartIncl + BATCH_SIZE, messages.size()); updateMessagesInDB(messages.subList(batchStartIncl, batchEndExcl)); batchStartIncl = batchEndExcl; } }  }
RepairMessageServiceDbImpl implements RepairMessageService { @Override public void repairProcessingMessages() { List<Message> messages = findProcessingMessages(); Log.debug("Found {} message(s) for repairing ...", messages.size()); int batchStartIncl = 0; int batchEndExcl; while (batchStartIncl < messages.size()) { batchEndExcl = min(batchStartIncl + BATCH_SIZE, messages.size()); updateMessagesInDB(messages.subList(batchStartIncl, batchEndExcl)); batchStartIncl = batchEndExcl; } }  @Override void repairProcessingMessages(); @Required void setTransactionManager(JpaTransactionManager transactionManager); }
RepairMessageServiceDbImpl implements RepairMessageService { @Override public void repairProcessingMessages() { List<Message> messages = findProcessingMessages(); Log.debug("Found {} message(s) for repairing ...", messages.size()); int batchStartIncl = 0; int batchEndExcl; while (batchStartIncl < messages.size()) { batchEndExcl = min(batchStartIncl + BATCH_SIZE, messages.size()); updateMessagesInDB(messages.subList(batchStartIncl, batchEndExcl)); batchStartIncl = batchEndExcl; } }  @Override void repairProcessingMessages(); @Required void setTransactionManager(JpaTransactionManager transactionManager);  }