private void clearFailedNotification(final NotificationEventModelDao cleared) { NotificationEventModelDao processedEntry = new NotificationEventModelDao(cleared, Hostname.get(), clock.getUTCNow(), PersistentQueueEntryLifecycleState.FAILED); dao.moveEntryToHistory(processedEntry); }
private void clearNotification(final NotificationEventModelDao cleared) { NotificationEventModelDao processedEntry = new NotificationEventModelDao(cleared, Hostname.get(), clock.getUTCNow(), PersistentQueueEntryLifecycleState.PROCESSED); dao.moveEntryToHistory(processedEntry); }
@Override public void run() { do { List<BusEventModelDao> entries = queue.getReadyEntries(); if (entries.size() == 0) { try { //log.info("Reader " + readerId + " sleeping for 10 ms got " + consumed.get()); Thread.sleep(10); } catch (InterruptedException e) { } } else { for (BusEventModelDao cur : entries) { search1.add(cur.getSearchKey1()); final BusEventModelDao history = new BusEventModelDao(cur, OWNER, clock.getUTCNow(), PersistentQueueEntryLifecycleState.PROCESSED); queue.moveEntryToHistory(history); } consumed.getAndAdd(entries.size()); } } while (consumed.get() < maxEntries); }
@Override public void removeNotification(final Long recordId) { final NotificationEventModelDao existing = dao.getSqlDao().getByRecordId(recordId, config.getTableName()); final NotificationEventModelDao removedEntry = new NotificationEventModelDao(existing, Hostname.get(), clock.getUTCNow(), PersistentQueueEntryLifecycleState.REMOVED); dao.moveEntryToHistory(removedEntry); }
if (lastException == null) { BusEventModelDao processedEntry = new BusEventModelDao(cur, Hostname.get(), clock.getUTCNow(), PersistentQueueEntryLifecycleState.PROCESSED); dao.moveEntryToHistory(processedEntry); } else if (errorCount <= config.getMaxFailureRetries()) { log.info("Bus dispatch error, will attempt a retry ", lastException); log.error("Fatal Bus dispatch error, data corruption...", lastException); BusEventModelDao processedEntry = new BusEventModelDao(cur, Hostname.get(), clock.getUTCNow(), PersistentQueueEntryLifecycleState.FAILED); dao.moveEntryToHistory(processedEntry);
queue.moveEntryToHistory(historyInput);
queue.moveEntryToHistory(historyInput);
queue.moveEntryToHistory(historyInput); queue.moveEntryToHistory(historyInput);
queue.moveEntryToHistory(historyInput);