Implementations of the same basic, canonical microservice using different programming languages and different frameworks:
-
Exposes a simple REST API over HTTPS requiring authentication
-
The exposed REST API is defined by an API specification, ideally using OpenAPIv3
-
Persists entities in an external database, using MongoDB, but staying DB-independent as much as possible
-
Invokes a publicly accessibe REST API that requires authentication
-
All external calls (REST API invocations, DB access) use client-side resilience approaches: timeout, retry, fallback
-
Publishes entity change events to a topic, using Kafka, but staying broker-independent as much as possible
-
Subscribes to events from a topic, using the same broker as it uses for publishing events
-
The event exchanges are described by an AsyncAPIv2 definition
-
Loosely follows Hexagonal Architecture and thereby confines framework and technology dependence (Kafka, MongoDB, …) to "adapters"
-
Configuration via properties, using encryption for sensitive property values
-
Packaged into an as-small-as-possible Docker container
-
Write REST API spec
-
Write AsyncAPI spec
-
Create project with latest versions of all dependencies
-
Add unit testing support
-
Add property configuration support
-
Implement technology-independent "domain" incl. "ports":
-
model
-
domain services
-
application service
-
received event handlers
-
"driven ports" (interfaces) for
-
repository
-
invoked REST API
-
sending events
-
-
-
Implement technology-dependent "adapters":
-
"driving adapters" for
-
exposed REST API
-
Kafka event subscription
-
-
"driven adapters" for
-
MongoDB repository
-
REST API invocations
-
Kafka event publication
-
-
-
Write Dockerfile