Code Monkey home page Code Monkey logo

eventuate-tram-examples-customers-and-orders's Introduction

An Eventuate project

logo

This project is part of Eventuate, which is a microservices collaboration platform.

Eventuate Tram (Transactional Messaging) platform

Spring/Micronaut

eventuate tram bom

Quarkus

eventuate tram quarkus bom

Eventuate Tram is a platform that solves the distributed data management problems inherent in a microservice architecture.

It is described in more detail in my book Microservice Patterns and the getting started guide.

Key benefits of Eventuate Tram

Maintain data consistency using sagas

Implement commands that update data in multiple microservices by using Sagas, which are sequences of local transactions coordinated using messages

Implement queries using CQRS

Implement queries that retrieve data from multiple services by using CQRS views, which are easily queryable replicas maintained using events

Communicate using transactional messaging

Reliably send and receive messages and events as part of a database transaction by using the Transactional Outbox pattern

How it works

Eventuate Tram provides several messaging abstractions:

  • messaging - send and receive messages over named channels

  • events - publish domain events and subscribe to domain events

  • commands - asynchronously send a command to a service and receive a reply

Eventuate Tram messaging implements the Transactional Outbox pattern. An message producer inserts events into an OUTBOX table as part of the ACID transaction that updates data, such as JPA entities. A separate message relay (a.k.a. Eventuate CDC service) publishes messages to the message broker.

ReliablePublication

The Eventuate CDC service works in one of two ways:

Supported technologies

Languages:

Databases:

Message brokers:

  • Apache Kafka

  • ActiveMQ

  • RabbitMQ

  • Redis Streams

Getting started

Please see the getting started guide.

Example applications

There are numerous example applications:

Got questions?

Don’t hesitate to create an issue or see

Need support?

Take a look at the available paid support options.

Transactional messaging

Send a message using MessageProducer:

public interface MessageProducer {
  void send(String destination, Message message);
}

Receive messages using:

public interface MessageConsumer {
  void subscribe(String subscriberId, Set<String> channels, MessageHandler handler);
}

See this example of transactional messaging.

Transactional domain events

The domain event package builds on the core APIs.

Publish domain events using the DomainEventPublisher interface:

public interface DomainEventPublisher {

  void publish(String aggregateType, Object aggregateId, List<DomainEvent> domainEvents);
  ...

Subscribe to domain events using a DomainEventDispatcher:

public class DomainEventDispatcher {
    public DomainEventDispatcher(String eventDispatcherId,
                DomainEventHandlers eventHandlers,
                ...) {
...
}

Handle the events using DomainEventHandlers:

public class RestaurantOrderEventConsumer {

  public DomainEventHandlers domainEventHandlers() {
    return DomainEventHandlersBuilder
            .forAggregateType("net.chrisrichardson.ftgo.restaurantservice.Restaurant")
            .onEvent(RestaurantMenuRevised.class, this::reviseMenu)
            .build();
  }

  public void reviseMenu(DomainEventEnvelope<RestaurantMenuRevised> de) {

See this example of transaction events.

Transactional commands

Transaction commands are implemented using transactional messaging.

Send a command using a CommandProducer:

public interface CommandProducer {
  String send(String channel, Command command, String replyTo, Map<String, String> headers);
  ...
}

Subscribe to commands using a CommandDispatcher:

public class CommandDispatcher {

  public CommandDispatcher(String commandDispatcherId,
           CommandHandlers commandHandlers) {
  ...
}

Handle commands and send a reply using CommandHandlers:

public class OrderCommandHandlers {


  public CommandHandlers commandHandlers() {
    return CommandHandlersBuilder
          .fromChannel("orderService")
          .onMessage(ApproveOrderCommand.class, this::approveOrder)
          ...
          .build();
  }

  public Message approveOrder(CommandMessage<ApproveOrderCommand> cm) {
    ApproveOrderCommand command = cm.getCommand();
    ...
  }

See this example of transactional commands.

Maven/Gradle artifacts

The artifacts are in JCenter. The latest version is:

RC

download

Release

download

There are the following API artifacts:

  • io.eventuate.tram.core:eventuate-tram-messaging:$eventuateTramVersion - core messaging APIs

  • io.eventuate.tram.core:eventuate-tram-events:$eventuateTramVersion - domain event API

  • io.eventuate.tram.core:eventuate-tram-commands:$eventuateTramVersion - commands/reply API

There are the following 'implementation' artifacts:

  • io.eventuate.tram.core:eventuate-tram-jdbc-kafka:$eventuateTramVersion - JDBC database and Apache Kafka message broker

  • io.eventuate.tram.core:eventuate-tram-jdbc-activemq:$eventuateTramVersion - JDBC database and Apache ActiveMQ message broker

  • io.eventuate.tram.core:eventuate-tram-jdbc-rabbitmq:$eventuateTramVersion - JDBC database and RabbitMQ message broker

  • io.eventuate.tram.core:eventuate-tram-jdbc-redis:$eventuateTramVersion - JDBC database and Redis Streams

  • io.eventuate.tram.core:eventuate-tram-in-memory:$eventuateTramVersion - In-memory JDBC database and in-memory messaging for testing

Running the CDC service

In addition to a database and message broker, you will need to run the Eventuate Tram CDC service. It reads events inserted into the database and publishes them to the message broker. It is written using Spring Boot. The easiest way to run this service during development is to use Docker Compose. The Eventuate Tram Code Basic examples project has an example docker-compose.yml file.

Contributing

Contributions are welcome.

eventuate-tram-examples-customers-and-orders's People

Contributors

cer avatar dartartem avatar pranaysahith avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eventuate-tram-examples-customers-and-orders's Issues

docker-compose run executed by migration script files with the input device is not a TTY

curl -s https://raw.githubusercontent.com/eventuate-foundation/eventuate-common/master/migration/db-id/migration.sh &> /dev/stdout | bash

Now fails with the input device is not a TTY here

https://github.com/eventuate-foundation/eventuate-common/blob/950c6811ef19a9056efd24fd7ed3daf86f1bc1b1/migration/db-id/migration.sh#L57 :

  docker-compose -f ${migration_tool} run --no-deps mssql-migration

Build Failure - Exception in phase 'semantic analysis' in source unit ServicePlugin.groovy Unsupported class file major version 61

I am using IntelliJ. I tried both SDK corretto-1.8 and openjdk-17

I receive the following build failure:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':buildSrc:compileGroovy'.
> BUG! exception in phase 'semantic analysis' in source unit 'C:\GitHub\eventuate-tram\eventuate-tram-examples-customers-and-orders\buildSrc\src\main\groovy\ServicePlugin.groovy' Unsupported class file major version 61

How to retry consumption?

@Autowired
FeignClient client;

public Message consumption_must_success_eventually(CommandMessage<RemoteActionCommand> cm) {
    ....
    // it may throw an exception (like a momentary network glitch)
    client.invokeRpc();
    withSuccess();
}

Thanks!

How to replay all the events for certain service?

Let's say orderservice crashed and lost all the data (not in this example, since order and customer share same db here), how can we replay all the events and restore its latest state?

In io.eventuate.local.db.log.common.DbLogBasedCdcProcessor,

  public void start(Consumer<EVENT> eventConsumer) {
    Optional<BinlogFileOffset> startingBinlogFileOffset = offsetStore.getLastBinlogFileOffset();

    process(eventConsumer, startingBinlogFileOffset);
  }

The offsetStore always seeks to the latest offset even though its consumer starts at the earliest.

I guess we can either make it configurable or provide a different implementation of the CdcProcessor.

But the question is, while we replay all the events, the orderservice will emit new events as well, and those events are already published and stored in the event store. So, what do we do? publish them to a separated Topic? What's the recommended operation? Or, is it really practical?

Build 627 failed. Order state is pending instead of rejected

see: https://app.circleci.com/pipelines/github/eventuate-tram/eventuate-tram-examples-customers-and-orders/147/workflows/1cbcbce6-1360-4b23-8e08-f071ee5fccbf/jobs/627

Problem:
Eventuate cdc service caches primary keys:

https://github.com/eventuate-foundation/eventuate-cdc/blob/0ada218b4228f03bf9d967968dc178e16010cce6/eventuate-local-java-cdc-connector-polling/src/main/java/io/eventuate/local/polling/PollingDao.java#L34

https://github.com/eventuate-foundation/eventuate-cdc/blob/0ada218b4228f03bf9d967968dc178e16010cce6/eventuate-local-java-cdc-connector-polling/src/main/java/io/eventuate/local/polling/PollingDao.java#L203-L219

After db id migration primary key column is changed.
New message records after migration have empty old primary key.
When any new message processed, all new records marked as published,
because have empty old primary key (and cdc uses it when marks event published), so some messages were ignored by cdc.

Solution:
Restart cdc service after migration.

Debug and restore snapshot functionality

  • kafka-consumer-groups --bootstrap-server kafka:29092 --reset-offsets appears not to support setting offsets of individual partitions.
  • This testing should be moved back to view support

How to guarantee the order commands

In this project, I think that the CDC service and Kafka provided will not guarantee the order for commands with overlapping sequences due to the two Kafka partitions. Is there a way to ensure order?

Typo in SQL script?

Is this a typo (or just a confusing ordering, appearing just below the creation of the "entities" table, but adding an index to a different table)?

CREATE INDEX entities_idx ON events(entity_type, entity_id);

Order Service/Customer Service cannot connect to SQL server - The driver could not establish a secure connection to SQL Server

Unclear why this started to happen with 884c4ba:

Eventuate CDC connects without issue.

  2023-10-15 17:33:29.089  INFO [customer-service,,] 1 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
  2023-10-15 17:33:31.216 ERROR [customer-service,,] 1 --- [           main] com.zaxxer.hikari.pool.HikariPool        : HikariPool-1 - Exception during pool initialization.
  
  com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target". ClientConnectionId:f9546012-b5ed-4e53-801a-ba7b3449f429

Building/Rebuilding CQRS views

Building/Rebuilding CQRS views
Problem

Let’s imagine that the Eventuate Tram Customers and Orders project was running in production. You then wanted to add the Order History View - #1

You need to populate the order history views - Customer and Order MongoDB tables - with the existing data.
Assumptions
Let’s focus on Kafka for now
Solution

Note:
The goal is to build a framework that makes it easier to implement this behavior for any service/application
In the meantime, let’s just focus on the Eventuate Tram customer and orders application
Exporting data from a service

A service must expose an API for triggering the export behavior.

An export consists of an AggregateSnapshot event, which is an event containing a snapshot of the aggregate’s state.

A service (Order Service, Customer Service) exports its data as follows:
Lock table
This ensures that any domain events representing an update to an aggregate will follows the aggregate’s Order/CustomerSnapshotEvent
Publish StartOfSnapshots events to Order/Customer channel (topic) to indicate starting offset
Since the table is locked, the offset is the starting point for the consumer to read the Snapshot events.
Publish one StartOfSnapshots event to each partition in the topic using round robin with a null message key
Iterate through Orders/Customers and publish an (Customer/Order)Snapshot event for each one to the Order/Customer
The event containers the complete state of the Order/Customer
Perhaps one day use Spring batch
Unsure whether this is needed
Publish End Of Snapshots events to channel to indicate done
Unlock table
Importing data into a CQRS view service

The OrderHistoryService subscribes to (Customer/Order)Snapshot and updates the view appropriately.

One all of the services (Customer and Order) have published their StartOfSnapshots events and the Kafka consumer offsets are known:
Change the kafka consumer offsets for the OrderHistoryService’s subscription to the specified point offsets
Start the OrderHistoryService

Build failed because of mssql tests

See: https://app.circleci.com/pipelines/github/eventuate-tram/eventuate-tram-examples-customers-and-orders/140/workflows/814318e7-8113-4b07-9f4d-1aad7a436133/jobs/580

Error in logs:

org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [select top (?) * FROM eventuate.message WHERE published = 0 ORDER BY id ASC]; nested exception is com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'eventuate.message'.
	at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:234) ~[spring-jdbc-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]
	at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72) ~[spring-jdbc-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]
	at org.springframework.jdbc.core.JdbcTemplate.translateException(JdbcTemplate.java:1444) ~[spring-jdbc-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]
	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:632) ~[spring-jdbc-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]
	at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:669) ~[spring-jdbc-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]
	at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:694) ~[spring-jdbc-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]
	at org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.queryForRowSet(NamedParameterJdbcTemplate.java:307) ~[spring-jdbc-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]
	at org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.queryForRowSet(NamedParameterJdbcTemplate.java:315) ~[spring-jdbc-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]
	at io.eventuate.local.polling.PollingDao.lambda$processEvents$1(PollingDao.java:124) [eventuate-local-java-cdc-connector-polling-0.10.0.DB_ID_GEN.BUILD-SNAPSHOT.jar!/:na]
	at io.eventuate.local.common.DaoUtils.handleConnectionLost(DaoUtils.java:22) ~[eventuate-local-java-cdc-connector-common-0.10.0.DB_ID_GEN.BUILD-SNAPSHOT.jar!/:na]
	at io.eventuate.local.polling.PollingDao.processEvents(PollingDao.java:122) [eventuate-local-java-cdc-connector-polling-0.10.0.DB_ID_GEN.BUILD-SNAPSHOT.jar!/:na]
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[na:1.8.0_252]
	at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948) ~[na:1.8.0_252]
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) ~[na:1.8.0_252]
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) ~[na:1.8.0_252]
	at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) ~[na:1.8.0_252]
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:1.8.0_252]
	at java.util.stream.ReferencePipeline.reduce(ReferencePipeline.java:541) ~[na:1.8.0_252]
	at io.eventuate.local.polling.PollingDao.start(PollingDao.java:97) [eventuate-local-java-cdc-connector-polling-0.10.0.DB_ID_GEN.BUILD-SNAPSHOT.jar!/:na]
	at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_252]
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'eventuate.message'.
	at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:256) ~[mssql-jdbc-7.2.1.jre8.jar!/:na]
	at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1621) ~[mssql-jdbc-7.2.1.jre8.jar!/:na]
	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:592) ~[mssql-jdbc-7.2.1.jre8.jar!/:na]
	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:522) ~[mssql-jdbc-7.2.1.jre8.jar!/:na]
	at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7194) ~[mssql-jdbc-7.2.1.jre8.jar!/:na]
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:2930) ~[mssql-jdbc-7.2.1.jre8.jar!/:na]
	at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:248) ~[mssql-jdbc-7.2.1.jre8.jar!/:na]
	at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:223) ~[mssql-jdbc-7.2.1.jre8.jar!/:na]
	at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQuery(SQLServerPreparedStatement.java:444) ~[mssql-jdbc-7.2.1.jre8.jar!/:na]
	at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52) ~[HikariCP-3.2.0.jar!/:na]
	at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java) ~[HikariCP-3.2.0.jar!/:na]
	at org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:678) ~[spring-jdbc-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]
	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:617) ~[spring-jdbc-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]
	... 16 common frames omitted

Prably reason is eventuate-foundation/eventuate-common#71

org.apache.kafka.common.KafkaException: Failed to construct kafka producer

Java Version:

PS C:\GitHub\eventuate-tram\eventuate-tram-examples-customers-and-orders> java -version openjdk version "1.8.0_322" OpenJDK Runtime Environment Corretto-8.322.06.1 (build 1.8.0_322-b06) OpenJDK 64-Bit Server VM Corretto-8.322.06.1 (build 25.322-b06, mixed mode) PS C:\GitHub\eventuate-tram\eventuate-tram-examples-customers-and-orders>

Gradle Build:

`
PS C:\GitHub\eventuate-tram\eventuate-tram-examples-customers-and-orders> ./gradlew

BUILD SUCCESSFUL in 881ms
1 actionable task: 1 executed

`

./gradlew buildAndStartServicesMySql

`
o.s.boot.SpringApplication : Application run failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'eventuateKafkaProducer' defined in class pa
th resource [io/eventuate/tram/cdc/connector/configuration/KafkaMessageTableChangesToDestinationsConfiguration.class]: Bean instantia
tion via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [io.e
ventuate.messaging.kafka.producer.EventuateKafkaProducer]: Factory method 'eventuateKafkaProducer' threw exception; nested exception is org.apache.kafka.common.KafkaException: Failed to construct kafka producer
at
`

See the attached log file:

command_line_response.txt

Which of these env vars are needed?

SPRING_DATASOURCE_URL: jdbc:sqlserver://mssql:1433;databaseName=eventuate

e.g. Doesn't the CDC have sensible defaults for polling?

      SPRING_DATASOURCE_TEST_ON_BORROW: "true"
      SPRING_DATASOURCE_VALIDATION_QUERY: SELECT 1
      EVENTUATELOCAL_KAFKA_BOOTSTRAP_SERVERS: kafka:29092
      EVENTUATELOCAL_ZOOKEEPER_CONNECTION_STRING: zookeeper:2181
      EVENTUATELOCAL_CDC_POLLING_INTERVAL_IN_MILLISECONDS: 500
      EVENTUATELOCAL_CDC_MAX_EVENTS_PER_POLLING: 1000
      EVENTUATELOCAL_CDC_MAX_ATTEMPTS_FOR_POLLING: 100
      EVENTUATELOCAL_CDC_POLLING_RETRY_INTERVAL_IN_MILLISECONDS: 500

Support test on java 14

docker image differences along with

targetCompatibility = '8'
sourceCompatibility = '8'

can just be parameterized ./gradlew -P x=y

There is no need for a branch. CircleCI can have a job that installs java 14 and builds with these parameters.

Simplify working with rest

JSonMapper.fromJson(restTemplate.postForObject(baseUrlCustomers("customers/make-snapshot"), null, String.class), TopicPartitionOffset[].class

First, this should be simplified to

restTemplate.postForObject(baseUrlCustomers("customers/make-snapshot"), null, TopicPartitionOffset[].class)

also it is better to wrap arrays to object

Failed CustomerViewRepositoryIntegrationTest

step to reproduce:

  1. git clone the repo
  2. ./mvnw clean install

expected:

  • All tests passed
    actual result:
  • build failed

[INFO] order-history-backend .............................. FAILURE [ 2.519 s]

The same when doing it via idea.

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate]: Unresolvable class definition; nested exception is java.lang.NoClassDefFoundError: org/springframework/core/KotlinDetector

Build 151 failed

Build https://app.circleci.com/pipelines/github/eventuate-tram/eventuate-tram-examples-customers-and-orders/151/workflows/2a8c7505-7ed5-4108-a5e9-b1b7c845a629/jobs/651/steps failed

Reason: build-and-test-snapshots.sh failed

*Reason: Failed io.eventuate.examples.tram.ordersandcustomers.snapshottests.SnapshotTest testCustomers

**Reason: I/O error on GET request for "http://localhost:8084/customers": Connection refused (Connection refused); nested exception is java.net.ConnectException: Connection refused (Connection refused)

***Reason: docker-compose failed to start eventuate-tram-examples-customers-and-orders_order-history-text-search-service_2

****Reason: ERROR: for eventuate-tram-examples-customers-and-orders_order-history-text-search-service_2 Cannot start service order-history-text-search-service: driver failed programming external connectivity on endpoint eventuate-tram-examples-customers-and-orders_order-history-text-search-service_2 (0a3fca82cb3f008c791cb248399a5dfa7b15c30f38e70bc8ccbba1b0621cf112): Bind for 0.0.0.0:8084 failed: port is already allocated

*****Reason: there is already eventuate-tram-examples-customers-and-orders_order-history-text-search-service_1

******Reason: order-history-text-search-service starts by ordersTest and customersTest. ordersTest executed first. It tried to start order-history-text-search-service, which depends on elastic search, and while elastic search is pulled, order-history-text-search-service started timeout is elapsed. So, customersTest started creating order-history-text-search-service concurrently

Solution: Increase timeouts start elastic search before order-history-text-search-service

Need to retry MongoDB upserts

Need to retry DuplicateKeyException thrown by upserts.

This occurred when deploying on Fargate with DocumentDB:

org.springframework.dao.DuplicateKeyException: E11000 duplicate key error collection: customerView index: _id_; nested exception is com.mongodb.MongoWriteException: E11000 duplicate key error collection: customerView index: _id_
at org.springframework.data.mongodb.core.MongoExceptionTranslator.translateExceptionIfPossible(MongoExceptionTranslator.java:101)
at org.springframework.data.mongodb.core.MongoTemplate.potentiallyConvertRuntimeException(MongoTemplate.java:2781)
at org.springframework.data.mongodb.core.MongoTemplate.execute(MongoTemplate.java:547)
at org.springframework.data.mongodb.core.MongoTemplate.doUpdate(MongoTemplate.java:1578)
at org.springframework.data.mongodb.core.MongoTemplate.doUpdate(MongoTemplate.java:1568)
at org.springframework.data.mongodb.core.MongoTemplate.upsert(MongoTemplate.java:1514)
at io.eventuate.examples.tram.ordersandcustomers.orderhistory.backend.CustomerViewRepositoryImpl.addOrder(CustomerViewRepositoryImpl.java:31)

Apparently, this is a feature:

https://jira.mongodb.org/browse/SERVER-14322

Services built using Maven randomly fail to when build using Java 8

  • This problem first appeared when the CircleCI build was switched from Java 14 back to Java 8.
  • The containers always used Java 8 even when Maven was running using Java 14
  • This mostly could not be reproduced locally
  • The exception was due to some annotation introspection problem on startup
  • The Spring Boot plugin seems to sometimes build a fat jar that is missing common-swagger

Building service "customerservice" failed: Invalid interpolation format for "build" option in service "customerservice": "${EVENTUATE_JAVA_BASE_IMAGE_VERSION?}"

I am getting the following error when running:

./gradlew mysqlbinlogComposeBuild mysqlbinlogComposeUp

Task :mysqlbinlogComposeBuild
Invalid interpolation format for "build" option in service "customerservice": "${EVENTUATE_JAVA_BASE_IMAGE_VERSION?}"

How must EVENTUATE_JAVA_BASE_IMAGE_VERSION be set?

Environment:
Linux Mint 20
Java: openjdk version "1.8.0_275"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.