Skip to content

Commit

Permalink
Sync documentation of main branch
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Jan 29, 2025
1 parent f6bc733 commit fd6b233
Show file tree
Hide file tree
Showing 8 changed files with 264 additions and 43 deletions.
84 changes: 63 additions & 21 deletions _generated-doc/main/config/quarkus-all-config.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -24172,6 +24172,27 @@ endif::add-copy-button-to-env-var[]
|boolean
|`false`

a| [[quarkus-hibernate-orm_quarkus-hibernate-orm-request-scoped-enabled]] [.property-path]##link:#quarkus-hibernate-orm_quarkus-hibernate-orm-request-scoped-enabled[`quarkus.hibernate-orm.request-scoped.enabled`]##
ifdef::add-copy-button-to-config-props[]
config_property_copy_button:+++quarkus.hibernate-orm.request-scoped.enabled+++[]
endif::add-copy-button-to-config-props[]


[.description]
--
Enable or disable access to a Hibernate ORM `EntityManager`/`Session`/`StatelessSession` ++*++when no transaction is active++*++ but a request scope is. When enabled, the corresponding sessions will be read-only. Defaults to enabled for backwards compatibility, but disabling this is recommended, to avoid inconsistent resulsts caused by queries running outside of transactions.


ifdef::add-copy-button-to-env-var[]
Environment variable: env_var_with_copy_button:+++QUARKUS_HIBERNATE_ORM_REQUEST_SCOPED_ENABLED+++[]
endif::add-copy-button-to-env-var[]
ifndef::add-copy-button-to-env-var[]
Environment variable: `+++QUARKUS_HIBERNATE_ORM_REQUEST_SCOPED_ENABLED+++`
endif::add-copy-button-to-env-var[]
--
|boolean
|`true`

a|icon:lock[title=Fixed at build time] [[quarkus-hibernate-orm_quarkus-hibernate-orm-datasource]] [.property-path]##link:#quarkus-hibernate-orm_quarkus-hibernate-orm-datasource[`quarkus.hibernate-orm.datasource`]##
ifdef::add-copy-button-to-config-props[]
config_property_copy_button:+++quarkus.hibernate-orm.datasource+++[]
Expand Down Expand Up @@ -61516,6 +61537,27 @@ endif::add-copy-button-to-env-var[]
|boolean
|`true`

a|icon:lock[title=Fixed at build time] [[quarkus-messaging_quarkus-messaging-request-scoped-enabled]] [.property-path]##link:#quarkus-messaging_quarkus-messaging-request-scoped-enabled[`quarkus.messaging.request-scoped.enabled`]##
ifdef::add-copy-button-to-config-props[]
config_property_copy_button:+++quarkus.messaging.request-scoped.enabled+++[]
endif::add-copy-button-to-config-props[]


[.description]
--
Whether to enable the RequestScope context on a message context


ifdef::add-copy-button-to-env-var[]
Environment variable: env_var_with_copy_button:+++QUARKUS_MESSAGING_REQUEST_SCOPED_ENABLED+++[]
endif::add-copy-button-to-env-var[]
ifndef::add-copy-button-to-env-var[]
Environment variable: `+++QUARKUS_MESSAGING_REQUEST_SCOPED_ENABLED+++`
endif::add-copy-button-to-env-var[]
--
|boolean
|`false`

a|icon:lock[title=Fixed at build time] [[quarkus-messaging_quarkus-messaging-metrics-enabled]] [.property-path]##link:#quarkus-messaging_quarkus-messaging-metrics-enabled[`quarkus.messaging.metrics.enabled`]##
ifdef::add-copy-button-to-config-props[]
config_property_copy_button:+++quarkus.messaging.metrics.enabled+++[]
Expand Down Expand Up @@ -84388,27 +84430,6 @@ h|[.extension-name]##RESTEasy Classic##
h|Type
h|Default

a|icon:lock[title=Fixed at build time] [[quarkus-resteasy_quarkus-resteasy-vertx-response-buffer-size]] [.property-path]##link:#quarkus-resteasy_quarkus-resteasy-vertx-response-buffer-size[`quarkus.resteasy.vertx.response-buffer-size`]##
ifdef::add-copy-button-to-config-props[]
config_property_copy_button:+++quarkus.resteasy.vertx.response-buffer-size+++[]
endif::add-copy-button-to-config-props[]


[.description]
--
The size of the output stream response buffer. If a response is larger than this and no content-length is provided then the request will be chunked. Larger values may give slight performance increases for large responses, at the expense of more memory usage.


ifdef::add-copy-button-to-env-var[]
Environment variable: env_var_with_copy_button:+++QUARKUS_RESTEASY_VERTX_RESPONSE_BUFFER_SIZE+++[]
endif::add-copy-button-to-env-var[]
ifndef::add-copy-button-to-env-var[]
Environment variable: `+++QUARKUS_RESTEASY_VERTX_RESPONSE_BUFFER_SIZE+++`
endif::add-copy-button-to-env-var[]
--
|int
|`8191`

a|icon:lock[title=Fixed at build time] [[quarkus-resteasy_quarkus-resteasy-gzip-enabled]] [.property-path]##link:#quarkus-resteasy_quarkus-resteasy-gzip-enabled[`quarkus.resteasy.gzip.enabled`]##
ifdef::add-copy-button-to-config-props[]
config_property_copy_button:+++quarkus.resteasy.gzip.enabled+++[]
Expand Down Expand Up @@ -84453,6 +84474,27 @@ endif::add-copy-button-to-env-var[]
|MemorySize link:#memory-size-note-anchor-all-config[icon:question-circle[title=More information about the MemorySize format]]
|`10M`

a|icon:lock[title=Fixed at build time] [[quarkus-resteasy_quarkus-resteasy-vertx-response-buffer-size]] [.property-path]##link:#quarkus-resteasy_quarkus-resteasy-vertx-response-buffer-size[`quarkus.resteasy.vertx.response-buffer-size`]##
ifdef::add-copy-button-to-config-props[]
config_property_copy_button:+++quarkus.resteasy.vertx.response-buffer-size+++[]
endif::add-copy-button-to-config-props[]


[.description]
--
The size of the output stream response buffer. If a response is larger than this and no content-length is provided then the request will be chunked. Larger values may give slight performance increases for large responses, at the expense of more memory usage.


ifdef::add-copy-button-to-env-var[]
Environment variable: env_var_with_copy_button:+++QUARKUS_RESTEASY_VERTX_RESPONSE_BUFFER_SIZE+++[]
endif::add-copy-button-to-env-var[]
ifndef::add-copy-button-to-env-var[]
Environment variable: `+++QUARKUS_RESTEASY_VERTX_RESPONSE_BUFFER_SIZE+++`
endif::add-copy-button-to-env-var[]
--
|int
|`8191`

a|icon:lock[title=Fixed at build time] [[quarkus-resteasy_quarkus-resteasy-json-json-default]] [.property-path]##link:#quarkus-resteasy_quarkus-resteasy-json-json-default[`quarkus.resteasy-json.json-default`]##
ifdef::add-copy-button-to-config-props[]
config_property_copy_button:+++quarkus.resteasy-json.json-default+++[]
Expand Down
21 changes: 21 additions & 0 deletions _generated-doc/main/config/quarkus-hibernate-orm.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,27 @@ endif::add-copy-button-to-env-var[]
|boolean
|`false`

a| [[quarkus-hibernate-orm_quarkus-hibernate-orm-request-scoped-enabled]] [.property-path]##link:#quarkus-hibernate-orm_quarkus-hibernate-orm-request-scoped-enabled[`quarkus.hibernate-orm.request-scoped.enabled`]##
ifdef::add-copy-button-to-config-props[]
config_property_copy_button:+++quarkus.hibernate-orm.request-scoped.enabled+++[]
endif::add-copy-button-to-config-props[]


[.description]
--
Enable or disable access to a Hibernate ORM `EntityManager`/`Session`/`StatelessSession` ++*++when no transaction is active++*++ but a request scope is. When enabled, the corresponding sessions will be read-only. Defaults to enabled for backwards compatibility, but disabling this is recommended, to avoid inconsistent resulsts caused by queries running outside of transactions.


ifdef::add-copy-button-to-env-var[]
Environment variable: env_var_with_copy_button:+++QUARKUS_HIBERNATE_ORM_REQUEST_SCOPED_ENABLED+++[]
endif::add-copy-button-to-env-var[]
ifndef::add-copy-button-to-env-var[]
Environment variable: `+++QUARKUS_HIBERNATE_ORM_REQUEST_SCOPED_ENABLED+++`
endif::add-copy-button-to-env-var[]
--
|boolean
|`true`

a|icon:lock[title=Fixed at build time] [[quarkus-hibernate-orm_quarkus-hibernate-orm-datasource]] [.property-path]##link:#quarkus-hibernate-orm_quarkus-hibernate-orm-datasource[`quarkus.hibernate-orm.datasource`]##
ifdef::add-copy-button-to-config-props[]
config_property_copy_button:+++quarkus.hibernate-orm.datasource+++[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,27 @@ endif::add-copy-button-to-env-var[]
|boolean
|`false`

a| [[quarkus-hibernate-orm_quarkus-hibernate-orm-request-scoped-enabled]] [.property-path]##link:#quarkus-hibernate-orm_quarkus-hibernate-orm-request-scoped-enabled[`quarkus.hibernate-orm.request-scoped.enabled`]##
ifdef::add-copy-button-to-config-props[]
config_property_copy_button:+++quarkus.hibernate-orm.request-scoped.enabled+++[]
endif::add-copy-button-to-config-props[]


[.description]
--
Enable or disable access to a Hibernate ORM `EntityManager`/`Session`/`StatelessSession` ++*++when no transaction is active++*++ but a request scope is. When enabled, the corresponding sessions will be read-only. Defaults to enabled for backwards compatibility, but disabling this is recommended, to avoid inconsistent resulsts caused by queries running outside of transactions.


ifdef::add-copy-button-to-env-var[]
Environment variable: env_var_with_copy_button:+++QUARKUS_HIBERNATE_ORM_REQUEST_SCOPED_ENABLED+++[]
endif::add-copy-button-to-env-var[]
ifndef::add-copy-button-to-env-var[]
Environment variable: `+++QUARKUS_HIBERNATE_ORM_REQUEST_SCOPED_ENABLED+++`
endif::add-copy-button-to-env-var[]
--
|boolean
|`true`

a|icon:lock[title=Fixed at build time] [[quarkus-hibernate-orm_quarkus-hibernate-orm-datasource]] [.property-path]##link:#quarkus-hibernate-orm_quarkus-hibernate-orm-datasource[`quarkus.hibernate-orm.datasource`]##
ifdef::add-copy-button-to-config-props[]
config_property_copy_button:+++quarkus.hibernate-orm.datasource+++[]
Expand Down
21 changes: 21 additions & 0 deletions _generated-doc/main/config/quarkus-messaging.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,27 @@ endif::add-copy-button-to-env-var[]
|boolean
|`true`

a|icon:lock[title=Fixed at build time] [[quarkus-messaging_quarkus-messaging-request-scoped-enabled]] [.property-path]##link:#quarkus-messaging_quarkus-messaging-request-scoped-enabled[`quarkus.messaging.request-scoped.enabled`]##
ifdef::add-copy-button-to-config-props[]
config_property_copy_button:+++quarkus.messaging.request-scoped.enabled+++[]
endif::add-copy-button-to-config-props[]


[.description]
--
Whether to enable the RequestScope context on a message context


ifdef::add-copy-button-to-env-var[]
Environment variable: env_var_with_copy_button:+++QUARKUS_MESSAGING_REQUEST_SCOPED_ENABLED+++[]
endif::add-copy-button-to-env-var[]
ifndef::add-copy-button-to-env-var[]
Environment variable: `+++QUARKUS_MESSAGING_REQUEST_SCOPED_ENABLED+++`
endif::add-copy-button-to-env-var[]
--
|boolean
|`false`

a|icon:lock[title=Fixed at build time] [[quarkus-messaging_quarkus-messaging-metrics-enabled]] [.property-path]##link:#quarkus-messaging_quarkus-messaging-metrics-enabled[`quarkus.messaging.metrics.enabled`]##
ifdef::add-copy-button-to-config-props[]
config_property_copy_button:+++quarkus.messaging.metrics.enabled+++[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,27 @@ endif::add-copy-button-to-env-var[]
|boolean
|`true`

a|icon:lock[title=Fixed at build time] [[quarkus-messaging_quarkus-messaging-request-scoped-enabled]] [.property-path]##link:#quarkus-messaging_quarkus-messaging-request-scoped-enabled[`quarkus.messaging.request-scoped.enabled`]##
ifdef::add-copy-button-to-config-props[]
config_property_copy_button:+++quarkus.messaging.request-scoped.enabled+++[]
endif::add-copy-button-to-config-props[]


[.description]
--
Whether to enable the RequestScope context on a message context


ifdef::add-copy-button-to-env-var[]
Environment variable: env_var_with_copy_button:+++QUARKUS_MESSAGING_REQUEST_SCOPED_ENABLED+++[]
endif::add-copy-button-to-env-var[]
ifndef::add-copy-button-to-env-var[]
Environment variable: `+++QUARKUS_MESSAGING_REQUEST_SCOPED_ENABLED+++`
endif::add-copy-button-to-env-var[]
--
|boolean
|`false`

a|icon:lock[title=Fixed at build time] [[quarkus-messaging_quarkus-messaging-metrics-enabled]] [.property-path]##link:#quarkus-messaging_quarkus-messaging-metrics-enabled[`quarkus.messaging.metrics.enabled`]##
ifdef::add-copy-button-to-config-props[]
config_property_copy_button:+++quarkus.messaging.metrics.enabled+++[]
Expand Down
42 changes: 21 additions & 21 deletions _generated-doc/main/config/quarkus-resteasy_quarkus.resteasy.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,6 @@ h|[.header-title]##Configuration property##
h|Type
h|Default

a|icon:lock[title=Fixed at build time] [[quarkus-resteasy_quarkus-resteasy-vertx-response-buffer-size]] [.property-path]##link:#quarkus-resteasy_quarkus-resteasy-vertx-response-buffer-size[`quarkus.resteasy.vertx.response-buffer-size`]##
ifdef::add-copy-button-to-config-props[]
config_property_copy_button:+++quarkus.resteasy.vertx.response-buffer-size+++[]
endif::add-copy-button-to-config-props[]


[.description]
--
The size of the output stream response buffer. If a response is larger than this and no content-length is provided then the request will be chunked. Larger values may give slight performance increases for large responses, at the expense of more memory usage.


ifdef::add-copy-button-to-env-var[]
Environment variable: env_var_with_copy_button:+++QUARKUS_RESTEASY_VERTX_RESPONSE_BUFFER_SIZE+++[]
endif::add-copy-button-to-env-var[]
ifndef::add-copy-button-to-env-var[]
Environment variable: `+++QUARKUS_RESTEASY_VERTX_RESPONSE_BUFFER_SIZE+++`
endif::add-copy-button-to-env-var[]
--
|int
|`8191`

a|icon:lock[title=Fixed at build time] [[quarkus-resteasy_quarkus-resteasy-gzip-enabled]] [.property-path]##link:#quarkus-resteasy_quarkus-resteasy-gzip-enabled[`quarkus.resteasy.gzip.enabled`]##
ifdef::add-copy-button-to-config-props[]
config_property_copy_button:+++quarkus.resteasy.gzip.enabled+++[]
Expand Down Expand Up @@ -72,6 +51,27 @@ endif::add-copy-button-to-env-var[]
|MemorySize link:#memory-size-note-anchor-quarkus-resteasy_quarkus-resteasy[icon:question-circle[title=More information about the MemorySize format]]
|`10M`

a|icon:lock[title=Fixed at build time] [[quarkus-resteasy_quarkus-resteasy-vertx-response-buffer-size]] [.property-path]##link:#quarkus-resteasy_quarkus-resteasy-vertx-response-buffer-size[`quarkus.resteasy.vertx.response-buffer-size`]##
ifdef::add-copy-button-to-config-props[]
config_property_copy_button:+++quarkus.resteasy.vertx.response-buffer-size+++[]
endif::add-copy-button-to-config-props[]


[.description]
--
The size of the output stream response buffer. If a response is larger than this and no content-length is provided then the request will be chunked. Larger values may give slight performance increases for large responses, at the expense of more memory usage.


ifdef::add-copy-button-to-env-var[]
Environment variable: env_var_with_copy_button:+++QUARKUS_RESTEASY_VERTX_RESPONSE_BUFFER_SIZE+++[]
endif::add-copy-button-to-env-var[]
ifndef::add-copy-button-to-env-var[]
Environment variable: `+++QUARKUS_RESTEASY_VERTX_RESPONSE_BUFFER_SIZE+++`
endif::add-copy-button-to-env-var[]
--
|int
|`8191`

|===

ifndef::no-memory-size-note[]
Expand Down
95 changes: 95 additions & 0 deletions _versions/main/guides/messaging.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,7 @@ public class StreamProcessor {
}
----

[[execution_model]]
== Execution Model

Quarkus Messaging sits on top of the xref:quarkus-reactive-architecture.adoc#engine[reactive engine] of Quarkus and leverages link:{eclipse-vertx}[Eclipse Vert.x] to dispatch messages for processing.
Expand Down Expand Up @@ -634,6 +635,100 @@ Depending on the broker technology, this can be useful to increase the applicati
while still preserving the partial order of messages received in different copies.
This is the case, for example, for Kafka, where multiple consumers can consume different topic partitions.

== Context Propagation

In Quarkus Messaging, the default mechanism for propagating context between different processing stages is the
link:https://smallrye.io/smallrye-reactive-messaging/latest/concepts/message-context[message context].
This provides a consistent way to pass context information along with the message as it flows through different stages.

=== Interaction with Mutiny and MicroProfile Context Propagation

Mutiny, which is the foundation of reactive programming in Quarkus, is integrated with the MicroProfile Context Propagation.
This integration enables automatic capturing and restoring of context across asynchronous boundaries.
To learn more about context propagation in Quarkus and Mutiny, refer to the xref:context-propagation.adoc[Context Propagation] guide.

However, Quarkus Messaging needs to coordinate multiple asynchronous boundaries.
This is why the default context propagation can result in unexpected behavior in some cases, especially using `Emitters`.

To ensure consistent behavior, Quarkus Messaging disables the propagation of any context during message dispatching, through internal channels or connectors.
This means that Emitters won't capture the caller context, and incoming channels won't dispatch messages by activating a context (ex. the request context).

For example, you might want to propagate the caller context from an incoming HTTP request to the message processing stage.
For emitters, instead of using the regular `Emitter` or `MutinyEmitter`, you can inject the `ContextualEmitter` to make sure the message captures the caller context.
This ensures consistent and predictable behaviour by relying on the message context handling provided by the framework.

For example, let `RequestScopedBean` a request-scoped bean, `ContextualEmitter` can be used to dispatch messages locally through the internal channel `app`:

[source, java]
----
import jakarta.inject.Inject;
import jakarta.ws.rs.Consumes;
import jakarta.ws.rs.POST;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.core.MediaType;
import org.eclipse.microprofile.reactive.messaging.Channel;
import io.quarkus.logging.Log;
import io.quarkus.smallrye.reactivemessaging.runtime.ContextualEmitter;
import io.smallrye.mutiny.Uni;
import io.vertx.core.Context;
import io.vertx.core.Vertx;
@Path("/")
public class Resource {
@Channel("app")
ContextualEmitter<String> emitter;
@Inject
RequestScopedBean requestScopedBean;
@POST
@Path("/send")
public void send(String message) {
requestScopedBean.setValue("Hello");
emitter.sendAndAwait(message);
}
}
----

Then the request-scoped bean can be accessed in the message processing stage, regardless of the <<execution_model>>:

[source, java]
----
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import org.eclipse.microprofile.reactive.messaging.Incoming;
import io.quarkus.logging.Log;
import io.smallrye.reactive.messaging.annotations.Blocking;
@ApplicationScoped
public class Processor {
@Inject
RequestScopedBean requestScopedBean;
@Incoming("app")
@Blocking
public void process(String message) {
Log.infof("Message %s from request %s", message, requestScopedBean.getValue());
}
}
----

=== Request Context Activation

In some cases, you might need to activate the request context while processing messages consumed from a broker.
While using `@ActivateRequestContext` on the `@Incoming` method is an option, it's lifecycle does not follow that of a Quarkus Messaging message.
For incoming channels, you can enable the request scope activation with the build time property `quarkus.messaging.request-scoped.enabled=true`.
This will activate the request context for each message processed by the incoming channel, and close the context once the message is processed.

== Health Checks

Together with the SmallRye Health extension, Quarkus Messaging extensions provide health check support per channel.
Expand Down
2 changes: 1 addition & 1 deletion _versions/main/guides/tls-registry-reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,7 @@ Note that the generated CA is only valid for development purposes and can only b
To generate a development CA:
[source,shell]
----
quarkus tls generate-ca-certificate --install \ <1>
quarkus tls generate-quarkus-ca --install \ <1>
--renew \ <2>
--truststore <3>
----
Expand Down

0 comments on commit fd6b233

Please sign in to comment.