Demystifying microservices for JavaEE developers by Steve Millidge.
1. Demystifying Microservices for Java
EE Developers
David R. Heffelfinger
Ensode Technology, LLC
http://www.ensode.com
@ensode
Steve Millidge
Payara Services Ltd
https://www.payara.fish
@l33tj4v4
2. About the speakers
David R. Heffelfinger
Independent consultant based in Fairfax, VA
Java Champion
Author of several books on Java, Java EE and
related technologies
Frequent speaker at Java conferences
Named one of 39 Java experts you should follow on
Twitter
3. About the speakers (cont'd)
Steve Millidge
Founder and Director of Payara Services and C2B2
Consulting
Many years in the field as an application server
consultant.
Now runs the Payara team and when allowed adds
features and bugs
4. Session Outline
● What are microservices?
● Can Java EE do microservices?
● Migrating to microservices
● Microservices Demo
● Java EE 8, Java EE 9 and MicroProfile
● Summary
5. What are microservices?
● Architectural style
–Code deployed in small, granular modules
–Low coupling, high cohesion
–RESTful web services
–Framework and programming language independent
6. Can Java EE do microservices?
● Many Java EE application server vendors provide
lightweight, embeddable application servers (e.g.
Payara Micro)
● One application deployed per instance of application
server
● Several instances of the application server deployed
to a server
7. Can Java EE do microservices? (cont'd)
●Some application servers allow the creation of an
“uber jar”
●Lightweight application servers can be added to a
container image (i.e. Docker)
–Applications can be deployed as thin wars, typically
a few kilobytes in size.
●Modern, lightweight Java EE application servers
suitable for microservices development
9. Microservices Disadvantages
●Additional operational and tooling overhead
●Increased debugging complexity
●Distributed transactions may pose a challenge
●Potential for complex interdependencies
●Susceptible to the fallacies of distributed computing
10. Fallacies of distributed computing
●The network is reliable.
●Latency is zero.
●Bandwidth is infinite.
●The network is secure.
●Topology doesn't change.
●There is one administrator.
●Transport cost is zero.
●The network is homogeneous.
11. Migrating to microservices
●Should we migrate?
–Do the benefits outweight the disadvantages?
–Are there pressing business requirements?
●A migration to microservices may not provide much
value to end users
12. Migrating to microservices(cont'd)
●Iterative refactoring
–Refactor an existing application one module at a time
–Identify an existing module to refactor as a
microservice
●Client code for the refactored module would invoke
the refactored code via HTTP requests
–Identify a second module to refactor, then a third,
etc, until the complete application has been refactored
to follow the microservices architectural style
13. Migrating to microservices(cont'd)
●Partial refactoring
–Identify modules that may be reusable across
applications
–Refactor those (and only those) modules as
microservices
–Hybrid approach
16. Java EE 8
●Java API for JSON Binding (JSON-B)
–Automatically populate Java objects from JSON
–Automatically generate JSON from Java objects
●Java API for RESTful Web Services (JAX-RS) 2.1
–JSON-B support
–Server Sent Events
–Improved CDI integration
–Security improvements
17. Java EE 8 (cont'd)
●CDI 2.0
–Observer ordering
–Asynchronous events
–Configurators for major Service Provider Interface
(SPI) elements
18. Java EE 8 (cont'd)
●Bean Validation 2.0
–Support for Java SE 8 Date/Time API
–Ability to validate all members of a collection with a
single annotation
–Repeatable annotation support
19. Java EE 9
●Project Jigsaw support
–Java EE dependencies declared as modules
●Circuit Breaker design pattern support for JAX-RS
●New Event API
●NoSQL database support
●New State Management API
20. Microprofile
Collaboration between application server vendors and JUGs
• IBM
• Payara Services
• Red Hat
• Tomitribe
• Hazelcast
• Fujitsu
• Kumulzee
• SmartBear
• London Java Community
• SouJava Brazilian JUG
21. MicroProfile 1.1
● Does not compete with Java EE
–“Feeds” the Java EE standard
●JAX-RS, CDI, JSON-P and a Configuration API
● New APIS coming in 1.2
23. Summary
●Java EE is suitable for microservices
–Java EE developers can leverage their expertise
–Deploy Java EE compliant code to an embeddable
application server
–Traditional Java EE applications can be partially or
completely refactored to microservices
24. Additional Resources
●Demystifying Microservices for Java EE Developers
Guide: http://info.payara.fish/demystifying-microservices-for-java-ee-developers
●The Aquarium (Java EE 8/9 News):
https://blogs.oracle.com/theaquarium/
●MicroProfile: https://microprofile.io/
●Follow us on Twitter! @ensode @l33tj4v4