/** * Checks if current message wasn't converted to other state. * It can happen when message is long time in queue that repairing process converts message back * to PARTLY_FAILED state and evenly message can start with duplicate processing. * * @param msg the message * @return {@code true} when message is in wrong state {@code false} otherwise */ @Handler public boolean isMessageObsolete(@Body Message msg) { Assert.notNull(msg, "the msg must not be null"); MessageService messageService = getBean(MessageService.class); return !messageService.setStateProcessingForLock(msg); }