Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Why you're missing out if you're not making Quarkus extensions

Why you're missing out if you're not making Quarkus extensions

Do I need an extension? And how do I write it?

Extensions are a great way of enabling your favourite library to fully take advantage of Quarkus’s capabilities. They can also be used to improve your team’s everyday workflow.

In this talk Georgios and Holly will talk through how extensions can be useful, before live-coding a simple extension. (What it does is a surprise!)

Holly Cummins

June 07, 2022
Tweet

More Decks by Holly Cummins

Other Decks in Programming

Transcript

  1. Holly Cummins @holly_cummins


    Georgios Andrianakis @geoand86
    Red Hat


    Why you're missing out if you're not
    making Quarkus extensions

    View full-size slide

  2. @holly_cummins @geoand86
    #Quarkus #RedHat
    Hi
    Georgios!

    View full-size slide

  3. @holly_cummins @geoand86
    #Quarkus #RedHat
    extenwhats?

    View full-size slide

  4. @holly_cummins @geoand86
    #Quarkus #RedHat
    Quarkus core

    View full-size slide

  5. @holly_cummins @geoand86
    #Quarkus #RedHat
    Quarkus core
    JAX-RS

    View full-size slide

  6. @holly_cummins @geoand86
    #Quarkus #RedHat
    Quarkus core
    Hibernate
    JAX-RS

    View full-size slide

  7. @holly_cummins @geoand86
    #Quarkus #RedHat
    Quarkus core
    Hibernate
    JAX-RS
    Netty

    View full-size slide

  8. @holly_cummins @geoand86
    #Quarkus #RedHat
    Quarkus core
    Hibernate
    JAX-RS
    Netty
    JWT

    View full-size slide

  9. @holly_cummins @geoand86
    #Quarkus #RedHat
    Quarkus core
    Hibernate
    JAX-RS
    Netty
    JWT
    Elasticsearch

    View full-size slide

  10. @holly_cummins @geoand86
    #Quarkus #RedHat
    Quarkus core
    Hibernate
    JAX-RS
    Netty
    JWT
    Elasticsearch
    Apache Camel

    View full-size slide

  11. @holly_cummins @geoand86
    #Quarkus #RedHat
    Quarkus core
    Hibernate
    JAX-RS
    Netty
    JWT
    gRPC
    Elasticsearch
    Apache Camel

    View full-size slide

  12. @holly_cummins @geoand86
    #Quarkus #RedHat
    Quarkus core
    Hibernate
    JAX-RS
    Netty
    JWT
    gRPC
    Elasticsearch
    Apache Camel

    View full-size slide

  13. @holly_cummins @geoand86
    #Quarkus #RedHat
    Quarkus core
    Hibernate
    JAX-RS
    Netty
    JWT
    gRPC
    Elasticsearch
    Apache Camel

    View full-size slide

  14. @holly_cummins @geoand86
    #Quarkus #RedHat
    Quarkus core
    Hibernate
    JAX-RS
    Netty
    JWT
    gRPC
    Elasticsearch
    Netty
    extension
    Apache Camel

    View full-size slide

  15. @holly_cummins @geoand86
    #Quarkus #RedHat
    Quarkus core
    Hibernate
    JAX-RS
    Netty
    JWT
    gRPC
    Elasticsearch
    Netty
    extension
    Apache Camel

    View full-size slide

  16. @holly_cummins @geoand86
    #Quarkus #RedHat
    Quarkus core
    Hibernate
    JAX-RS
    Netty
    JWT
    gRPC
    Elasticsearch
    Netty
    extension
    JAX-RS
    extension
    Apache Camel

    View full-size slide

  17. @holly_cummins @geoand86
    #Quarkus #RedHat
    Quarkus core
    Hibernate
    JAX-RS
    Netty
    JWT
    gRPC
    Elasticsearch
    Netty
    extension
    JAX-RS
    extension
    Apache Camel

    View full-size slide

  18. @holly_cummins @geoand86
    #Quarkus #RedHat
    Quarkus core
    Hibernate
    JAX-RS
    Netty
    JWT
    gRPC
    Elasticsearch
    Netty
    extension
    JAX-RS
    extension
    Elasticsearch
    extension
    Apache Camel

    View full-size slide

  19. @holly_cummins @geoand86
    #Quarkus #RedHat
    Quarkus core
    Hibernate
    JAX-RS
    Netty
    JWT
    gRPC
    Elasticsearch
    Netty
    extension
    JAX-RS
    extension
    Elasticsearch
    extension
    Apache Camel

    View full-size slide

  20. @holly_cummins @geoand86
    #Quarkus #RedHat
    Quarkus core
    Hibernate
    JAX-RS
    Netty
    JWT
    gRPC
    Elasticsearch
    Netty
    extension
    JAX-RS
    extension
    Elasticsearch
    extension
    Hibernate
    extension
    Apache Camel

    View full-size slide

  21. @holly_cummins @geoand86
    #Quarkus #RedHat
    Quarkus core
    Hibernate
    JAX-RS
    Netty
    JWT
    gRPC
    Elasticsearch
    Netty
    extension
    JAX-RS
    extension
    Elasticsearch
    extension
    Hibernate
    extension
    Apache Camel

    View full-size slide

  22. @holly_cummins @geoand86
    #Quarkus #RedHat
    Quarkus core
    Hibernate
    JAX-RS
    Netty
    JWT
    gRPC
    Elasticsearch
    Netty
    extension
    JAX-RS
    extension
    Elasticsearch
    extension
    Hibernate
    extension
    Apache Camel
    Camel
    extension

    View full-size slide

  23. @holly_cummins @geoand86
    #Quarkus #RedHat
    Quarkus core
    Hibernate
    JAX-RS
    Netty
    JWT
    gRPC
    Elasticsearch
    Netty
    extension
    JAX-RS
    extension
    Elasticsearch
    extension
    Hibernate
    extension
    Apache Camel
    Camel
    extension

    View full-size slide

  24. @holly_cummins @geoand86
    #Quarkus #RedHat
    Quarkus core
    Hibernate
    JAX-RS
    Netty
    JWT
    gRPC
    Elasticsearch
    JWT
    extension
    Netty
    extension
    JAX-RS
    extension
    Elasticsearch
    extension
    Hibernate
    extension
    Apache Camel
    Camel
    extension

    View full-size slide

  25. @holly_cummins @geoand86
    #Quarkus #RedHat
    Quarkus core
    Hibernate
    JAX-RS
    Netty
    JWT
    gRPC
    Elasticsearch
    JWT
    extension
    Netty
    extension
    JAX-RS
    extension
    Elasticsearch
    extension
    Hibernate
    extension
    Apache Camel
    Camel
    extension

    View full-size slide

  26. @holly_cummins @geoand86
    #Quarkus #RedHat
    Quarkus core
    Hibernate
    JAX-RS
    Netty
    JWT
    gRPC
    Elasticsearch
    gRPC
    extension
    JWT
    extension
    Netty
    extension
    JAX-RS
    extension
    Elasticsearch
    extension
    Hibernate
    extension
    Apache Camel
    Camel
    extension

    View full-size slide

  27. @holly_cummins @geoand86
    #Quarkus #RedHat
    Quarkus core
    Hibernate
    JAX-RS
    Netty
    JWT
    gRPC
    Elasticsearch
    gRPC
    extension
    JWT
    extension
    Netty
    extension
    JAX-RS
    extension
    Elasticsearch
    extension
    Hibernate
    extension
    Apache Camel
    Camel
    extension

    View full-size slide

  28. @holly_cummins @geoand86
    #Quarkus #RedHat
    Quarkus core
    Hibernate
    JAX-RS
    Netty
    JWT
    gRPC
    Elasticsearch
    gRPC
    extension
    JWT
    extension
    Netty
    extension
    JAX-RS
    extension
    Elasticsearch
    extension
    Hibernate
    extension
    lots more
    extensions
    Apache Camel
    Camel
    extension

    View full-size slide

  29. @holly_cummins @geoand86
    #Quarkus #RedHat
    Quarkus core
    Hibernate
    JAX-RS
    Netty
    JWT
    gRPC
    Elasticsearch
    gRPC
    extension
    JWT
    extension
    Netty
    extension
    JAX-RS
    extension
    Elasticsearch
    extension
    Hibernate
    extension
    lots more
    extensions
    Apache Camel
    Camel
    extension

    quarkiverse

    View full-size slide

  30. @holly_cummins @geoand86
    #Quarkus #RedHat
    why?

    View full-size slide

  31. @holly_cummins @geoand86
    #Quarkus #RedHat
    reminder:


    what makes quarkus special

    View full-size slide

  32. traditional way vs quarkus way
    @

    @
    >
    build time
    runtime

    View full-size slide

  33. @

    @
    >
    traditional way vs quarkus way
    @

    @
    >
    build time
    runtime
    build time

    View full-size slide

  34. @

    @
    >
    traditional way vs quarkus way
    @

    @
    >
    build time
    runtime
    runtime
    build time

    View full-size slide

  35. the quarkus way enables native compilation
    native
    @

    @
    >
    JVM
    build time

    View full-size slide

  36. 9
    but … for a normal framework …

    View full-size slide

  37. 9
    they load way too many classes
    but … for a normal framework …

    View full-size slide

  38. 9
    they load way too many classes
    they are way too dynamic
    but … for a normal framework …

    View full-size slide

  39. 9
    they load way too many classes
    they are way too dynamic
    (which means they use way too much reflection)
    but … for a normal framework …

    View full-size slide

  40. 9
    they load way too many classes
    they are way too dynamic
    (which means they use way too much reflection)
    they perform a lot of initialization at runtime
    but … for a normal framework …

    View full-size slide

  41. @

    @
    >
    Packaging

    (maven, gradle…)
    build time
    runtime
    how does a framework start?

    View full-size slide

  42. @

    @
    >
    Load and parse config files,
    properties, yaml, xml, etc.
    build time
    runtime
    how does a framework start?

    View full-size slide

  43. @

    @
    >
    Classpath scanning and
    annotation discovery


    Attempt to load class to


    enable/disable features
    build time
    runtime
    how does a framework start?

    View full-size slide

  44. @

    @
    >
    Build its metamodel
    of the world.
    build time
    runtime
    how does a framework start?

    View full-size slide

  45. @

    @
    >
    Start thread pools,
    IO, etc.
    build time
    runtime
    how does a framework start?

    View full-size slide

  46. Do the work once, not at each start


    Get rid of all bootstrap classes


    Less time to start, less memory needed


    Less or no reflection nor dynamic proxies
    what if we initialize at build time?

    View full-size slide

  47. @

    @
    >
    build time
    Do the work once, not at each start


    Get rid of all bootstrap classes


    Less time to start, less memory needed


    Less or no reflection nor dynamic proxies
    what if we initialize at build time?

    View full-size slide

  48. @

    @
    >
    runtime
    build time
    Do the work once, not at each start


    Get rid of all bootstrap classes


    Less time to start, less memory needed


    Less or no reflection nor dynamic proxies
    what if we initialize at build time?

    View full-size slide

  49. and another thing

    View full-size slide

  50. and another thing

    View full-size slide

  51. and another thing
    developer experience

    View full-size slide

  52. and another thing
    developer experience
    developer joy

    View full-size slide

  53. “while we’re manipulating the
    bytecode to support native, why
    don’t we make coding … easier?”
    [warning: may not actually be Quarkus origin story]

    View full-size slide

  54. automagic dev instances (“dev services”)


    unified config


    opinionated shortcuts
    joy comes in several forms:

    View full-size slide

  55. @holly_cummins @geoand86
    #Quarkus #RedHat
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-
    instance"
    version="3.0"
    xsi:schemalocation="https://jakarta.ee/xml/ns/
    persistence https://jakarta.ee/xml/ns/persistence/
    persistence_3_0.xsd">




    persistence.xml
    hibernate extension

    View full-size slide

  56. @holly_cummins @geoand86
    #Quarkus #RedHat
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-
    instance"
    version="3.0"
    xsi:schemalocation="https://jakarta.ee/xml/ns/
    persistence https://jakarta.ee/xml/ns/persistence/
    persistence_3_0.xsd">




    persistence.xml
    hibernate extension
    the hibernate extension makes this go away

    View full-size slide

  57. @holly_cummins @geoand86
    #Quarkus #RedHat

    View full-size slide

  58. @holly_cummins @geoand86
    #Quarkus #RedHat
    dynamic-but-static

    View full-size slide

  59. @holly_cummins @geoand86
    #Quarkus #RedHat
    dynamic-but-static
    “wouldn’t it be nice if …

    … but it’s too expensive to do it at runtime.”

    View full-size slide

  60. @holly_cummins @geoand86
    #Quarkus #RedHat
    public class CassandraConnector {
    private Cluster cluster;
    private Session session;
    public void connect(String node, Integer port) {
    Builder b = Cluster.builder().addContactPoint(node);
    if (port != null) {
    b.withPort(port);
    }
    cluster = b.build();
    session = cluster.connect();
    }
    public Session getSession() {
    return this.session;
    }
    public void close() {
    session.close();
    cluster.close();
    }
    }

    View full-size slide

  61. @holly_cummins @geoand86
    #Quarkus #RedHat
    public class CassandraConnector {
    private Cluster cluster;
    private Session session;
    public void connect(String node, Integer port) {
    Builder b = Cluster.builder().addContactPoint(node);
    if (port != null) {
    b.withPort(port);
    }
    cluster = b.build();
    session = cluster.connect();
    }
    public Session getSession() {
    return this.session;
    }
    public void close() {
    session.close();
    cluster.close();
    }
    }
    @Inject
    private QuarkusCqlSession session;

    View full-size slide

  62. @holly_cummins @geoand86
    #Quarkus #RedHat
    “opinionated choices
    and educated guesses.”

    View full-size slide

  63. @holly_cummins @geoand86
    #Quarkus #RedHat
    recap: why extensions?
    • good behaviour in native mode


    • fast behaviour in normal mode (pre-do all the things)


    • good dev experience

    View full-size slide

  64. @geoand86 @holly_cummins
    #Quarkus #RedHat

    View full-size slide

  65. @geoand86 @holly_cummins
    #Quarkus #RedHat

    View full-size slide

  66. @geoand86 @holly_cummins
    #Quarkus #RedHat

    View full-size slide

  67. @geoand86 @holly_cummins
    #Quarkus #RedHat

    View full-size slide

  68. @holly_cummins @geoand86
    #Quarkus #RedHat
    why write a new extension?
    • the community hasn’t written one yet


    • it’s your library


    • support a use case particular to your environment

    View full-size slide

  69. @holly_cummins @geoand86
    #Quarkus #RedHat
    “hook a build step?”

    View full-size slide

  70. @holly_cummins @geoand86
    #Quarkus #RedHat
    “hook a build step?”

    View full-size slide

  71. @holly_cummins @geoand86
    #Quarkus #RedHat
    “hook a build step?”

    View full-size slide

  72. @holly_cummins @geoand86
    #Quarkus #RedHat
    how?

    View full-size slide

  73. @holly_cummins @geoand86
    #Quarkus #RedHat
    extension concept
    deployment


    +


    runtime

    View full-size slide

  74. @holly_cummins @geoand86
    #Quarkus #RedHat
    extension concept
    build phase


    +


    startup phase

    View full-size slide

  75. @holly_cummins @geoand86
    #Quarkus #RedHat
    Quarkus

    View full-size slide

  76. @holly_cummins @geoand86
    #Quarkus #RedHat
    Quarkus
    deployment

    View full-size slide

  77. @holly_cummins @geoand86
    #Quarkus #RedHat
    Quarkus
    deployment runtime

    View full-size slide

  78. @holly_cummins @geoand86
    #Quarkus #RedHat
    Quarkus
    deployment runtime

    View full-size slide

  79. @holly_cummins @geoand86
    #Quarkus #RedHat
    Quarkus
    deployment runtime
    bytecode

    View full-size slide

  80. @holly_cummins @geoand86
    #Quarkus #RedHat
    Quarkus
    deployment runtime
    bytecode
    extension

    View full-size slide

  81. @holly_cummins @geoand86
    #Quarkus #RedHat
    Quarkus
    deployment runtime
    bytecode
    extension


    deployment

    View full-size slide

  82. @holly_cummins @geoand86
    #Quarkus #RedHat
    Quarkus
    deployment runtime
    bytecode
    extension


    deployment runtime

    View full-size slide

  83. @holly_cummins @geoand86
    #Quarkus #RedHat
    Quarkus
    deployment runtime
    bytecode
    extension


    deployment runtime

    View full-size slide

  84. @holly_cummins @geoand86
    #Quarkus #RedHat
    Quarkus
    deployment runtime
    bytecode
    extension


    deployment runtime

    View full-size slide

  85. @holly_cummins @geoand86
    #Quarkus #RedHat
    Quarkus
    deployment runtime
    bytecode
    extension


    deployment runtime
    bytecode

    View full-size slide

  86. @holly_cummins @geoand86
    #Quarkus #RedHat
    deployment

    View full-size slide

  87. @holly_cummins @geoand86
    #Quarkus #RedHat
    understand app
    deployment

    View full-size slide

  88. @holly_cummins @geoand86
    #Quarkus #RedHat
    understand app
    convert annotations to bytecode
    deployment

    View full-size slide

  89. @holly_cummins @geoand86
    #Quarkus #RedHat
    understand app
    convert annotations to bytecode
    optimize
    deployment

    View full-size slide

  90. @holly_cummins @geoand86
    #Quarkus #RedHat
    extension concept
    build steps


    +


    build items

    View full-size slide

  91. @holly_cummins @geoand86
    #Quarkus #RedHat

    View full-size slide

  92. @holly_cummins @geoand86
    #Quarkus #RedHat
    build steps

    View full-size slide

  93. @holly_cummins @geoand86
    #Quarkus #RedHat

    View full-size slide

  94. @holly_cummins @geoand86
    #Quarkus #RedHat
    build items

    View full-size slide

  95. @holly_cummins @geoand86
    #Quarkus #RedHat

    View full-size slide

  96. @holly_cummins @geoand86
    #Quarkus #RedHat
    framework automatically
    determines correct execution
    order and injects parameters

    View full-size slide

  97. @holly_cummins @geoand86
    #Quarkus #RedHat
    build items are communication
    mechanism between build steps
    framework automatically
    determines correct execution
    order and injects parameters

    View full-size slide

  98. @holly_cummins @geoand86
    #Quarkus #RedHat
    initial state build items intermediate state build items terminal state build items

    View full-size slide

  99. @holly_cummins @geoand86
    #Quarkus #RedHat
    initial state build items
    JarResultBuildStep
    intermediate state build items terminal state build items

    View full-size slide

  100. @holly_cummins @geoand86
    #Quarkus #RedHat
    initial state build items
    JarResultBuildStep
    GeneratedResourceBuildItem
    intermediate state build items terminal state build items

    View full-size slide

  101. @holly_cummins @geoand86
    #Quarkus #RedHat
    initial state build items
    JarResultBuildStep
    GeneratedResourceBuildItem
    ConfigClassBuildItem
    intermediate state build items terminal state build items

    View full-size slide

  102. @holly_cummins @geoand86
    #Quarkus #RedHat
    initial state build items
    JarResultBuildStep
    GeneratedResourceBuildItem
    ConfigClassBuildItem
    UnremovableBeanBuildItem
    intermediate state build items terminal state build items

    View full-size slide

  103. @holly_cummins @geoand86
    #Quarkus #RedHat
    initial state build items
    JarResultBuildStep
    GeneratedResourceBuildItem
    ConfigClassBuildItem
    UnremovableBeanBuildItem
    BuildSystemTargetBuildItem
    intermediate state build items terminal state build items

    View full-size slide

  104. @holly_cummins @geoand86
    #Quarkus #RedHat
    initial state build items
    JarResultBuildStep
    GeneratedResourceBuildItem
    ConfigClassBuildItem
    UnremovableBeanBuildItem
    BuildSystemTargetBuildItem
    LaunchModeBuildItem
    intermediate state build items terminal state build items

    View full-size slide

  105. @holly_cummins @geoand86
    #Quarkus #RedHat
    initial state build items
    JarResultBuildStep
    GeneratedResourceBuildItem
    ConfigClassBuildItem
    UnremovableBeanBuildItem
    BuildSystemTargetBuildItem
    LaunchModeBuildItem
    most extensions do stuff here
    intermediate state build items terminal state build items

    View full-size slide

  106. @holly_cummins @geoand86
    #Quarkus #RedHat
    what kind of things
    can build items do?
    Create a servlet


    Create a route


    Pull an external bean into the closed world


    Turn one annotation into another


    Add a log handler


    Read an extra application archive


    Flag a capability as present


    Interact with Kubernetes



    View full-size slide

  107. @holly_cummins @geoand86
    #Quarkus #RedHat
    existing build items
    cover almost all needs
    like a library for extension writers

    View full-size slide

  108. @holly_cummins @geoand86
    #Quarkus #RedHat

    View full-size slide

  109. @holly_cummins @geoand86
    #Quarkus #RedHat
    extension concept
    index

    View full-size slide

  110. @holly_cummins @geoand86
    #Quarkus #RedHat
    extension concept
    index

    View full-size slide

  111. @holly_cummins @geoand86
    #Quarkus #RedHat
    extension concept
    index
    eliminates need for runtime classpath scanning

    View full-size slide

  112. @holly_cummins @geoand86
    #Quarkus #RedHat
    extension concept
    index
    “jandex”
    eliminates need for runtime classpath scanning

    View full-size slide

  113. @holly_cummins @geoand86
    #Quarkus #RedHat
    open world closed world

    View full-size slide

  114. @holly_cummins @geoand86
    #Quarkus #RedHat
    open world closed world
    hard to build-time optimise

    View full-size slide

  115. @holly_cummins @geoand86
    #Quarkus #RedHat
    open world closed world
    hard to build-time optimise easy to build-time optimise

    View full-size slide

  116. @holly_cummins @geoand86
    #Quarkus #RedHat
    open world closed world
    hard to build-time optimise easy to build-time optimise
    runtime class surprise!

    View full-size slide

  117. @holly_cummins @geoand86
    #Quarkus #RedHat
    open world closed world
    hard to build-time optimise easy to build-time optimise
    runtime class surprise!

    View full-size slide

  118. @holly_cummins @geoand86
    #Quarkus #RedHat
    open world closed world
    hard to build-time optimise easy to build-time optimise
    no worries
    runtime class surprise!

    View full-size slide

  119. @holly_cummins @geoand86
    #Quarkus #RedHat
    open world closed world
    hard to build-time optimise easy to build-time optimise
    no worries
    runtime class surprise!

    View full-size slide

  120. @holly_cummins @geoand86
    #Quarkus #RedHat
    open world closed world
    hard to build-time optimise easy to build-time optimise
    uh oh, this is outside
    our closed world
    no worries
    runtime class surprise!

    View full-size slide

  121. @holly_cummins @geoand86
    #Quarkus #RedHat
    AdditionalBeanBuildItem


    View full-size slide

  122. @holly_cummins @geoand86
    #Quarkus #RedHat
    AdditionalBeanBuildItem


    View full-size slide

  123. @holly_cummins @geoand86
    #Quarkus #RedHat
    extension concept
    bytecode recording
    easier than writing ASM


    (if recording isn’t optimised enough,
    use Gizmo to hand-craft bytecode)

    View full-size slide

  124. Example
    @Recorder


    public class CaffeineCacheBuildRecorder {


    // a proxy of this is invoked at build time


    // the “real” invocation happens at runtime with the CaffeineCacheInfo obtained at build time


    public Supplier getCacheManagerSupplier(Set cacheInfos) {


    return new Supplier() {


    @Override


    public CacheManager get() {


    if (cacheInfos.isEmpty()) {


    return new CacheManagerImpl(Collections.emptyMap());


    } else {


    Map caches = new HashMap<>(cacheInfos.size() + 1, 1.0F);


    for (CaffeineCacheInfo cacheInfo : cacheInfos) {


    CaffeineCache cache = new CaffeineCache(cacheInfo);


    caches.put(cacheInfo.name, cache);


    }


    return new CacheManagerImpl(caches);


    }


    }


    };


    }


    }

    View full-size slide

  125. @holly_cummins @geoand86
    #Quarkus #RedHat
    extension concept
    configuration

    View full-size slide

  126. @holly_cummins @geoand86
    #Quarkus #RedHat
    Quarkus

    View full-size slide

  127. @holly_cummins @geoand86
    #Quarkus #RedHat
    Quarkus
    deployment

    View full-size slide

  128. @holly_cummins @geoand86
    #Quarkus #RedHat
    Quarkus
    deployment runtime

    View full-size slide

  129. @holly_cummins @geoand86
    #Quarkus #RedHat
    Quarkus
    deployment runtime
    extension

    View full-size slide

  130. @holly_cummins @geoand86
    #Quarkus #RedHat
    Quarkus
    deployment runtime
    extension


    deployment

    View full-size slide

  131. @holly_cummins @geoand86
    #Quarkus #RedHat
    Quarkus
    deployment runtime
    extension


    deployment runtime

    View full-size slide

  132. @holly_cummins @geoand86
    #Quarkus #RedHat
    Quarkus
    deployment runtime
    extension


    deployment runtime
    config
    config

    View full-size slide

  133. @holly_cummins @geoand86
    #Quarkus #RedHat
    Quarkus
    deployment runtime
    extension


    deployment runtime
    config
    config
    config
    config

    View full-size slide

  134. @holly_cummins @geoand86
    #Quarkus #RedHat
    Quarkus
    deployment runtime
    extension


    deployment runtime
    config
    config
    config
    config

    View full-size slide

  135. @holly_cummins @geoand86
    #Quarkus #RedHat
    demo

    View full-size slide

  136. @holly_cummins @geoand86
    #Quarkus #RedHat
    demo: recap

    View full-size slide

  137. @holly_cummins @geoand86
    #Quarkus #RedHat
    https://github.com/holly-cummins/quarkus-minecraft-observability-extension

    View full-size slide

  138. @holly_cummins @geoand86
    #Quarkus #RedHat

    View full-size slide

  139. @holly_cummins @geoand86
    #Quarkus #RedHat

    View full-size slide

  140. @holly_cummins @geoand86
    #Quarkus #RedHat

    View full-size slide

  141. @holly_cummins @geoand86
    #Quarkus #RedHat
    https://github.com/holly-cummins/
    quarkus-minecraft-observability-extension

    View full-size slide

  142. @holly_cummins @geoand86
    #Quarkus #RedHat
    extension concept
    GraalVM
    ● Contribute GraalVM configuration


    ○ Reflection registration


    ○ Dynamic proxy registration


    ○ Resource files


    ○ Message bundles


    ○ Etc.

    ● Provide substitutions


    ○ Pieces of code that are used in place of regular library code when
    in native mode

    View full-size slide

  143. Substitutions
    @TargetClass(org.infinispan.client.hotrod.impl.RemoteCacheImpl.class)


    public final class SubstituteRemoteCacheImpl {


    @Delete


    private ObjectName mbeanObjectName;


    @Substitute


    private void registerMBean(ObjectName jmxParent) {


    }


    @Substitute


    private void unregisterMBean() {


    }


    @Delete


    public void init(OperationsFactory operationsFactory, Configuration configuration, ObjectName
    jmxParent) {


    }


    }

    View full-size slide

  144. Real world examples
    ● Jackson extension

    ● Hibernate Validator extension

    ● Spring DI extension


    Resources
    ● http:/
    /quarkus.io


    ● https:/
    /quarkus.io/guides/all-builditems


    ● https:/
    /quarkus.io/blog/quarkus-aws-cloudwatch_extension/


    ● https:/
    /quarkus.io/blog/solving-problems-with-custom-extensions/

    View full-size slide

  145. ®
    thank you


    @holly_cummins


    @geoand86
    https://github.com/holly-
    cummins/quarkus-minecraft-
    observability-extension
    code

    View full-size slide