$30 off During Our Annual Pro Sale. View Details »

Vert.x Simplicidade que nos traz FELICIDADE

Vert.x Simplicidade que nos traz FELICIDADE

In this talk, I'll explain a little bit how vert.x helps developers to write simple and efficient code and how it is important in the microservices World.
I'll talk about API First and how we can use vert.x to achieve that.
Also, I'll talk about OpenID Connect and other important stuff related to microservices

More Decks by Claudio Eduardo de Oliveira

Other Decks in Programming

Transcript

  1. vert.X simplicidade
    Que nos traz FELICIDADE

    View Slide

  2. Agenda
    Vert.x Concepts
    Reducing Complexity
    Open API -> OpenID
    JDBC Async
    Metrics
    Distributed Tracing

    View Slide

  3. Vert.x
    Concepts

    View Slide

  4. Vert.x Verticles
    Verticles are chunks of code that get deployed and
    run by Vert.x. A Vert.x instance maintains N event loop
    threads (where N by default is core*2) by default.
    Worker - Thread Pool in general for blocking code
    Standard - Event Loop

    View Slide

  5. Vert.x Event Loop

    View Slide

  6. https://github.com/vert-x3/vertx-examples/blob/4.x/web-examples/src/main/java/io/vertx/example/web/helloworld/Server.java

    View Slide

  7. Vert.x Event Bus
    Is the nervous system of Vert.x.
    The event bus allows different parts of your
    application to communicate with each other, and
    whether they’re in the same Vert.x instance, or in a
    different Vert.x instance.

    View Slide

  8. https://github.com/vert-x3/vertx-examples/blob/4.x/web-examples/src/main/java/io/vertx/example/web/vertxbus/amd/Server.java

    View Slide

  9. Reducing
    complexity

    View Slide

  10. View Slide

  11. Lots of Modules
    Different integrations Models
    Design Patterns is very important
    DDD
    HExagonal Architecture

    View Slide

  12. Applications scopes are reduced
    Many Integrations
    Contracts will be very helpful

    View Slide

  13. View Slide

  14. The contract is
    our “new”
    abstraction

    View Slide

  15. An API-First approach
    means that for any
    given development
    project, your APIs are
    treated as first-class
    citizens.
    API First

    View Slide

  16. OVERVIEW DIAGRAM

    View Slide

  17. View Slide

  18. Supports it????
    How

    View Slide

  19. View Slide

  20. View Slide

  21. How about Vert.x and code complexity???
    1. Easy way to implement OpenAPI endpoints
    2. Validate input data using OpenAPI definition
    3. Handlers is totally Single Response Principle (SRP)
    4. SQL Client in Vert.x is asynchronous
    5. Avoid callback Vert.x 4 encourages Futures, sometimes called
    “Futurisation”

    View Slide

  22. APIs is very important
    to achieve business
    goals. Security should
    be first-class citizen in
    APIs.
    API Security

    View Slide

  23. View Slide

  24. Supports it????
    How

    View Slide

  25. How about vert.x supports OpenId
    1. Auth JWT
    2. Configure issuer (OP) in configuration file
    3. Download keys from /certs obtained from .well-know endpoints
    4. Easy way to achieve token verifier

    View Slide

  26. View Slide

  27. View Slide

  28. JDBC
    asynchronous
    YES

    View Slide

  29. View Slide

  30. View Slide

  31. Features
    1. Supports sql-templates
    2. Use annotations
    3. Add dependency to process annotations
    4. It is asynchronous

    View Slide

  32. Metrics

    View Slide

  33. How about vert.x and Metrics
    1. You can use micrometer metrics
    2. Add prometheus a metric collector
    3. Metrics from HTTP Endpoints are out-of-box
    4. Easy way to expose these metrics

    View Slide

  34. Supports it????
    How

    View Slide

  35. View Slide

  36. View Slide

  37. View Slide

  38. View Slide

  39. Distributed
    Tracing

    View Slide

  40. How about vert.x and Distributed Tracing
    1. It Supports OpenTracing and Zipkin
    2. Configuration are done using environment
    3. You can choose the tracing policy PROPAGATE, ALWAYS,and
    IGNORE
    4. You can enable trace in vert.x Event Bus

    View Slide

  41. Supports it????
    How

    View Slide

  42. View Slide

  43. View Slide

  44. View Slide

  45. Read Vert.x
    configuration from
    json, env and others.
    Supports Redis
    Clients in
    Asynchronous
    Fashion
    Support graphQL
    endpoints in your
    Vert.x Services
    OTHER Features
    Config REDIS graphQL
    Implementation of
    the circuit-breaker
    pattern to mitigate
    failures.
    This component
    provides a Kafka
    client for reading
    and sending
    messages from/to
    an Apache Kafka
    cluster.
    A Vert.x client allowing
    applications to interact
    with a MongoDB
    instance, whether that’s
    saving, retrieving,
    searching, or deleting
    documents
    Circuit
    Breaker Kafka MongoDB

    View Slide

  46. conclusions
    01 02 03 04
    Think about
    Software
    Architecture
    and choose
    carefully
    Vert.x support
    microservices
    “standards”
    metrics,
    tracing….
    Use contracts
    to improve
    communicati
    on between
    teams
    It is not a
    silver bullet,
    think in
    another
    option in your
    toolbox

    View Slide

  47. View Slide

  48. CREDITS: This presentation template was created by
    Slidesgo, including icons by Flaticon, and infographics
    & images by Freepik.
    THANKS!
    Do you have any questions?
    [email protected]
    @claudioed
    https://claudioed.tech
    Github
    https://github.com/claudioed/tdc-inn-users
    https://github.com/claudioed/tdc-inn-chat
    https://github.com/claudioed/tdc-inn-police-man

    View Slide