From 8fb3c54e43c58a5d29541a470adc6e5ce90ae304 Mon Sep 17 00:00:00 2001 From: gsmet Date: Fri, 14 Jul 2023 03:15:04 +0000 Subject: [PATCH] deploy: b43f26e3ebb13ca1c3131343034beacfff3826b3 --- feed.xml | 2 +- version/main/guides/cdi-reference.html | 230 +++++++------------- version/main/guides/datasource.html | 5 +- version/main/guides/duplicated-context.html | 13 +- version/main/guides/index.html | 40 ++-- version/main/guides/transaction.html | 57 ++++- 6 files changed, 163 insertions(+), 184 deletions(-) diff --git a/feed.xml b/feed.xml index e3c7d99183..e8442aebb7 100644 --- a/feed.xml +++ b/feed.xml @@ -5,7 +5,7 @@ Quarkus https://quarkus.io Quarkus: Supersonic Subatomic Java - Thu, 13 Jul 2023 14:11:58 +0000 + Fri, 14 Jul 2023 03:13:44 +0000 On the Road to CDI Compatibility diff --git a/version/main/guides/cdi-reference.html b/version/main/guides/cdi-reference.html index 0334e44ad5..48e0736d6d 100644 --- a/version/main/guides/cdi-reference.html +++ b/version/main/guides/cdi-reference.html @@ -174,39 +174,38 @@

Contexts and Dependency Injection

  • 2. Native Executables and Private Members
  • -
  • 3. Supported Features
  • -
  • 4. Limitations
  • -
  • 5. Non-standard Features +
  • 3. Supported Features and Limitations
  • +
  • 4. Non-standard Features
  • -
  • 6. Build Time Extensions
  • -
  • 7. Development Mode +
  • 5. Build Time Extensions
  • +
  • 6. Development Mode
  • -
  • 8. Strict Mode
  • -
  • 9. ArC Configuration Reference
  • +
  • 7. Strict Mode
  • +
  • 8. ArC Configuration Reference
  • @@ -215,7 +214,7 @@

    Contexts and Dependency Injection

    Quarkus DI solution (also called ArC) is based on the Jakarta Contexts and Dependency Injection 4.0 specification. It implements the CDI Lite specification, with selected improvements on top, and passes the CDI Lite TCK. It does not implement CDI Full. -See also the list of supported features and the list of limitations.

    +See also the list of supported features and limitations.

    @@ -535,136 +534,67 @@

    -

    3. Supported Features

    +

    3. Supported Features and Limitations

    +
    +

    The CDI Lite specification is fully supported. +The following features from CDI Full are also supported:

    +
    • -

      Programming model

      -
      -
        -
      • -

        Managed beans implemented by a Java class

        +

        Decorators

        • -

          @PostConstruct and @PreDestroy lifecycle callbacks

          -
        • -
        -
        -
      • -
      • -

        Producer methods and fields, disposers

        -
      • -
      • -

        Qualifiers

        -
      • -
      • -

        Alternatives

        -
      • -
      • -

        Stereotypes

        +

        Decoration of built-in beans, such as Event, is not supported

    • -

      Dependency injection and lookup

      +

      BeanManager

      • -

        Field, constructor and initializer/setter injection

        -
      • -
      • -

        Type-safe resolution

        -
      • -
      • -

        Programmatic lookup via jakarta.enterprise.inject.Instance

        -
      • -
      • -

        Client proxies

        -
      • -
      • -

        Injection point metadata

        +

        In addition to the BeanContainer methods, the following methods are supported: getInjectableReference(), resolveDecorators()

    • -

      Scopes and contexts; see here for details

      -
    • -
    • -

      Interceptors

      +

      @SessionScoped

      • -

        Business method interceptors: @AroundInvoke

        -
      • -
      • -

        Interceptors for lifecycle event callbacks: @PostConstruct, @PreDestroy, @AroundConstruct

        +

        Only with the Undertow extension; see here for details

    • -
    • -

      Decorators

      -
    • -
    • -

      Events and observer methods, including asynchronous events and transactional observer methods

      -
    • -
    • -

      Build Compatible Extensions

      -
    • -
    • -

      BeanContainer

      -
    -
    - -
    -

    4. Limitations

    -
    -
    -
      -
    • -

      @ConversationScoped is not supported

      -
    • -
    • -

      Portable Extensions are not supported

      -
    • -
    • -

      BeanManager: in addition to the BeanContainer methods, only the following methods are supported: getInjectableReference(), resolveDecorators()

      -
    • -
    • -

      Specialization is not supported

      -
    • -
    • -

      beans.xml descriptor content is ignored, except for the bean-discovery-mode attribute

      -
    • -
    • -

      Passivation and passivating scopes are not supported

      -
    • -
    • -

      Interceptor methods on superclasses are not implemented yet

      -
    • -
    • -

      @Interceptors is not supported

      -
    • -
    • -

      Decoration of built-in beans, such as Event, is not supported

      -
    • -
    +
    +
    + + + + +
    + + +These additional features are not covered by the CDI Lite TCK. +
    -

    5. Non-standard Features

    +

    4. Non-standard Features

    -

    5.1. Eager Instantiation of Beans

    +

    4.1. Eager Instantiation of Beans

    -

    5.1.1. Lazy By Default

    +

    4.1.1. Lazy By Default

    By default, CDI beans are created lazily, when needed. What exactly "needed" means depends on the scope of a bean.

    @@ -733,7 +663,7 @@

    5.1.1. La

    -

    5.1.2. Startup Event

    +

    4.1.2. Startup Event

    However, if you really need to instantiate a bean eagerly you can:

    @@ -831,7 +761,7 @@

    5.1.2. Startu

    -

    5.2. Request Context Lifecycle

    +

    4.2. Request Context Lifecycle

    The request context is also active:

    @@ -865,7 +795,7 @@

    -

    5.2.1. How to Enable Trace Logging for Request Context Activation

    +

    4.2.1. How to Enable Trace Logging for Request Context Activation

    You can set the TRACE level for the logger io.quarkus.arc.requestContext and try to analyze the log output afterwards.

    @@ -887,7 +817,7 @@

    -

    5.3. Qualified Injected Fields

    +

    4.3. Qualified Injected Fields

    In CDI, if you declare a field injection point you need to use @Inject and optionally a set of qualifiers.

    @@ -921,7 +851,7 @@

    -

    5.4. Simplified Constructor Injection

    +

    4.4. Simplified Constructor Injection

    In CDI, a normal scoped bean must always declare a no-args constructor (this constructor is normally generated by the compiler unless you declare any other constructor). However, this requirement complicates constructor injection - you need to provide a dummy no-args constructor to make things work in CDI.

    @@ -974,7 +904,7 @@

    -

    5.5. Removing Unused Beans

    +

    4.5. Removing Unused Beans

    The container attempts to remove all unused beans, interceptors and decorators during build by default. This optimization helps to minimize the amount of generated classes, thus conserving memory. @@ -989,7 +919,7 @@

    5 To use this mode, set quarkus.arc.remove-unused-beans to fwk or framework.

    -

    5.5.1. What’s Removed?

    +

    4.5.1. What’s Removed?

    Quarkus first identifies so-called unremovable beans that form the roots in the dependency tree. A good example is a Jakarta REST resource class or a bean which declares a @Scheduled method.

    @@ -1058,7 +988,7 @@

    5.5.1. What&#

    -

    5.5.2. How To Eliminate False Positives

    +

    4.5.2. How To Eliminate False Positives

    Users can instruct the container to not remove any of their specific beans (even if they satisfy all the rules specified above) by annotating them with @io.quarkus.arc.Unremovable. This annotation can be declared on a class, a producer method or field.

    @@ -1108,7 +1038,7 @@

    -

    5.6. Default Beans

    +

    4.6. Default Beans

    Quarkus adds a capability that CDI currently does not support which is to conditionally declare a bean if no other bean with equal types and qualifiers was declared by any available means (bean class, producer, synthetic bean, …​) This is done using the @io.quarkus.arc.DefaultBean annotation and is best explained with an example.

    @@ -1163,7 +1093,7 @@

    5.6. Default

    -

    5.7. Enabling Beans for Quarkus Build Profile

    +

    4.7. Enabling Beans for Quarkus Build Profile

    Quarkus adds a capability that CDI currently does not support which is to conditionally enable a bean when a Quarkus build time profile is enabled, via the @io.quarkus.arc.profile.IfBuildProfile and @io.quarkus.arc.profile.UnlessBuildProfile annotations. @@ -1228,7 +1158,7 @@

    -

    5.8. Enabling Beans for Quarkus Build Properties

    +

    4.8. Enabling Beans for Quarkus Build Properties

    Quarkus adds a capability that CDI currently does not support which is to conditionally enable a bean when a Quarkus build time property has/has not a specific value, via the @io.quarkus.arc.properties.IfBuildProperty and @io.quarkus.arc.properties.UnlessBuildProperty annotations. @@ -1304,7 +1234,7 @@

    -

    5.9. Declaring Selected Alternatives

    +

    4.9. Declaring Selected Alternatives

    In CDI, an alternative bean may be selected either globally for an application by means of @Priority, or for a bean archive using a beans.xml descriptor. Quarkus has a simplified bean discovery and the content of beans.xml is ignored.

    @@ -1352,7 +1282,7 @@

    -

    5.10. Simplified Producer Method Declaration

    +

    4.10. Simplified Producer Method Declaration

    In CDI, a producer method must be always annotated with @Produces.

    @@ -1391,7 +1321,7 @@

    -

    5.11. Interception of Static Methods

    +

    4.11. Interception of Static Methods

    The Interceptors specification is clear that around-invoke methods must not be declared static. However, this restriction was driven mostly by technical limitations. @@ -1424,7 +1354,7 @@

    -

    5.11.1. Limitations

    +

    4.11.1. Limitations

    • @@ -1453,7 +1383,7 @@

      5.11.1. Limit

    -

    5.12. Ability to handle 'final' classes and methods

    +

    4.12. Ability to handle 'final' classes and methods

    In normal CDI, classes that are marked as final and / or have final methods are not eligible for proxy creation, which in turn means that interceptors and normal scoped beans don’t work properly. @@ -1464,7 +1394,7 @@

    -

    5.13. Container-managed Concurrency

    +

    4.13. Container-managed Concurrency

    There is no standard concurrency control mechanism for CDI beans. Nevertheless, a bean instance can be shared and accessed concurrently from multiple threads. @@ -1523,7 +1453,7 @@

    -

    5.14. Repeatable interceptor bindings

    +

    4.14. Repeatable interceptor bindings

    Quarkus has limited support for @Repeatable interceptor binding annotations.

    @@ -1580,7 +1510,7 @@

    -

    5.15. Caching the Result of Programmatic Lookup

    +

    4.15. Caching the Result of Programmatic Lookup

    In certain situations, it is practical to obtain a bean instance programmatically via an injected jakarta.enterprise.inject.Instance and Instance.get(). However, according to the specification the get() method must identify the matching bean and obtain a contextual reference. @@ -1648,7 +1578,7 @@

    -

    5.16. Declaratively Choose Beans That Can Be Obtained by Programmatic Lookup

    +

    4.16. Declaratively Choose Beans That Can Be Obtained by Programmatic Lookup

    It is sometimes useful to narrow down the set of beans that can be obtained by programmatic lookup via jakarta.enterprise.inject.Instance. Typically, a user needs to choose the appropriate implementation of an interface based on a runtime configuration property.

    @@ -1701,7 +1631,7 @@

    -

    5.17. Injecting Multiple Bean Instances Intuitively

    +

    4.17. Injecting Multiple Bean Instances Intuitively

    In CDI, it’s possible to inject multiple bean instances (aka contextual references) via the jakarta.enterprise.inject.Instance which implements java.lang.Iterable. However, it’s not exactly intuitive. @@ -1796,7 +1726,7 @@

    -

    5.18. Ignoring Class-Level Interceptor Bindings for Methods and Constructors

    +

    4.18. Ignoring Class-Level Interceptor Bindings for Methods and Constructors

    If a managed bean declares interceptor binding annotations on the class level, the corresponding @AroundInvoke interceptors will apply to all business methods. Similarly, the corresponding @AroundConstruct interceptors will apply to the bean constructor.

    @@ -1846,7 +1776,7 @@

    -

    5.19. Exceptions Thrown By An Asynchronous Observer Method

    +

    4.19. Exceptions Thrown By An Asynchronous Observer Method

    If an exception is thrown by an asynchronous observer then the CompletionStage returned by the fireAsync() method completes exceptionally so that the event producer may react appropriately. However, if the event producer does not care then the exception is ignored silently. @@ -1871,7 +1801,7 @@

    -

    6. Build Time Extensions

    +

    5. Build Time Extensions

    Quarkus incorporates build-time optimizations in order to provide instant startup and low memory footprint. @@ -1882,7 +1812,7 @@

    6. Build

    -

    7. Development Mode

    +

    6. Development Mode

    In the development mode, two special endpoints are registered automatically to provide some basic debug info in the JSON format:

    @@ -1936,7 +1866,7 @@

    7. Deve

    -

    7.1. Monitoring Business Method Invocations and Events

    +

    6.1. Monitoring Business Method Invocations and Events

    In the development mode, it is also possible to enable monitoring of business method invocations and fired events. Simply set the quarkus.arc.dev-mode.monitoring-enabled configuration property to true and explore the relevant Dev UI pages.

    @@ -1945,7 +1875,7 @@

    -

    8. Strict Mode

    +

    7. Strict Mode

    By default, ArC does not perform all validations required by the CDI specification. @@ -1986,7 +1916,7 @@

    8. Strict Mode

    -

    9. ArC Configuration Reference

    +

    8. ArC Configuration Reference

    Configuration property fixed at build time - All other configuration properties are overridable at runtime

    diff --git a/version/main/guides/datasource.html b/version/main/guides/datasource.html index 43be6ff798..2dd7e2dfd6 100644 --- a/version/main/guides/datasource.html +++ b/version/main/guides/datasource.html @@ -920,7 +920,10 @@

    -

    See the Configuration Reference section below.

    +

    For more information, see the Configuration reference section below.

    +

    +
    +

    To facilitate the storage of transaction logs in a database by using JDBC, see Configuring transaction logs to be stored in a datasource section of the Using transactions in Quarkus guide.

    Named datasources

    diff --git a/version/main/guides/duplicated-context.html b/version/main/guides/duplicated-context.html index 362254eb6d..2667babf90 100644 --- a/version/main/guides/duplicated-context.html +++ b/version/main/guides/duplicated-context.html @@ -199,7 +199,7 @@

    Duplicated context, context locals, asynchronous processin Thus, you cannot use ThreadLocals as the values would be leaked between the various concurrent processing.

    -

    Duplicated Contexts are a construct that provides the same kind of propagation but for asynchronous processing. +

    Vert.x duplicated context is a construct that provides the same kind of propagation but for asynchronous processing. It can also be used with synchronous code.

    @@ -388,7 +388,10 @@

    Con

    -
    AtomicInteger counter = new AtomicInteger();
    +
    import io.smallrye.common.vertx.ContextLocals;
    +
    +AtomicInteger counter = new AtomicInteger();
    +
     public Uni<String> invoke() {
        Context context = Vertx.currentContext();
     
    @@ -484,7 +487,7 @@ 

    With the Quarkus OpenID Connect (OIDC) extension, you can protect application HTTP endpoints by using the OIDC Authorization Code Flow mechanism.

    -
    web, security
    +
    security, web
    @@ -412,7 +412,7 @@

    Authentic

    The Quarkus Security framework supports multiple authentication mechanisms, which you can use to secure your applications.

    -
    web, security
    +
    security, web

    @@ -423,7 +423,7 @@

    Basic authenti

    HTTP Basic authentication is one of the least resource-demanding techniques that enforce access controls to web resources.

    -
    web, security
    +
    security, web

    @@ -434,7 +434,7 @@

    Duplicated context, conte

    When using a traditional, blocking, and synchronous framework, processing of each request is performed in a dedicated thread.

    -
    architecture, core
    +
    core, architecture

    @@ -456,7 +456,7 @@

    Op

    Secure HTTP access to Jakarta REST (formerly known as JAX-RS) endpoints in your application with Bearer token authentication by using the Quarkus OpenID Connect (OIDC) extension.

    -
    web, security
    +
    security, web

    @@ -467,7 +467,7 @@

    OpenI

    To protect your web applications, you can use the industry-standard OpenID Connect (OIDC) Authorization Code Flow mechanism provided by the Quarkus OIDC extension.

    -
    web, security
    +
    security, web

    @@ -478,7 +478,7 @@

    Proactive

    Proactive authentication is enabled in Quarkus by default.

    -
    web, security
    +
    security, web

    @@ -698,7 +698,7 @@

    A

    Quarkus has an integrated pluggable web security layer.

    -
    web, security
    +
    security, web

    @@ -720,7 +720,7 @@

    Command Mode Applicat

    This reference guide explains how to develop command line applications with Quarkus.

    -
    command-line, core
    +
    core, command-line

    @@ -742,7 +742,7 @@

    Configure data sources in Quarkus

    Use a unified configuration model to define datasources for Java Database Connectivity (JDBC) and Reactive drivers.

    -
    data, getting-started
    +
    getting-started, data

    @@ -894,7 +894,7 @@

    Logging configuration

    Read about the use of logging API in Quarkus, configuring logging output, and using logging adapters to unify the output from other logging APIs.

    -
    getting-started, core
    +
    core, getting-started
    @@ -1280,7 +1280,7 @@

    AppCDS

    This reference guide explains how to enable AppCDS with Quarkus.

    -
    cloud, core
    +
    core, cloud
    @@ -1544,7 +1544,7 @@

    Deploying on OpenShif

    This guide covers how to deploy a native application on OpenShift.

    -
    cloud, native
    +
    native, cloud

    @@ -2072,7 +2072,7 @@

    Kubernetes extension

    This guide covers how to deploy a native application on Kubernetes.

    -
    cloud, native
    +
    native, cloud

    @@ -2314,7 +2314,7 @@

    Quarkus and Gradle

    Develop and build your Quarkus application with Gradle

    -
    tooling, native
    +
    native, tooling
    @@ -2325,7 +2325,7 @@

    Quarkus and Maven

    Develop and build your Quarkus application with Maven

    -
    tooling, native
    +
    native, tooling
    @@ -2567,7 +2567,7 @@

    Testing Your Applica

    This guide covers testing in JVM mode, native mode, and injection of resources into tests

    -
    tooling, core, native
    +
    core, native, tooling

    @@ -2578,7 +2578,7 @@

    Tips for wr

    This guide is a collection of tips to help you solve the problems you encounter when compiling applications to native executable.

    -
    writing-extensions, core, native
    +
    core, writing-extensions, native

    @@ -2820,7 +2820,7 @@

    Using SSL With Native Executa

    In this guide, we will discuss how you can get your native images to support SSL, as native images don’t support it out of the box.

    -
    security, core, native
    +
    core, security, native

    @@ -3040,7 +3040,7 @@

    Writing JSON REST Services

    JSON is now the lingua franca between microservices.

    -
    serialization, web
    +
    web, serialization
    diff --git a/version/main/guides/transaction.html b/version/main/guides/transaction.html index e1ccc646a5..b3ea718737 100644 --- a/version/main/guides/transaction.html +++ b/version/main/guides/transaction.html @@ -180,7 +180,7 @@

    Using Transactions in Quarkus

  • Configuring the transaction timeout
  • Configuring transaction node name identifier
  • Using @TransactionScoped to bind CDI beans to the transaction lifecycle
  • -
  • Configuring transaction log to be stored in a DataSource
  • +
  • Configure storing of Quarkus transaction logs in a database
  • Why always having a transaction manager?
  • @@ -686,16 +686,49 @@

    Using

    -

    Configuring transaction log to be stored in a DataSource

    +

    Configure storing of Quarkus transaction logs in a database

    -

    The Narayana project has the capability to store the transaction logs into a JDBC Datasource; this should be our recommendation for users needing transaction recovery capabilities, especially when running in volatile containers.

    +

    In cloud environments where persistent storage is not available, such as when application containers are unable to use persistent volumes, you can configure the transaction management to store transaction logs in a database by using a JDBC datasource.

    -
    -

    To enable this capability, you need to set quarkus.transaction-manager.object-store.type to jdbc explicitly. Also, you can specify a datasource name to be used for the transaction log storage by setting quarkus.transaction-manager.object-store.datasource. It will use the default datasource configuration if not specified.

    +
    + + + + + +
    + + +While there are several benefits to using a database to store transaction logs, you might notice a reduction in performance compared with using the file system to store the logs. +
    -

    If you enable quarkus.transaction-manager.object-store.create-table, the transaction log table will be created automatically if it does not exist.

    +

    Quarkus allows the following JDBC-specific configuration of the object store included in quarkus.transacion-manager.object-store.<property> properties, where <property> can be:

    +
    +
    +
      +
    • +

      type (string): Configure this property to jdbc to enable usage of a Quarkus JDBC datasource for transaction logging. +The default value is file-system.

      +
    • +
    • +

      datasource (string): Specify the name of the datasource for the transaction log storage. +If no value is provided for the datasource property, Quarkus uses the default datasource.

      +
    • +
    • +

      create-table (boolean): When set to true, the transaction log table gets automatically created if it does not already exist. +The default value is false.

      +
    • +
    • +

      drop-table (boolean): When set to true, the tables are dropped on startup if they already exist. +The default value is false.

      +
    • +
    • +

      table-prefix (string): Specify the prefix for a related table name. +The default value is quarkus_.

      +
    • +
    @@ -704,7 +737,17 @@

    -When enabling this capability, the transaction node identifier must be set through quarkus.transaction-manager.node-name. +
    +

    To work around the current known issue of Agroal having a different view on running transaction checks, set the datasource transaction type for the datasource responsible for writing the transaction logs to disabled:

    +
    +
    +
    +
    quarkus.datasource.TX_LOG.jdbc.transactions=disabled
    +
    +
    +
    +

    This example uses TX_LOG as the datasource name.

    +