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

optimizing enterprise java for a microservices
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

Optimizing Enterprise Java for a Microservices Architecture Otávio Santana @otaviojava

  • taviojava@apache.org
slide-2
SLIDE 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

2000 2005 2010 2015 2020

Release Cadence

slide-3
SLIDE 3
  • JCP Members
  • JCP EC
  • JSR
  • Standards
slide-4
SLIDE 4

Fundamental Shifts in Computing

  • Deliver new features more quickly
  • Smaller, more agile teams
  • Deliver business features as discrete services
  • Scale services independently
  • Reduce time to market
  • Address unpredictable loads
  • Pay as you go
  • Containerization

Cloud Microservices

slide-5
SLIDE 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

slide-6
SLIDE 6

Profile

slide-7
SLIDE 7

MicroProfile Release Philosophy

Release 1.0

JAX-RS CDI JSON-P

Build consensus Standardize Rapidly iterate and innovate S e p t 2 1 6

slide-8
SLIDE 8

Bridging Community and Standards

Vendor Choice Implementation Choice Application Portability Backwards Compatibility Reduced Risk Broad Collaboration Encouraged experimentation Fail Fast Rapid innovation

slide-9
SLIDE 9

An Eclipse Foundation Project

  • Meritocracy; vendor neutrality
  • MicroProfile leadership can change over

time

  • Legal and technical infrastructure
  • Trademark Ownership
  • Accepts Apache License
slide-10
SLIDE 10

MicroProfile 1.1 Underway

Security: JWT Token Exchange 1.0 Health Check 1.0 Configuration 1.0 Fault Tolerance 1.0 (Stretch goal)

Second Quarter 2017!

slide-11
SLIDE 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; }

slide-12
SLIDE 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()); } }

slide-13
SLIDE 13

Health Check 1.0

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

slide-14
SLIDE 14

Fault Tolerance 1.0 (Stretch goal)

@ApplicationScoped public class FaultToleranceBean { @Retry(maxRetries = 2) public Runnable doWork() { Runnable mainService = () -> serviceA(); return mainService; } } }

CircuitBreaker cb = FaultToleranceFactory.getInstance(CircuitBreaker.class) .withFailureThreshold(3, 10) .withSuccessThreshold(5) .withDelay(1, TimeUnit.MINUTES); Connection connect = execution.with(cb).run(this::connect);

slide-15
SLIDE 15

Feature Backlog* - Help us prioritize [1 of 2]

  • Container API
  • Microservic-y annotations

(Ex: @CircuitBreaker)

  • Testing
  • Distributed Logging
  • Distributed Tracing
  • OAuth2/OpenID Connect
  • Microservice Security
  • Service Discovery
  • Health Check
  • Configuration
  • Metrics/Monitoring
  • WebSockets
  • JSON-B
  • Bean Validation
  • JPA
  • JTA
  • Concurrency Utilities for

Java EE

* Some Items may be removed due to lack of interest

slide-16
SLIDE 16

Feature Backlog* - Help us prioritize [2 of 2]

  • Messaging / Eventing
  • Asynchronous/Reactive

Support / Patterns

  • Integration with Reactive /

Eventing systems

  • Big Data/NoSQL strong &

weak consistency support

  • NetFlix OSS Integration
  • JCache
  • JDK 8

Lambda+Streams

  • EJB Lite
  • Servlets
  • HTTP/2
  • Startup Time
  • Disk Space
  • Memory
  • Uber-jar
  • Java 9 Modularity

* Some Items may be removed due to lack of interest

slide-17
SLIDE 17

Release Schedule

Sep 2016 MicroProfile 1.0 Q4 2016 2017 2017 Move to Foundation MicroProfile 1.1 MicroProfile 1.2

slide-18
SLIDE 18

TomEE

slide-19
SLIDE 19

DEMO

slide-20
SLIDE 20

Join the Community!

slide-21
SLIDE 21

Join the Discussion!

https://groups.google.com/forum/#!forum/microprofile

slide-22
SLIDE 22

Resources

  • MicroProfile.io
  • MicroProfile Discussion Forum

bit.ly/MicroProfileForum

  • MicroProfile Examples

https://github.com/microprofile/microprofile-samples

slide-23
SLIDE 23

Otávio Santana @otaviojava

  • taviojava@apache.org