Skip to content

Commit

Permalink
Merge pull request #32 from cloudcreate-dk/release_0_40_20
Browse files Browse the repository at this point in the history
Release 0.40.20
  • Loading branch information
cloudcreate-dk authored Jan 23, 2025
2 parents 449b99a + 08f4de2 commit 59e6fa1
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 23 deletions.
4 changes: 2 additions & 2 deletions mongodb-inbox-outbox/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The last command will block the current terminal, so to continue you need to ope
#### Initiate the test scenario:
In a new Terminal enter the following command:
```bash
curl -L 'http://localhost:8080/shipping/register-order' \
curl -L 'http://localhost:8080/shipping/register-order' \
-X POST \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
Expand All @@ -38,7 +38,7 @@ curl -L 'http://localhost:8080/shipping/register-order' \
#### Complete the test scenario:
In the same Terminal enter the following command:
```bash
curl -L 'http://localhost:8080/shipping/ship-order' \
curl -L 'http://localhost:8080/shipping/ship-order' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
Expand Down
28 changes: 14 additions & 14 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,32 +61,32 @@
<skipDependencyCheck>false</skipDependencyCheck>

<!--Essentials versions-->
<essentials.version>0.40.19</essentials.version>
<essentials.version>0.40.20</essentials.version>

<spring-boot.version>3.2.12</spring-boot.version>
<spring-framework-bom.version>6.1.15</spring-framework-bom.version>
<reactor-bom.version>2023.0.12</reactor-bom.version>
<spring-framework-bom.version>6.1.16</spring-framework-bom.version>
<reactor-bom.version>2023.0.14</reactor-bom.version>
<spring-data-mongodb.version>4.2.12</spring-data-mongodb.version>
<spring-data-jpa.version>3.2.12</spring-data-jpa.version>
<objenesis.version>3.4</objenesis.version>
<postgresql.version>42.7.4</postgresql.version>
<postgresql.version>42.7.5</postgresql.version>
<slf4j.version>2.0.16</slf4j.version>
<awaitility.version>4.2.2</awaitility.version>
<assertj.version>3.26.3</assertj.version>
<assertj.version>3.27.3</assertj.version>
<mongodb-driver-sync.version>4.11.5</mongodb-driver-sync.version>
<log4j-to-slf4j.version>2.24.2</log4j-to-slf4j.version>
<log4j-to-slf4j.version>2.24.3</log4j-to-slf4j.version>
<json-smart.version>2.5.1</json-smart.version>
<json-path.version>2.9.0</json-path.version>
<snakeyaml.version>2.3</snakeyaml.version>
<micrometer.version>1.12.13</micrometer.version>
<micrometer-tracing.version>1.2.12</micrometer-tracing.version>
<netty-bom.version>4.1.115.Final</netty-bom.version>
<junit-bom.version>5.11.3</junit-bom.version>
<netty-bom.version>4.1.117.Final</netty-bom.version>
<junit-bom.version>5.11.4</junit-bom.version>
<testcontainers-bom.version>1.20.4</testcontainers-bom.version>
<jdbi3-bom.version>3.47.0</jdbi3-bom.version>
<jackson-bom.version>2.17.3</jackson-bom.version>
<mockito-bom.version>5.14.2</mockito-bom.version>
<logback.version>1.5.12</logback.version>
<mockito-bom.version>5.15.2</mockito-bom.version>
<logback.version>1.5.16</logback.version>
<avro.version>1.12.0</avro.version>
<commons-compress.version>1.27.1</commons-compress.version>
<xmlunit-core.version>2.10.0</xmlunit-core.version>
Expand All @@ -101,22 +101,22 @@

<!-- Maven plugin versions -->
<maven-dependency-plugin.version>3.8.1</maven-dependency-plugin.version>
<maven-project-info-reports-plugin.version>3.7.0</maven-project-info-reports-plugin.version>
<maven-project-info-reports-plugin.version>3.8.0</maven-project-info-reports-plugin.version>
<maven-clean-plugin.version>3.4.0</maven-clean-plugin.version>
<maven-install-plugin.version>3.1.3</maven-install-plugin.version>
<maven-resources-plugin.version>3.3.1</maven-resources-plugin.version>
<maven-deploy-plugin.version>3.1.3</maven-deploy-plugin.version>
<maven-site-plugin.version>3.20.0</maven-site-plugin.version>
<maven-site-plugin.version>3.21.0</maven-site-plugin.version>
<maven-jar-plugin.version>3.4.2</maven-jar-plugin.version>
<maven-source-plugin.version>3.3.1</maven-source-plugin.version>
<maven-javadoc-plugin.version>3.10.1</maven-javadoc-plugin.version>
<maven-javadoc-plugin.version>3.11.2</maven-javadoc-plugin.version>
<maven-failsafe-plugin.version>3.5.2</maven-failsafe-plugin.version>
<maven-surefire-plugin.version>3.5.2</maven-surefire-plugin.version>
<maven-compiler-plugin.version>3.13.0</maven-compiler-plugin.version>
<versions-maven-plugin.version>2.18.0</versions-maven-plugin.version>
<maven-enforcer-plugin.version>3.5.0</maven-enforcer-plugin.version>
<minimum-maven-version>3.8.8</minimum-maven-version>
<dependency-check-maven.version>11.1.0</dependency-check-maven.version>
<dependency-check-maven.version>12.0.1</dependency-check-maven.version>
<flatten-maven-plugin.version>1.6.0</flatten-maven-plugin.version>
<nexus-staging-maven-plugin.version>1.6.13</nexus-staging-maven-plugin.version>
<maven-gpg-plugin.version>3.2.7</maven-gpg-plugin.version>
Expand Down
4 changes: 2 additions & 2 deletions postgresql-cqrs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ The last command will block the current terminal, so to continue you need to ope
#### Initiate the test scenario:
In a new Terminal enter the following command:
```bash
curl -L 'http://localhost:8080/shipping/register-order' \
curl -L 'http://localhost:8080/shipping/register-order' \
-X POST \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
Expand All @@ -56,7 +56,7 @@ curl -L 'http://localhost:8080/shipping/register-order' \
#### Complete the test scenario:
In the same Terminal enter the following command:
```bash
curl -L 'http://localhost:8080/shipping/ship-order' \
curl -L 'http://localhost:8080/shipping/ship-order' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,18 @@

import dk.cloudcreate.essentials.components.eventsourced.eventstore.postgresql.eventstream.AggregateType;
import dk.cloudcreate.essentials.components.eventsourced.eventstore.postgresql.processor.*;
import dk.cloudcreate.essentials.components.foundation.messaging.MessageHandler;
import dk.cloudcreate.essentials.components.foundation.messaging.*;
import dk.cloudcreate.essentials.components.foundation.messaging.queue.OrderedMessage;
import dk.cloudcreate.essentials.spring.examples.postgresql.cqrs.shipping.domain.ShippingOrders;
import dk.cloudcreate.essentials.spring.examples.postgresql.cqrs.shipping.domain.events.OrderShipped;
import jakarta.validation.ConstraintViolationException;
import lombok.NonNull;
import lombok.extern.slf4j.Slf4j;
import org.apache.kafka.clients.producer.ProducerRecord;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.stereotype.Service;

import java.time.Duration;
import java.util.List;

@Service
Expand All @@ -53,6 +55,19 @@ protected List<AggregateType> reactsToEventsRelatedToAggregateTypes() {
return List.of(ShippingOrders.AGGREGATE_TYPE);
}

@Override
protected RedeliveryPolicy getInboxRedeliveryPolicy() {
// Example of a custom inbox redelivery policy which doesn't perform retries in case message handling experiences a ConstraintViolationException
return RedeliveryPolicy.exponentialBackoff()
.setInitialRedeliveryDelay(Duration.ofMillis(200))
.setFollowupRedeliveryDelay(Duration.ofMillis(200))
.setFollowupRedeliveryDelayMultiplier(1.1d)
.setMaximumFollowupRedeliveryDelayThreshold(Duration.ofSeconds(3))
.setMaximumNumberOfRedeliveries(20)
.setDeliveryErrorHandler(MessageDeliveryErrorHandler.stopRedeliveryOn(ConstraintViolationException.class))
.build();
}

@MessageHandler
void handle(OrderShipped e, OrderedMessage eventMessage) {
log.info("*** Received {} for Order '{}' and adding it to the Outbox as a {} message", e.getClass().getSimpleName(), e.orderId, ExternalOrderShipped.class.getSimpleName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ protected void collectPersistedEvents() {
@Test
public void create_task_and_comment_in_same_unit_of_work() {
collectPersistedEvents();
Awaitility.waitAtMost(Duration.ofMillis(300)).until(() -> eventProcessor.isActive());
Awaitility.waitAtMost(Duration.ofMillis(500)).until(() -> eventProcessor.isActive());

TaskId taskId = TaskId.random();
String comment = "This is a good comment!";
Expand Down
4 changes: 2 additions & 2 deletions postgresql-inbox-outbox/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The last command will block the current terminal, so to continue you need to ope
#### Initiate the test scenario:
In a new Terminal enter the following command:
```bash
curl -L 'http://localhost:8080/shipping/register-order' \
curl -L 'http://localhost:8080/shipping/register-order' \
-X POST \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
Expand All @@ -38,7 +38,7 @@ curl -L 'http://localhost:8080/shipping/register-order' \
#### Complete the test scenario:
In the same Terminal enter the following command:
```bash
curl -L 'http://localhost:8080/shipping/ship-order' \
curl -L 'http://localhost:8080/shipping/ship-order' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ void queue_a_large_number_of_messages() {
.setQueueMessageHandler(msgHandler)
.build());

var count = 20000;
var count = 10000;
var stopwatch = StopWatch.start();
unitOfWorkFactory.usingUnitOfWork(uow -> {
IntStream.range(0, count).forEach(i -> {
Expand Down

0 comments on commit 59e6fa1

Please sign in to comment.