This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| #------------------------------------------------------------------------------ | |
| # script_template - Briefly describe script purpose | |
| # | |
| # {Date}, Your name <your.email@example.com> | |
| # | |
| # Copyright (c) 2023, 2024 by {Company}, Inc. | |
| # All rights reserved. | |
| #------------------------------------------------------------------------------ | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Details: https://medium.com/@egorponomarev/outbox-pattern-in-spring-boot-8e8cf116f044 | |
| // ATTENTION: Order of messages is not preserved! | |
| @Service | |
| public record OrderService( | |
| IDeliveryMessageQueueService deliveryMessageQueueService, | |
| IOrderRepository orderRepository, | |
| IOutboxRepository outboxRepository, | |
| TransactionTemplate transactionTemplate) implements IOrderService { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| docker run -it --rm --name country-maven-project -v "$PWD":/usr/src/app -v "$HOME"/.m2:/root/.m2 -w /usr/src/app maven:3-eclipse-temurin-17 mvn clean package -DskipTests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class RetryProcessor { | |
| private final long schedulerIntervalMs = 60000; | |
| private final String entityStoreName = "failed-message-store"; | |
| private KeyValueStore<String, Object> entityStore; | |
| @Override | |
| public void init(final ProcessorContext context) { | |
| this.entityStore = (KeyValueStore) context().getStateStore(entityStoreName); | |
| context().schedule(Duration.ofMillis(this.schedulerIntervalMs), PunctuationType.WALL_CLOCK_TIME, |