-
Notifications
You must be signed in to change notification settings - Fork 1
How To | New Core Unit
zero edited this page Jan 24, 2019
·
3 revisions
Must read Architecture Overview and talk to yourself:
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 core unit
, you have to answer these questions:
- What purpose for this
core unit
? -
core unit
will provides which a list of functions that related to one concept/technology? - Is it already existed?
Your answers will lead your action:
-
Project Name | GroupId | ArtifactId | PackageName
@See: Naming Convention - Define a set of:
-
config
:unit configuration
for flexible override in deployment -
registry interface
: that will be injected intounit
when startupunit
. E.g:HttpRouter
in:core:httpserver
,KafkaRouter
in:core:kafka
-
service interface
: that used from outside of project, e.g:entityHandler
in:core:sql
,KafkaConsumerService
+KafkaProducerService
in:core:kafka
-
- Q3: If it is not existed, go ahead. Or else, improve exited one.
- Create new sub
Gradle project
in right place - Add
README.md
that describes yourcore unit
- Provide
Unit Config
inspired byVerticle Config
- Create your
Vertx Verticle
inspired byVerticle Unit
- Start to implement
- Add
unit test
to cover your implementation