FINERACT-2246: New command processing - document management
This commit is contained in:
committed by
Aleksandar Vidakovic
parent
8a61e30a45
commit
2ff0c62f40
+18
-2
@@ -114,6 +114,7 @@ public class DefaultCommandAuditor implements CommandAuditor {
|
||||
final var now = Instant.now();
|
||||
final var commandEntity = mapper.map(command);
|
||||
|
||||
commandEntity.setExecutedAt(now);
|
||||
commandEntity.setUpdatedAt(now);
|
||||
commandEntity.setState(ERROR);
|
||||
|
||||
@@ -138,7 +139,17 @@ public class DefaultCommandAuditor implements CommandAuditor {
|
||||
|
||||
@Retry(name = "commandAuditFallback", fallbackMethod = "fatal")
|
||||
@SuppressWarnings("UnusedMethod")
|
||||
private void fallback(Command<?> command, Throwable t) throws Exception {
|
||||
void fallback(Command<?> command, Throwable t) throws Exception {
|
||||
if (Boolean.TRUE.equals(properties.getFileDeadLetterQueueEnabled())) {
|
||||
fallback(command, null, t);
|
||||
} else {
|
||||
fatal(command, t);
|
||||
}
|
||||
}
|
||||
|
||||
@Retry(name = "commandAuditFallback", fallbackMethod = "fatal")
|
||||
@SuppressWarnings("UnusedMethod")
|
||||
void fallback(Command<?> command, Object response, Throwable t) throws Exception {
|
||||
if (Boolean.TRUE.equals(properties.getFileDeadLetterQueueEnabled())) {
|
||||
setError(command, t);
|
||||
write(command);
|
||||
@@ -148,7 +159,12 @@ public class DefaultCommandAuditor implements CommandAuditor {
|
||||
}
|
||||
|
||||
@SuppressWarnings("UnusedMethod")
|
||||
private void fatal(Command<?> command, Throwable t) {
|
||||
void fatal(Command<?> command, Throwable t) {
|
||||
fatal(command, null, t);
|
||||
}
|
||||
|
||||
@SuppressWarnings("UnusedMethod")
|
||||
void fatal(Command<?> command, Object response, Throwable t) {
|
||||
// note: last line of defense; if this fails then all is lost
|
||||
setError(command, t);
|
||||
log.error("Command audit error: {}", command, t);
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ import org.springframework.data.jdbc.core.convert.JdbcCustomConversions;
|
||||
import org.springframework.data.jdbc.repository.config.EnableJdbcRepositories;
|
||||
|
||||
@Configuration
|
||||
@EnableJdbcRepositories(basePackages = { "org.apache.fineract.command.persistence" })
|
||||
@EnableJdbcRepositories(basePackages = { "org.apache.fineract.**.domain", "org.apache.fineract.**.persistence" })
|
||||
@ComponentScan("org.apache.fineract.command.persistence")
|
||||
class CommandPersistenceConfiguration {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user