Upload
andy-moncsek
View
54
Download
1
Tags:
Embed Size (px)
Citation preview
About me
• Andy Moncsek
• Senior Consultant Application development
• Trivadis AG Switzerland
• Email: [email protected]
• Twitter: @AndyAHCP
Agenda
• about microservices
• Vert.x 3 introduction
• microservices on top of Vert.x 3
C
E
B
A
C
G
H
F
I
characteristics of microservices [1
Martin Fowler]
• component oriented, replaceable, independent
• focus on business capabilities
• UNIX style: do one thing well & work together
• smart endpoint & dump pipes (no ESB ;-) )
• distributed / decentralized data
AAAE
AF
AGAC
AHABAC
AI
microservice design patterns
• Architecture patterns
• Router/Aggregator/Chained/shared-data
• Deployment patterns
• instance per host, VM, Container
AAAE
AF
AGAC
AHABAC
AI
microservice design patterns
• Interaction/communication pattern
• Request-Reply vs. Pub-Sub / Events vs. Queries/Commands
• Service discovery
• serverside/clientside-discovery / self-/3d-party-registration AA
AEAF
AGAC
AHABAC
AI
Vert.X 3(tool-kit for building reactive applications)
• nodeJS for Java developers :-D (sorry Tim)
• event driven / non blocking
• polyglot (written in Java 8)
• general purpose (web, backend)
• http://vert-x3.github.io, current version: v3.0-milestone6
Vert.X 3 (terms)
• Scaling, Cluster / HA
• VerticleFactory
• packaging
• TCP, UDP, HTTP, WebSocket, SocketJS, FileSystem,….. AAAE
AF
AGAC
AHABAC
AI
microservices on top of Vert.x 3
C
E
B
A
C
G
H
F
Ihttps://github.com/amoAHCP/vert.x-microservice
Vert.X microservice framework
• current status: working prototype!
• idea: all-in-one microservice framework based on Vert.X
• components:
• service Verticle
• service router / API gateway
• service registry / heartbeat
• service discovery AAAE
AF
AGAC
AHABAC
AI
Vert.X microservice framework - service Verticle
Verticle
@ApplicationPath("/articleService")
desc.
@Path("/comments/:id") @OperationType(Type.REST_GET) findComments(@PathParam("id") final String id, Message m)
@Path("/fetchByArticleIdWS")@OperationType(Type.WEBSOCKET)fetchByArticleIdWS(String id, WSMessageReply r)
@Path("/fetchByArticleId")@OperationType(Type.EVENTBUS)fetchByArticleId(String id, EBMessageReply r)
Vert.X microservice framework - router / gateway
Event Bus
Event Bus
Event Bus
Vert.X cluster
service
service
service
service
service
router/gatewayhost:port
@Path("/articleService/comments/:id")
@Path(„/../fetchByArticleIdWS")@Path(„/..byArticleId“)
client
client
client
serviceservice
serviceservice
Vert.X microservice framework - registry / heartbeat
router/gatewayhost:port
service
service
service
service
service
Vert.X cluster
registry register
register
heart-beat ping
unre
g.
Vert.X microservice framework - discovery
Vert.X cluster
service serv
ice
service serv
ice
service
router/
gateway
host:port
registry
discovery.service(„name“, op->
);
op.operation(„path“, p->
)
fail
p.eventBusSend(„message",r->{
// reply});fail
• [1] http://www.infoq.com/news/2014/11/gotober-fowler-microservices
• [2] http://www.adam-bien.com/roller/abien/entry/the_perfect_javaee_microservice
• [3] https://www.voxxed.com/blog/2015/04/coupling-versus-autonomy-in-microservices/
• [4] https://www.voxxed.com/blog/2015/04/microservice-design-patterns/