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 Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View 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 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 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 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 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 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 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 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 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 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 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 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 Slide

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

    View Slide

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


    what makes quarkus special

    View Slide

  32. traditional way vs quarkus way
    @

    @
    >
    build time
    runtime

    View Slide

  33. @

    @
    >
    traditional way vs quarkus way
    @

    @
    >
    build time
    runtime
    build time

    View Slide

  34. @

    @
    >
    traditional way vs quarkus way
    @

    @
    >
    build time
    runtime
    runtime
    build time

    View Slide

  35. the quarkus way enables native compilation
    native
    @

    @
    >
    JVM
    build time

    View Slide

  36. 9
    but … for a normal framework …

    View Slide

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

    View Slide

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

    View 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 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 Slide

  41. @

    @
    >
    Packaging

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

    View Slide

  42. @

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

    View Slide

  43. @

    @
    >
    Classpath scanning and
    annotation discovery


    Attempt to load class to


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

    View Slide

  44. @

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

    View Slide

  45. @

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

    View 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 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 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 Slide

  49. and another thing

    View Slide

  50. and another thing

    View Slide

  51. and another thing
    developer experience

    View Slide

  52. and another thing
    developer experience
    developer joy

    View 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 Slide

  54. automagic dev instances (“dev services”)


    unified config


    opinionated shortcuts
    joy comes in several forms:

    View 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 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 Slide

  57. @holly_cummins @geoand86
    #Quarkus #RedHat

    View Slide

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

    View 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 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 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 Slide

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

    View 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 Slide

  64. @geoand86 @holly_cummins
    #Quarkus #RedHat

    View Slide

  65. @geoand86 @holly_cummins
    #Quarkus #RedHat

    View Slide

  66. @geoand86 @holly_cummins
    #Quarkus #RedHat

    View Slide

  67. @geoand86 @holly_cummins
    #Quarkus #RedHat

    View 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 Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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


    +


    runtime

    View Slide

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


    +


    startup phase

    View Slide

  75. @holly_cummins @geoand86
    #Quarkus #RedHat
    Quarkus

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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


    deployment

    View Slide

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


    deployment runtime

    View Slide

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


    deployment runtime

    View Slide

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


    deployment runtime

    View Slide

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


    deployment runtime
    bytecode

    View Slide

  86. @holly_cummins @geoand86
    #Quarkus #RedHat
    deployment

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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


    +


    build items

    View Slide

  91. @holly_cummins @geoand86
    #Quarkus #RedHat

    View Slide

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

    View Slide

  93. @holly_cummins @geoand86
    #Quarkus #RedHat

    View Slide

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

    View Slide

  95. @holly_cummins @geoand86
    #Quarkus #RedHat

    View Slide

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

    View 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 Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View 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 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 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 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 Slide

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

    View Slide

  108. @holly_cummins @geoand86
    #Quarkus #RedHat

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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

    View 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 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 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 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 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 Slide

  121. @holly_cummins @geoand86
    #Quarkus #RedHat
    AdditionalBeanBuildItem


    View Slide

  122. @holly_cummins @geoand86
    #Quarkus #RedHat
    AdditionalBeanBuildItem


    View 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 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 Slide

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

    View Slide

  126. @holly_cummins @geoand86
    #Quarkus #RedHat
    Quarkus

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

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


    deployment

    View Slide

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


    deployment runtime

    View Slide

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


    deployment runtime
    config
    config

    View Slide

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


    deployment runtime
    config
    config
    config
    config

    View Slide

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


    deployment runtime
    config
    config
    config
    config

    View Slide

  135. @holly_cummins @geoand86
    #Quarkus #RedHat
    demo

    View Slide

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

    View Slide

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

    View Slide

  138. @holly_cummins @geoand86
    #Quarkus #RedHat

    View Slide

  139. @holly_cummins @geoand86
    #Quarkus #RedHat

    View Slide

  140. @holly_cummins @geoand86
    #Quarkus #RedHat

    View Slide

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

    View 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 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 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 Slide

  145. ®
    thank you


    @holly_cummins


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

    View Slide