Fix links in docs

* Fix links in section Previous Releases 
* Declare some attributes represent document links
This commit is contained in:
Tran Ngoc Nhan
2024-09-16 23:56:13 +07:00
committed by GitHub
parent 2ebc7ef123
commit c6dcc76ae9
26 changed files with 58 additions and 48 deletions

View File

@@ -14,4 +14,15 @@ ext:
asciidoc:
attributes:
attribute-missing: 'warn'
chomp: 'all'
chomp: 'all'
spring-docs: 'https://docs.spring.io'
spring-framework-docs: '{spring-docs}/spring-framework/reference'
spring-integration-docs: '{spring-docs}/spring-integration/reference'
spring-amqp-java-docs: '{spring-docs}/spring-amqp/docs/current/api/org/springframework/amqp'
spring-framework-java-docs: '{spring-docs}/spring/docs/current/javadoc-api/org/springframework'
spring-retry-java-docs: '{spring-docs}/spring-retry/docs/api/current/'
# External projects URLs and related attributes
micrometer-docs: 'https://docs.micrometer.io'
micrometer-tracing-docs: '{micrometer-docs}/tracing/reference/'
micrometer-micrometer-docs: '{micrometer-docs}/micrometer/reference/'
rabbitmq-stream-docs: 'https://rabbitmq.github.io/rabbitmq-stream-java-client/stable/htmlsingle'

View File

@@ -359,7 +359,7 @@ public Exchange exchange() {
}
----
See the Javadoc for https://docs.spring.io/spring-amqp/docs/current/api/org/springframework/amqp/core/QueueBuilder.html[`org.springframework.amqp.core.QueueBuilder`] and https://docs.spring.io/spring-amqp/docs/current/api/org/springframework/amqp/core/ExchangeBuilder.html[`org.springframework.amqp.core.ExchangeBuilder`] for more information.
See the Javadoc for {spring-amqp-java-docs}/core/QueueBuilder.html[`org.springframework.amqp.core.QueueBuilder`] and {spring-amqp-java-docs}/core/ExchangeBuilder.html[`org.springframework.amqp.core.ExchangeBuilder`] for more information.
Starting with version 2.0, the `ExchangeBuilder` now creates durable exchanges by default, to be consistent with the simple constructors on the individual `AbstractExchange` classes.
To make a non-durable exchange with the builder, use `.durable(false)` before invoking `.build()`.

View File

@@ -483,7 +483,7 @@ public class MyService {
----
It is important to unbind the resource after use.
For more information, see the https://docs.spring.io/spring-amqp/docs/current/api/org/springframework/amqp/rabbit/connection/AbstractRoutingConnectionFactory.html[JavaDoc] for `AbstractRoutingConnectionFactory`.
For more information, see the {spring-amqp-java-docs}/rabbit/connection/AbstractRoutingConnectionFactory.html[JavaDoc] for `AbstractRoutingConnectionFactory`.
Starting with version 1.4, `RabbitTemplate` supports the SpEL `sendConnectionFactorySelectorExpression` and `receiveConnectionFactorySelectorExpression` properties, which are evaluated on each AMQP protocol interaction operation (`send`, `sendAndReceive`, `receive`, or `receiveAndReply`), resolving to a `lookupKey` value for the provided `AbstractRoutingConnectionFactory`.
You can use bean references, such as `@vHostResolver.getVHost(#root)` in the expression.

View File

@@ -8,7 +8,7 @@ Container can be initially configured to listen on zero queues.
Queues can be added and removed at runtime.
The `SimpleMessageListenerContainer` recycles (cancels and re-creates) all consumers when any pre-fetched messages have been processed.
The `DirectMessageListenerContainer` creates/cancels individual consumer(s) for each queue without affecting consumers on other queues.
See the https://docs.spring.io/spring-amqp/docs/current/api/org/springframework/amqp/rabbit/listener/AbstractMessageListenerContainer.html[Javadoc] for the `addQueues`, `addQueueNames`, `removeQueues` and `removeQueueNames` methods.
See the {spring-amqp-java-docs}/rabbit/listener/AbstractMessageListenerContainer.html[Javadoc] for the `addQueues`, `addQueueNames`, `removeQueues` and `removeQueueNames` methods.
If not all queues are available, the container tries to passively declare (and consume from) the missing queues every 60 seconds.

View File

@@ -5,7 +5,7 @@
When the management plugin is enabled, the RabbitMQ server exposes a REST API to monitor and configure the broker.
A https://github.com/rabbitmq/hop[Java Binding for the API] is now provided.
The `com.rabbitmq.http.client.Client` is a standard, immediate, and, therefore, blocking API.
It is based on the https://docs.spring.io/spring/docs/current/spring-framework-reference/web.html#spring-web[Spring Web] module and its `RestTemplate` implementation.
It is based on the {spring-framework-docs}/web.html[Spring Web] module and its `RestTemplate` implementation.
On the other hand, the `com.rabbitmq.http.client.ReactorNettyClient` is a reactive, non-blocking implementation based on the https://projectreactor.io/docs/netty/release/reference/docs/index.html[Reactor Netty] project.
The hop dependency (`com.rabbitmq:http-client`) is now also `optional`.

View File

@@ -356,7 +356,7 @@ It has been replaced by `AbstractJackson2MessageConverter`.
Yet another option is the `MarshallingMessageConverter`.
It delegates to the Spring OXM library's implementations of the `Marshaller` and `Unmarshaller` strategy interfaces.
You can read more about that library https://docs.spring.io/spring/docs/current/spring-framework-reference/html/oxm.html[here].
You can read more about that library {spring-framework-docs}/data-access/oxm.html[here].
In terms of configuration, it is most common to provide only the constructor argument, since most implementations of `Marshaller` also implement `Unmarshaller`.
The following example shows how to configure a `MarshallingMessageConverter`:

View File

@@ -37,7 +37,7 @@ In this case, and ignoring the RabbitMQ infrastructure setup, the `processOrder`
You can customize the listener container factory to use for each annotation, or you can configure an explicit default by implementing the `RabbitListenerConfigurer` interface.
The default is required only if at least one endpoint is registered without a specific container factory.
See the https://docs.spring.io/spring-amqp/docs/current/api/org/springframework/amqp/rabbit/annotation/RabbitListenerConfigurer.html[Javadoc] for full details and examples.
See the {spring-amqp-java-docs}/rabbit/annotation/RabbitListenerConfigurer.html[Javadoc] for full details and examples.
The container factories provide methods for adding `MessagePostProcessor` instances that are applied after receiving messages (before invoking the listener) and before sending replies.

View File

@@ -7,7 +7,7 @@ Using Micrometer for observation is now supported, since version 3.0, for the `R
Set `observationEnabled` on each component to enable observation; this will disable xref:amqp/receiving-messages/micrometer.adoc[Micrometer Timers] because the timers will now be managed with each observation.
When using annotated listeners, set `observationEnabled` on the container factory.
Refer to https://docs.micrometer.io/tracing/reference/[Micrometer Tracing] for more information.
Refer to {micrometer-tracing-docs}[Micrometer Tracing] for more information.
To add tags to timers/traces, configure a custom `RabbitTemplateObservationConvention` or `RabbitListenerObservationConvention` to the template or listener container, respectively.

View File

@@ -2,7 +2,7 @@
= Micrometer Integration
:page-section-summary-toc: 1
NOTE: This section documents the integration with https://docs.micrometer.io/micrometer/reference/[Micrometer].
NOTE: This section documents the integration with {micrometer-micrometer-docs}[Micrometer].
For integration with Micrometer Observation, see xref:amqp/receiving-messages/micrometer-observation.adoc[Micrometer Observation].
Starting with version 2.2, the listener containers will automatically create and update Micrometer `Timer` s for the listener, if `Micrometer` is detected on the class path, and a single `MeterRegistry` is present in the application context (or exactly one is annotated `@Primary`, such as when using Spring Boot).

View File

@@ -6,11 +6,11 @@ Those methods are quite useful for request-reply scenarios, since they handle th
Similar request-reply methods are also available where the `MessageConverter` is applied to both the request and reply.
Those methods are named `convertSendAndReceive`.
See the https://docs.spring.io/spring-amqp/docs/current/api/org/springframework/amqp/core/AmqpTemplate.html[Javadoc of `AmqpTemplate`] for more detail.
See the {spring-amqp-java-docs}/core/AmqpTemplate.html[Javadoc of `AmqpTemplate`] for more detail.
Starting with version 1.5.0, each of the `sendAndReceive` method variants has an overloaded version that takes `CorrelationData`.
Together with a properly configured connection factory, this enables the receipt of publisher confirms for the send side of the operation.
See xref:amqp/template.adoc#template-confirms[Correlated Publisher Confirms and Returns] and the https://docs.spring.io/spring-amqp/docs/current/api/org/springframework/amqp/rabbit/core/RabbitOperations.html[Javadoc for `RabbitOperations`] for more information.
See xref:amqp/template.adoc#template-confirms[Correlated Publisher Confirms and Returns] and the {spring-amqp-java-docs}/rabbit/core/RabbitOperations.html[Javadoc for `RabbitOperations`] for more information.
Starting with version 2.0, there are variants of these methods (`convertSendAndReceiveAsType`) that take an additional `ParameterizedTypeReference` argument to convert complex returned types.
The template must be configured with a `SmartMessageConverter`.

View File

@@ -90,7 +90,7 @@ public StatefulRetryOperationsInterceptor interceptor() {
Only a subset of retry capabilities can be configured this way.
More advanced features would need the configuration of a `RetryTemplate` as a Spring bean.
See the https://docs.spring.io/spring-retry/docs/api/current/[Spring Retry Javadoc] for complete information about available policies and their configuration.
See the {spring-retry-java-docs}[Spring Retry Javadoc] for complete information about available policies and their configuration.
[[batch-retry]]
== Retry with Batch Listeners

View File

@@ -100,7 +100,7 @@ Message message = MessageBuilder.withBody("foo".getBytes())
.build();
----
Each of the properties defined on the https://docs.spring.io/spring-amqp/docs/current/api/org/springframework/amqp/core/MessageProperties.html[`MessageProperties`] can be set.
Each of the properties defined on the {spring-amqp-java-docs}/core/MessageProperties.html[`MessageProperties`] can be set.
Other methods include `setHeader(String key, String value)`, `removeHeader(String key)`, `removeHeaders()`, and `copyProperties(MessageProperties properties)`.
Each property setting method has a `set*IfAbsent()` variant.
In the cases where a default initial value exists, the method is named `set*IfAbsentOrDefault()`.

View File

@@ -69,7 +69,7 @@ If the `channelTransacted` flag was set to `false` (the default) in the precedin
Prior to version 1.6.6, adding a rollback rule to a container's `transactionAttribute` when using an external transaction manager (such as JDBC) had no effect.
Exceptions always rolled back the transaction.
Also, when using a https://docs.spring.io/spring-framework/docs/current/spring-framework-reference/html/transaction.html#transaction-declarative[transaction advice] in the container's advice chain, conditional rollback was not very useful, because all listener exceptions are wrapped in a `ListenerExecutionFailedException`.
Also, when using a {spring-framework-docs}/data-access/transaction/declarative.html[transaction advice] in the container's advice chain, conditional rollback was not very useful, because all listener exceptions are wrapped in a `ListenerExecutionFailedException`.
The first problem has been corrected, and the rules are now applied properly.
Further, the `ListenerFailedRuleBasedTransactionAttribute` is now provided.
@@ -116,13 +116,13 @@ See xref:amqp/containerAttributes.adoc[Message Listener Container Configuration]
[[using-rabbittransactionmanager]]
== Using `RabbitTransactionManager`
The https://docs.spring.io/spring-amqp/docs/current/api/org/springframework/amqp/rabbit/transaction/RabbitTransactionManager.html[RabbitTransactionManager] is an alternative to executing Rabbit operations within, and synchronized with, external transactions.
This transaction manager is an implementation of the https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/transaction/PlatformTransactionManager.html[`PlatformTransactionManager`] interface and should be used with a single Rabbit `ConnectionFactory`.
The {spring-amqp-java-docs}/rabbit/transaction/RabbitTransactionManager.html[RabbitTransactionManager] is an alternative to executing Rabbit operations within, and synchronized with, external transactions.
This transaction manager is an implementation of the {spring-framework-java-docs}/transaction/PlatformTransactionManager.html[`PlatformTransactionManager`] interface and should be used with a single Rabbit `ConnectionFactory`.
IMPORTANT: This strategy is not able to provide XA transactions -- for example, in order to share transactions between messaging and database access.
Application code is required to retrieve the transactional Rabbit resources through `ConnectionFactoryUtils.getTransactionalResourceHolder(ConnectionFactory, boolean)` instead of a standard `Connection.createChannel()` call with subsequent channel creation.
When using Spring AMQP's https://docs.spring.io/spring-amqp/docs/latest_ga/api/org/springframework/amqp/rabbit/core/RabbitTemplate.html[RabbitTemplate], it will autodetect a thread-bound Channel and automatically participate in its transaction.
When using Spring AMQP's {spring-amqp-java-docs}/rabbit/core/RabbitTemplate.html[RabbitTemplate], it will autodetect a thread-bound Channel and automatically participate in its transaction.
With Java Configuration, you can setup a new RabbitTransactionManager by using the following bean:

View File

@@ -2,6 +2,6 @@
= Native Images
:page-section-summary-toc: 1
https://docs.spring.io/spring-framework/docs/current/reference/html/core.html#aot[Spring AOT] native hints are provided to assist in developing native images for Spring applications that use Spring AMQP.
{spring-framework-docs}/core/aot.html[Spring AOT] native hints are provided to assist in developing native images for Spring applications that use Spring AMQP.
Some examples can be seen in the https://github.com/spring-projects/spring-aot-smoke-tests/tree/main/integration[`spring-aot-smoke-tests` GitHub repository].

View File

@@ -5,14 +5,14 @@
== Listener Concurrency
The listener container now supports dynamic scaling of the number of consumers based on workload, or you can programmatically change the concurrency without stopping the container.
See <<listener-concurrency>>.
See xref:amqp/listener-concurrency.adoc#listener-concurrency[Listener Concurrency].
[[listener-queues]]
== Listener Queues
The listener container now permits the queues on which it listens to be modified at runtime.
Also, the container now starts if at least one of its configured queues is available for use.
See <<listener-queues>>
See xref:amqp/listener-queues.adoc#listener-queues[Listener Container Queues]
This listener container now redeclares any auto-delete queues during startup.
See xref:amqp/receiving-messages/async-consumer.adoc#lc-auto-delete[`auto-delete` Queues].
@@ -21,13 +21,13 @@ See xref:amqp/receiving-messages/async-consumer.adoc#lc-auto-delete[`auto-delete
== Consumer Priority
The listener container now supports consumer arguments, letting the `x-priority` argument be set.
See <<consumer-priority>>.
See xref:amqp/receiving-messages/async-consumer.adoc#consumer-priority[Consumer Priority].
[[exclusive-consumer]]
== Exclusive Consumer
You can now configure `SimpleMessageListenerContainer` with a single `exclusive` consumer, preventing other consumers from listening to the queue.
See <<exclusive-consumer>>.
See xref:amqp/exclusive-consumer.adoc[Exclusive Consumer].
[[rabbit-admin]]
== Rabbit Admin
@@ -47,7 +47,7 @@ If you wish to bind with an empty string routing key, you need to specify `key="
The `AmqpTemplate` now provides several synchronous `receiveAndReply` methods.
These are implemented by the `RabbitTemplate`.
For more information see <<receiving-messages>>.
For more information see xref:amqp/receiving-messages.adoct[Receiving Messages].
The `RabbitTemplate` now supports configuring a `RetryTemplate` to attempt retries (with optional back-off policy) for when the broker is not available.
For more information see xref:amqp/template.adoc#template-retry[Adding Retry Capabilities].
@@ -66,12 +66,11 @@ You can now configure the `<binding>` of the `<headers-exchange>` with a `key/va
These options are mutually exclusive.
See xref:amqp/broker-configuration.adoc#headers-exchange[Headers Exchange].
[[routing-connection-factory]]
== Routing Connection Factory
A new `SimpleRoutingConnectionFactory` has been introduced.
It allows configuration of `ConnectionFactories` mapping, to determine the target `ConnectionFactory` to use at runtime.
See <<routing-connection-factory>>.
See xref:amqp/connections.adoc#routing-connection-factory[routing-connection-factory].
[[messagebuilder-and-messagepropertiesbuilder]]
== `MessageBuilder` and `MessagePropertiesBuilder`

View File

@@ -35,14 +35,14 @@ See xref:amqp/template.adoc#template-confirms[Correlated Publisher Confirms and
`RabbitConnectionFactoryBean` creates the underlying RabbitMQ `ConnectionFactory` used by the `CachingConnectionFactory`.
This enables configuration of SSL options using Spring's dependency injection.
See <<connection-factory>>.
See xref:amqp/connections.adoc#connection-factory[Configuring the Underlying Client Connection Factory].
[[using-cachingconnectionfactory]]
== Using `CachingConnectionFactory`
The `CachingConnectionFactory` now lets the `connectionTimeout` be set as a property or as an attribute in the namespace.
It sets the property on the underlying RabbitMQ `ConnectionFactory`.
See <<connection-factory>>.
See xref:amqp/connections.adoc#connection-factory[Configuring the Underlying Client Connection Factory].
[[log-appender]]
== Log Appender
@@ -71,13 +71,13 @@ The `mandatoryExpression`, `sendConnectionFactorySelectorExpression`, and `recei
The `mandatoryExpression` is used to evaluate a `mandatory` boolean value against each request message when a `ReturnCallback` is in use.
See xref:amqp/template.adoc#template-confirms[Correlated Publisher Confirms and Returns].
The `sendConnectionFactorySelectorExpression` and `receiveConnectionFactorySelectorExpression` are used when an `AbstractRoutingConnectionFactory` is provided, to determine the `lookupKey` for the target `ConnectionFactory` at runtime on each AMQP protocol interaction operation.
See <<routing-connection-factory>>.
See xref:amqp/connections.adoc#routing-connection-factory[routing-connection-factory].
[[listeners-and-the-routing-connection-factory]]
== Listeners and the Routing Connection Factory
You can configure a `SimpleMessageListenerContainer` with a routing connection factory to enable connection selection based on the queue names.
See <<routing-connection-factory>>.
See xref:amqp/connections.adoc#routing-connection-factory[routing-connection-factory].
[[rabbittemplate:-recoverycallback-option]]
== `RabbitTemplate`: `RecoveryCallback` Option

View File

@@ -5,7 +5,7 @@
== `spring-erlang` Is No Longer Supported
The `spring-erlang` jar is no longer included in the distribution.
Use <<management-rest-api, the RabbitMQ REST API>> instead.
Use xref:amqp/management-rest-api.adoc#management-rest-api[RabbitMQ REST API] instead.
[[cachingconnectionfactory-changes]]
== `CachingConnectionFactory` Changes
@@ -122,7 +122,7 @@ See xref:amqp/request-reply.adoc#reply-listener[Reply Listener Container] for mo
== `RabbitManagementTemplate` Added
The `RabbitManagementTemplate` has been introduced to monitor and configure the RabbitMQ Broker by using the REST API provided by its https://www.rabbitmq.com/management.html[management plugin].
See <<management-rest-api>> for more information.
See xref:amqp/management-rest-api.adoc#management-rest-api[RabbitMQ REST API] for more information.
[[listener-container-bean-names-xml]]
== Listener Container Bean Names (XML)
@@ -160,7 +160,7 @@ See xref:amqp/containerAttributes.adoc[Message Listener Container Configuration]
== Channel Close Logging
A mechanism to control the log levels of channel closure has been introduced.
See <<channel-close-logging>>.
See xref:amqp/connections.adoc#channel-close-logging[Logging Channel Close Events].
[[application-events]]
== Application Events

View File

@@ -189,7 +189,7 @@ See xref:amqp/receiving-messages/async-annotation-driven.adoc[Annotation-driven
== Delayed Message Exchange
Spring AMQP now has first class support for the RabbitMQ Delayed Message Exchange plugin.
See <<delayed-message-exchange>> for more information.
See xref:amqp/delayed-message-exchange.adoc[Delayed Message Exchange] for more information.
[[exchange-internal-flag]]
== Exchange Internal Flag
@@ -235,7 +235,7 @@ factory.
You can now configure a "`allowed list`" of allowable classes when you use Java deserialization.
You should consider creating an allowed list if you accept messages with serialized java objects from
untrusted sources.
See <<java-deserialization>> for more information.
See amqp/message-converters.adoc#java-deserialization[Java Deserialization] for more information.
[[json-messageconverter]]
== JSON `MessageConverter`

View File

@@ -51,7 +51,7 @@ The framework is no longer compatible with previous versions.
== JUnit `@Rules`
Rules that have previously been used internally by the framework have now been made available in a separate jar called `spring-rabbit-junit`.
See <<junit-rules>> for more information.
See xref:testing.adoc#junit-rules[JUnit4 `@Rules`] for more information.
[[container-conditional-rollback]]
== Container Conditional Rollback

View File

@@ -68,7 +68,7 @@ See xref:amqp/request-reply.adoc#async-template[Async Rabbit Template] for more
The `RabbitTemplate` and `AsyncRabbitTemplate` now have `receiveAndConvert` and `convertSendAndReceiveAsType` methods that take a `ParameterizedTypeReference<T>` argument, letting the caller specify the type to which to convert the result.
This is particularly useful for complex types or when type information is not conveyed in message headers.
It requires a `SmartMessageConverter` such as the `Jackson2JsonMessageConverter`.
See xref:amqp/request-reply.adoc[Request/Reply Messaging], xref:amqp/request-reply.adoc#async-template[Async Rabbit Template], xref:amqp/message-converters.adoc#json-complex[Converting From a `Message` With `RabbitTemplate`], and <<json-complex>> for more information.
See xref:amqp/request-reply.adoc[Request/Reply Messaging], xref:amqp/request-reply.adoc#async-template[Async Rabbit Template], xref:amqp/message-converters.adoc#json-complex[Converting From a `Message` With `RabbitTemplate`], and xref:amqp/message-converters.adoc#json-complex[Converting From a `Message` With `RabbitTemplate`] for more information.
You can now use a `RabbitTemplate` to perform multiple operations on a dedicated channel.
See xref:amqp/template.adoc#scoped-operations[Scoped Operations] for more information.
@@ -179,7 +179,7 @@ See xref:amqp/transactions.adoc#conditional-rollback[Conditional Rollback] for m
Deprecated in previous versions, Jackson `1.x` converters and related components have now been deleted.
You can use similar components based on Jackson 2.x.
See <<json-message-converter>> for more information.
See xref:amqp/message-converters.adoc#json-message-converter[`Jackson2JsonMessageConverter`] for more information.
[[json-message-converter]]
== JSON Message Converter

View File

@@ -81,7 +81,7 @@ See xref:amqp/message-converters.adoc#jackson2xml[`Jackson2XmlMessageConverter`]
== Management REST API
The `RabbitManagementTemplate` is now deprecated in favor of the direct `com.rabbitmq.http.client.Client` (or `com.rabbitmq.http.client.ReactorNettyClient`) usage.
See <<management-rest-api>> for more information.
See xref:amqp/management-rest-api.adoc#management-rest-api[RabbitMQ REST API] for more information.
[[rabbitlistener-changes]]
== `@RabbitListener` Changes

View File

@@ -47,7 +47,7 @@ See xref:amqp/broker-configuration.adoc#conditional-declaration[Conditional Decl
== AMQP Remoting
Facilities are now provided for using Spring remoting techniques, using AMQP as the transport for the RPC calls.
For more information see <<remoting>>
For more information see xref:amqp/request-reply.adoc#remoting[Spring Remoting with AMQP].
[[requested-heart-beats]]
== Requested Heart Beats

View File

@@ -13,7 +13,7 @@ We provide an inbound-channel-adapter, an outbound-channel-adapter, an inbound-g
Since the AMQP adapters are part of the Spring Integration release, the documentation is available as part of the Spring Integration distribution.
We provide a quick overview of the main features here.
See the https://docs.spring.io/spring-integration/reference[Spring Integration Reference Guide] for much more detail.
See the {spring-integration-docs}[Spring Integration Reference Guide] for much more detail.
[[inbound-channel-adapter]]
== Inbound Channel Adapter

View File

@@ -395,7 +395,7 @@ public class MyEnhancedAppender extends AmqpAppender {
}
----
The Log4j 2 appender supports using a https://logging.apache.org/log4j/2.x/manual/appenders.html#BlockingQueueFactory[`BlockingQueueFactory`], as the following example shows:
The Log4j 2 appender supports using a https://logging.apache.org/log4j/2.x/manual/appenders/delegating.html#BlockingQueueFactory[`BlockingQueueFactory`], as the following example shows:
[source, xml]
----

View File

@@ -20,7 +20,7 @@ You can import the `spring-rabbit-helloworld` sample into the IDE and then follo
Within the `src/main/java` directory, navigate to the `org.springframework.amqp.helloworld` package.
Open the `HelloWorldConfiguration` class and notice that it contains the `@Configuration` annotation at the class level and notice some `@Bean` annotations at method-level.
This is an example of Spring's Java-based configuration.
You can read more about that https://docs.spring.io/spring/docs/current/spring-framework-reference/html/beans.html#beans-java[here].
You can read more about that {spring-framework-docs}/core/beans/java.html[here].
The following listing shows how the connection factory is created:
@@ -144,7 +144,7 @@ static class ScheduledProducer {
----
You do not need to understand all of the details, since the real focus should be on the receiving side (which we cover next).
However, if you are not yet familiar with Spring task scheduling support, you can learn more https://docs.spring.io/spring/docs/current/spring-framework-reference/html/scheduling.html#scheduling-annotation-support[here].
However, if you are not yet familiar with Spring task scheduling support, you can learn more {spring-framework-docs}/integration/scheduling.html#scheduling-annotation-support-scheduled[here].
The short story is that the `postProcessor` bean in the `ProducerConfiguration` registers the task with a scheduler.
Now we can turn to the receiving side.
@@ -351,4 +351,4 @@ Spring applications, when sending JSON, set the `__TypeId__` header to the fully
The `spring-rabbit-json` sample explores several techniques to convert the JSON from a non-Spring application.
See also xref:amqp/message-converters.adoc#json-message-converter[`Jackson2JsonMessageConverter`] as well as the https://docs.spring.io/spring-amqp/docs/current/api/index.html?org/springframework/amqp/support/converter/DefaultClassMapper.html[Javadoc for the `DefaultClassMapper`].
See also xref:amqp/message-converters.adoc#json-message-converter[`Jackson2JsonMessageConverter`] as well as the {spring-amqp-java-docs}/index.html?org/springframework/amqp/support/converter/DefaultClassMapper.html[Javadoc for the `DefaultClassMapper`].

View File

@@ -109,7 +109,7 @@ You can also send native stream `Message` s directly; with the `messageBuilder()
The `ProducerCustomizer` provides a mechanism to customize the producer before it is built.
Refer to the https://rabbitmq.github.io/rabbitmq-stream-java-client/stable/htmlsingle/[Java Client Documentation] about customizing the `Environment` and `Producer`.
Refer to the {rabbitmq-stream-docs}[Java Client Documentation] about customizing the `Environment` and `Producer`.
IMPORTANT: Starting with version 3.0, the method return types are `CompletableFuture` instead of `ListenableFuture`.
@@ -135,7 +135,7 @@ See xref:amqp/containerAttributes.adoc[Message Listener Container Configuration]
Similar the template, the container has a `ConsumerCustomizer` property.
Refer to the https://rabbitmq.github.io/rabbitmq-stream-java-client/stable/htmlsingle/[Java Client Documentation] about customizing the `Environment` and `Consumer`.
Refer to the {rabbitmq-stream-docs}[Java Client Documentation] about customizing the `Environment` and `Consumer`.
When using `@RabbitListener`, configure a `StreamRabbitListenerContainerFactory`; at this time, most `@RabbitListener` properties (`concurrency`, etc) are ignored. Only `id`, `queues`, `autoStartup` and `containerFactory` are supported.
In addition, `queues` can only contain one stream name.
@@ -287,7 +287,7 @@ StreamListenerContainer container(Environment env, String name) {
----
IMPORTANT: At this time, when the concurrency is greater than 1, the actual concurrency is further controlled by the `Environment`; to achieve full concurrency, set the environment's `maxConsumersByConnection` to 1.
See https://rabbitmq.github.io/rabbitmq-stream-java-client/snapshot/htmlsingle/#configuring-the-environment[Configuring the Environment].
See {rabbitmq-stream-docs}/#configuring-the-environment[Configuring the Environment].
[[stream-micrometer-observation]]
== Micrometer Observation
@@ -298,7 +298,7 @@ The container now also supports Micrometer timers (when observation is not enabl
Set `observationEnabled` on each component to enable observation; this will disable xref:amqp/receiving-messages/micrometer.adoc[Micrometer Timers] because the timers will now be managed with each observation.
When using annotated listeners, set `observationEnabled` on the container factory.
Refer to https://docs.micrometer.io/tracing/reference/[Micrometer Tracing] for more information.
Refer to {micrometer-tracing-docs}[Micrometer Tracing] for more information.
To add tags to timers/traces, configure a custom `RabbitStreamTemplateObservationConvention` or `RabbitStreamListenerObservationConvention` to the template or listener container, respectively.