-
Notifications
You must be signed in to change notification settings - Fork 1
How To | New Service
Aidan P edited this page Jun 22, 2019
·
10 revisions
Must read Architecture Overview
Micro service must be designed with these rules:
- Single responsibility principle: do only one purpose
- Itself configurable, and itself testable
- Communicates with each other via eventbus
Before you start writing new microservice
, you have to answer these questions:
- What purpose for this service?
- Where is this service integrated?
- List functions that service provides or uses? E.g:
RESTful API
for end user, storage data inDatabase
orKafka
communication - Is it already existed?
Your answers will lead your action:
- Question 1 and 2:
Project Name | GroupId | ArtifactId | PackageName
@See: Naming Convention - Q3: List
core unit
will be used. - Q4: If it is not existed, go ahead. Or else, maybe one of actions:
-
Same integrated location, same purpose
: update existed one -
Same integrated location, different purpose
: split thecommon part
between new one and existed one to new project, then group them(3 projects) into onegroupId
(means: same parent project). After that, addingcommon part
in dependencies of the existed one and new project -
Different integrated location
(e.g: existed onDashboard
but new one will be inEdge
): Split thecommon part
to new project into:core
and make the existed one and new project depends onnew core unit
-
- Create new sub
Gradle project
in right place - Add
README.md
that describes your project - Create your
Vertx Verticle
inspired byVerticle Container
and register a set ofcore unit
incontainer
- Consider overriding
config
from set ofcore unit
and add more your application configuration if needed - Start to implement your business domain
- Add
unit test
to cover your implementation