optimizing enterprise java for a microservices
play

Optimizing Enterprise Java for a Microservices Architecture Otvio - PowerPoint PPT Presentation

Optimizing Enterprise Java for a Microservices Architecture Otvio Santana @otaviojava otaviojava@apache.org Enterprise Java Standards History J2EE 1.2 J2EE 1.3 J2EE 1.4 Java EE 5 Java EE 6 Java EE 7 Java EE 8 2015 2000 2005 2010


  1. Optimizing Enterprise Java for a Microservices Architecture Otávio Santana @otaviojava otaviojava@apache.org

  2. Enterprise Java Standards History J2EE 1.2 J2EE 1.3 J2EE 1.4 Java EE 5 Java EE 6 Java EE 7 Java EE 8 2015 2000 2005 2010 2020 Release Cadence

  3. ● JCP Members ● JCP EC ● JSR ● Standards

  4. Fundamental Shifts in Computing Cloud ● Reduce time to market ● Address unpredictable loads ● Pay as you go ● Containerization Microservices ● Deliver new features more quickly ● Smaller, more agile teams ● Deliver business features as discrete services ● Scale services independently

  5. MicroProfile Background ● Began as a collection of independent discussions ○ Many innovative “microservices” efforts in existing Java EE projects ■ WildFly Swarm ■ WebSphere Liberty ■ Payara ■ TomEE ○ Projects already leveraging both Java EE and non-Java EE technologies ○ Creating new features/capabilities to address microservices architectures ● Quickly realized there is common ground ● Java EE technologies are already being used for microservices, but we can do better

  6. Profile

  7. MicroProfile Release Philosophy Rapidly iterate Build Standardize Release 1.0 and innovate consensus JAX-RS CDI JSON-P S e p t 2 0 1 6

  8. Bridging Community and Standards Vendor Choice Broad Collaboration Implementation Choice Encouraged experimentation Application Portability Fail Fast Backwards Compatibility Rapid innovation Reduced Risk

  9. An Eclipse Foundation Project ● Meritocracy; vendor neutrality ● MicroProfile leadership can change over time ● Legal and technical infrastructure ● Trademark Ownership ● Accepts Apache License

  10. MicroProfile 1.1 Underway Configuration 1.0 Security: JWT Token Exchange 1.0 Second Quarter 2017! Health Check 1.0 Fault Tolerance 1.0 (Stretch goal)

  11. Configuration 1.0 @ApplicationScoped public class InjectedConfigUsageSample { @Inject private Config config; @Inject @ConfigProperty(name="myprj.some.url") private String someUrl; @Inject @ConfigProperty(name="myprj.some.port") private Optional< Integer > somePort; @Inject @ConfigProperty(name="myprj.some.dynamic.timeout", defaultValue="100") private javax.inject. Provider < Long > timeout; }

  12. Security: JWT Token Exchange 1.0 @Priority(Priorities.AUTHENTICATION) public class JWTAuthFilter implements ContainerRequestFilter{ @Override public void filter(ContainerRequestContext requestContext) throws IOException { String authHeaderVal = requestContext.getHeaderString("Authorization"); if (authHeaderVal.startsWith("Bearer")){ try { validate(authHeaderVal.split(" ")[1]); } catch (InvalidJwtException ex) { requestContext.abortWith(Response.status(Response.Status.UNAUTHORIZED).build()); } } else { requestContext.abortWith(Response.status(Response.Status.UNAUTHORIZED).build()); } }

  13. Health Check 1.0 @Path("/app") public class HealthCheckResource { @ApplicationScoped public class HealthChecks { @GET @Path("/diskspace") @Produces @Health @Health public HealthStatus checkDiskspace() { public HealthStatus checkDiskspace() { [...] [...] } } @GET @Produces @Path("/something-else") @Health @Health public HealthStatus checkSomethingElse() { public HealthStatus checkSomethingElse() { [...] [...] } } } }

  14. Fault Tolerance 1.0 (Stretch goal) @ApplicationScoped public class FaultToleranceBean { CircuitBreaker cb = FaultToleranceFactory.getInstance(CircuitBreaker.class) @Retry(maxRetries = 2) .withFailureThreshold(3, 10) public Runnable doWork() { .withSuccessThreshold(5) Runnable mainService = () -> serviceA(); .withDelay(1, TimeUnit.MINUTES); return mainService; Connection connect = execution.with(cb).run( this ::connect); } } }

  15. Feature Backlog* - Help us prioritize [1 of 2] ● Container API ● Configuration ● Microservic-y annotations ● Metrics/Monitoring (Ex: @CircuitBreaker) ● WebSockets ● Testing ● JSON-B ● Distributed Logging ● Bean Validation ● Distributed Tracing ● JPA ● OAuth2/OpenID Connect ● JTA ● Microservice Security ● Concurrency Utilities for ● Service Discovery Java EE ● Health Check * Some Items may be removed due to lack of interest

  16. Feature Backlog* - Help us prioritize [2 of 2] ● Messaging / Eventing ● JDK 8 ● Asynchronous/Reactive Lambda+Streams Support / Patterns ● EJB Lite ● Integration with Reactive / ● Servlets Eventing systems ● HTTP/2 ● Big Data/NoSQL strong & ● Startup Time weak consistency support ● Disk Space ● NetFlix OSS Integration ● Memory ● JCache ● Uber-jar ● Java 9 Modularity * Some Items may be removed due to lack of interest

  17. Release Schedule MicroProfile Move to MicroProfile MicroProfile 1.0 Foundation 1.1 1.2 Sep 2016 Q4 2016 2017 2017

  18. TomEE

  19. DEMO

  20. Join the Community!

  21. Join the Discussion! https://groups.google.com/forum/#!forum/microprofile

  22. Resources ● MicroProfile.io ● MicroProfile Discussion Forum bit.ly/MicroProfileForum MicroProfile Examples ● https://github.com/microprofile/microprofile-samples

  23. Otávio Santana @otaviojava otaviojava@apache.org

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend