The microservice canvas is a great way to document a service. One drawback, however, is that like all forms of documentation, it often becomes out of date.
This project keeps the canvas up to date by dynamically generating a microservice canvas for a running service using a combination of reflection/introspection and explicit metadata.
You can access a service’s canvas via the following endpoints:
-
/canvas.adoc
- returns the Asciidoc canvas -
/canvas.html
- returns the HTML canvas -
/canvas.json
- returns the JSON representation of a canvas -
/canvas.yml
- returns the YAML representation of a canvas
The following frameworks are supported:
-
Spring Boot
-
Eventuate Tram
-
Eventuate Tram sagas
The canvas is built from the following sources:
Source |
Provides |
|
Service name |
Bean in |
Service name and capabilities |
|
Synchronous API operations |
Eventuate Tram command handlers |
Asynchronous API operations |
Eventuate Tram domain event handlers |
Event subscription dependencies |
Eventuate Tram Saga saga participant proxy beans |
Asynchronous dependencies |
First, you need to this dependency io.microservices.tools.canvas:microservice-canvas-springmvc:LATEST_VERSION
.
Second, until it’s available on Jcenter you will need to add this repository:
repositories {
maven { url 'https://dl.bintray.com/eventuateio-oss/microservice-canvas-tools-release' }
}
Third, @Import
MicroserviceCanvasWebConfiguration
.
Finally, add these optional dependencies:
If you are using |
Then add this dependency |
Eventuate Tram |
|
Eventuate Tram Sagas |
|
This commit adds canvas support to the FTGO application’s Order Service.