Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Building Microservices with Helidon: Oracle's New Java Microservices Framework

42 views

Published on

Project Helidon, introduced by Oracle in September 2018, features an asynchronous reactive web server built on top of Netty. Oracle designed Helidon to be lightweight, easy, and fast for building microservices-based applications. There are two programming modes: Helidon SE, featuring microframeworks, and Helidon MP, which supports MicroProfile. This session provides an overview of Helidon, followed by live demonstrations of how to get started with both Helidon SE and Helidon MP, along with an application.

Published in: Technology
  • Be the first to comment

Building Microservices with Helidon: Oracle's New Java Microservices Framework

  1. 1. BUILDING MICROSERVICESBUILDING MICROSERVICES WITH HELIDONWITH HELIDON ORACLE CODE ONEORACLE CODE ONE September 17, 2019September 17, 2019 Michael P. RedlichMichael P. Redlich 1 . 1
  2. 2. WHO'S MIKE?WHO'S MIKE? Bachelor of Science, Computer Science from Senior Research Technician, petrochemical research organization Java Queue News Editor, Past President, (ACGNJ) Founder & Co-Facilitator, Rutgers University InfoQ Amateur Computer Group of New Jersey ACGNJ Java Users Group 1 . 2
  3. 3. OBJECTIVESOBJECTIVES What is Helidon? Features Why Helidon? Helidon Components, Architecture, & Landscape Getting Started Live Demo 2
  4. 4. WHAT IS HELIDON?WHAT IS HELIDON? A collection of Java libraries designed for creating microservices-based applications Helidon SE Helidon MP supports MicroPro le 3.0 and MicroPro le 2.2 Cloud Native Java Latest version: 1.3.0
  5. 5. 3 . 1
  6. 6. FEATURESFEATURES Simple and fast Reactive web server MicroPro le support Observable and resilient 4
  7. 7. WHY HELIDON?WHY HELIDON? Dmitry KornilovDmitry Kornilov Senior Software Development Manager at OracleSenior Software Development Manager at Oracle “The work on Helidon started some time ago. When microservices architecture started to become very popular for creating cloud services, the development experience also needed to change. Java EE is a stable technology but it has a lot of legacy code. Instead of building microservices on top of Java EE, we realized that we needed a new framework which is designed to build microservices from the scratch. That's how Helidon was born.”
  8. 8. 5 . 1
  9. 9. HELIDON COMPONENTSHELIDON COMPONENTS WEB SERVERWEB SERVER Fully reactive and non-blocking HTTP server built on The WebServer interface includes support for con guration, routing, error handling, and building metrics and health endpoints Netty
  10. 10. 6 . 1
  11. 11. MAVEN COORDINATESMAVEN COORDINATES <dependency> <groupId>io.helidon.webserver</groupId> <artifactId>helidon-webserver</artifactId> </dependency> 6 . 2
  12. 12. // starts the server on a random available port public static void main(String[] args) throws Exception { WebServer webServer = WebServer .create(Routing.builder() .any((req, res) -> res.send("It works!")) .build()) .start() .toCompletableFuture() .get(10, TimeUnit.SECONDS); System.out.println("Server started at: http://localhost:" } 6 . 3
  13. 13. CONFIGCONFIG Allows an application to load and process con guration properties into a Config object Properties are read from a de ned application.properties or application.yaml le in /src/main/resources 6 . 4
  14. 14. MAVEN COORDINATESMAVEN COORDINATES <dependency> <groupId>io.helidon.config</groupId> <artifactId>helidon-config-yaml</artifactId> </dependency> 6 . 5
  15. 15. // application.yaml app: greeting: "Hello" server: port: 8080 host: 0.0.0.0 6 . 6
  16. 16. // starts the server on a port defined in application.yaml public void startWebServerUsingDefinedPort() throws Exception { Config config = Config.create(); ServerConfiguration serverConfig = ServerConfiguration.fromCo WebServer webServer = WebServer .create(serverConfig,Routing.builder() .any((req,res) -> res.send("It works!" + "n") .build()) .start() .toCompletableFuture() .get(10,TimeUnit.SECONDS); System.out.println("Server started at: http://localhost:" + w webServer.shutdown().toCompletableFuture(); } 6 . 7
  17. 17. SECURITYSECURITY The Security class provides support for: authentication authorization audit A number of security providers for use in Helidon applications have been implemented 6 . 8
  18. 18. MAVEN COORDINATESMAVEN COORDINATES <dependency> <groupId>io.helidon.security</groupId> <artifactId>helidon-security</artifactId>: </dependency> 6 . 9
  19. 19. SECURITYSECURITY Three ways to built-in security to a Helidon application: builder pattern con guration pattern hybrid pattern 6 . 10
  20. 20. // application.yaml http-basic-auth: users: login: "mpredli" password: "${CLEAR=somePassword}" roles: ["user","admin"] 6 . 11
  21. 21. BUILDER PATTERNBUILDER PATTERN Security security = Security.builder() // create a provider instance based on the provider docum .addProvider(...) .build(); 6 . 12
  22. 22. CONFIGURATION PATTERNCONFIGURATION PATTERN // accepts a defined Config object Security security = Security.create(config); 6 . 13
  23. 23. HYBRID PATTERNHYBRID PATTERN Security security = Security.builder(config) .addProvider(...) .build(); Security security = Security.builder() .addProvider() .config(config) .build(); 6 . 14
  24. 24. Config config = Config.create(); Security security = Security.builder() .config(config) .addProvider(...) .build(); String user = config.get("http-basic-auth.users.login").asString( String password = config.get("http-basic-auth.users.password").as System.out.println("n"); System.out.println("INFO: user = " + user); System.out.println("INFO: password = " + password); SecurityTime time = SecurityTime.builder().build(); time = security.getServerTime(); System.out.println("INFO: server time = " + time.toString()); System.out.println("n"); 6 . 15
  25. 25. MICROPROFILEMICROPROFILE A full suite of APIs for optimizing enterprise Java in a microservices architecture A collaboration of Java EE vendors 6 . 16
  26. 26. 6 . 17
  27. 27. MAVEN COORDINATESMAVEN COORDINATES <dependency> <groupId>io.helidon.microprofile.bundles</groupId> <artifactId>helidon-microprofile-3.0</artifactId> </dependency> 6 . 18
  28. 28. CDI PORTABLE EXTENSIONSCDI PORTABLE EXTENSIONS HikariCP Data Sources Oracle UCP Data Sources Jedis Clients Oracle Cloud Infrastructure (OCI) Object Storage Clients Java Transaction API objects 6 . 19
  29. 29. METRICSMETRICS Provides a uni ed way to export monitoring data (telemetry) to management agents, and a uni ed API that all application developers can use to expose their telemetry data 6 . 20
  30. 30. MAVEN COORDINATESMAVEN COORDINATES <dependency> <groupId>io.helidon.metrics</groupId> <artifactId>helidon-metrics</artifactId> </dependency> 6 . 21
  31. 31. TRACINGTRACING Allows easier tracing of the ow of a request in microservices environment across service boundaries 6 . 22
  32. 32. MAVEN COORDINATESMAVEN COORDINATES <dependency> <groupId>io.helidon.tracing</groupId> <artifactId>helidon-tracing</artifactId> </dependency> 6 . 23
  33. 33. HEALTH CHECKSHEALTH CHECKS Determines the health of a computing node and replace it, if necessary 6 . 24
  34. 34. MAVEN COORDINATESMAVEN COORDINATES <dependency> <groupId>io.helidon.health</groupId> <artifactId>helidon-health</artifactId> </dependency> 6 . 25
  35. 35. HELIDON ARCHITECTUREHELIDON ARCHITECTURE
  36. 36. 7 . 1
  37. 37. HELIDON LANDSCAPEHELIDON LANDSCAPE
  38. 38. 8 . 1
  39. 39. GETTING STARTEDGETTING STARTED HELIDON SEHELIDON SE // generates and packages the Helidon SE example to create a REST $ mvn archetype:generate -DinteractiveMode=false -DarchetypeGroupId=io.helidon.archetypes -DarchetypeArtifactId=helidon-quickstart-se -DarchetypeVersion=1.3.0 -DgroupId=io.helidon.examples -DartifactId=helidon-quickstart-se -Dpackage=io.helidon.examples.quickstart.se $ cd quickstart-se $ mvn package $ java -jar target/quickstart-se.jar
  40. 40. 9 . 1
  41. 41. HELIDON MPHELIDON MP // generates and packages the Helidon MP example to create a REST $ mvn archetype:generate -DinteractiveMode=false -DarchetypeGroupId=io.helidon.archetypes -DarchetypeArtifactId=helidon-quickstart-mp -DarchetypeVersion=1.3.0 -DgroupId=io.helidon.examples -DartifactId=helidon-quickstart-mp -Dpackage=io.helidon.examples.quickstart.mp $ cd quickstart-mp $ mvn package $ java -jar target/quickstart-mp.jar 9 . 2
  42. 42. 9 . 3
  43. 43. DEMO APPLICATIONDEMO APPLICATION A movie application built on top the Helidon MP quickstart example Based on a written by , self- employed technical consultant, solution architect and full-stack developer tutorial Hantsy Bai
  44. 44. 10 . 1
  45. 45. 11
  46. 46. NY/NJ/PA JAVA USERS GROUPSNY/NJ/PA JAVA USERS GROUPS  ACGNJ Java Users Group facilitated by Mike Redlich & Barry Burd NYJavaSIG facilitated by Frank Greco javasig.org javasig.com
  47. 47. 12 . 1
  48. 48. PhillyJUG facilitated by Paul Burton, et.al. Princeton Java Users Group facilitated by Yakov Fain meetup.com/PhillyJUG meetup.com/NJFlex 12 . 2
  49. 49. FURTHER READINGFURTHER READING TECHNICAL ARTICLESTECHNICAL ARTICLES Hantsy Bai November 30, 2018 Eugen Paraschiv November 8, 2018 Todd Sharp October 3, 2018 Building an Application with Helidon MP Microservices with Oracle Helidon Microservices From Dev To Deploy, Part 1: Getting Started With Helidon
  50. 50. 13 . 1
  51. 51. TECHNICAL ARTICLESTECHNICAL ARTICLES Dmitry Kornilov September 7, 2018 Helidon Takes Flight 13 . 2
  52. 52. INFOQ NEWSINFOQ NEWS July 19, 2019 March 12, 2019 October 10, 2018 Helidon Supports GraalVM for Native Executable Applications Helidon V1 Brings API Stability and MicroPro le 1.2 Support Oracle Introduces Helidon - A Lightweight Java Microservices Framework 13 . 3
  53. 53. UPCOMING ACGNJ JAVA USERSUPCOMING ACGNJ JAVA USERS GROUP MEETINGSGROUP MEETINGS Tuesday, October 8, 2019 Tuesday, October 22, 2019 Monday, November 18, 2019 Beautiful SDK Design in Java for APIs Reza Rahman Ray Tsang Micah Silverman 14
  54. 54. UPCOMING EVENTSUPCOMING EVENTS Monday-Friday, November 11-15, 2019 Hyatt Regency San Francisco QCon San Francisco 15
  55. 55. HELIDON RESOURCESHELIDON RESOURCES    Website Guides Documentation 16
  56. 56. CONTACT INFOCONTACT INFO      redlich.net mike@redlich.net @mpredli slideshare.net/mpredli01 github.com/mpredli01/helidon- movies 17
  57. 57. ACKNOWLEDGEMENTSACKNOWLEDGEMENTS Dmitry Kornilov 18
  58. 58. THANKS!THANKS! 19

×