diff --git a/build.gradle b/build.gradle index 76f076efa1..2f86691323 100644 --- a/build.gradle +++ b/build.gradle @@ -84,9 +84,7 @@ antora { } tasks.named('generateAntoraYml') { - asciidocAttributes = project.provider({ - return ['project-version': project.version] - }) + asciidocAttributes = project.provider( { generateAttributes() } ) baseAntoraYmlFile = file('src/reference/antora/antora.yml') } @@ -724,3 +722,24 @@ publishing { } } } + +def generateAttributes() { + def springDocs = "https://docs.spring.io" + def micrometerDocsPrefix = "https://docs.micrometer.io" + + return [ + 'project-version': project.version, + 'spring-integration-docs': "$springDocs/spring-integration/reference".toString(), + 'spring-framework-docs': "$springDocs/spring-framework/reference/${generateVersionWithoutPatch(springVersion)}".toString(), + 'spring-retry-java-docs': "$springDocs/spring-retry/docs/$springRetryVersion/apidocs".toString(), + 'javadoc-location-org-springframework-transaction': "$springDocs/spring-framework/docs/$springVersion/javadoc-api".toString(), + 'javadoc-location-org-springframework-amqp': "$springDocs/spring-amqp/docs/$project.version/api".toString(), + 'micrometer-docs': "$micrometerDocsPrefix/micrometer/reference/${generateVersionWithoutPatch(micrometerVersion)}".toString(), + 'micrometer-tracing-docs': "$micrometerDocsPrefix/tracing/reference/${generateVersionWithoutPatch(micrometerTracingVersion)}".toString() + ] +} + +static String generateVersionWithoutPatch(String version) { + + return version.split('\\.')[0,1].join('.') + (version.endsWith('-SNAPSHOT') ? '-SNAPSHOT' : '') +} diff --git a/src/reference/antora/antora-playbook.yml b/src/reference/antora/antora-playbook.yml index 8397e13ecc..1b86b09228 100644 --- a/src/reference/antora/antora-playbook.yml +++ b/src/reference/antora/antora-playbook.yml @@ -23,6 +23,7 @@ asciidoc: extensions: - '@asciidoctor/tabs' - '@springio/asciidoctor-extensions' + - '@springio/asciidoctor-extensions/javadoc-extension' sourcemap: true urls: latest_version_segment: '' diff --git a/src/reference/antora/antora.yml b/src/reference/antora/antora.yml index a3fb163dea..b12a23a465 100644 --- a/src/reference/antora/antora.yml +++ b/src/reference/antora/antora.yml @@ -15,16 +15,7 @@ asciidoc: attributes: attribute-missing: 'warn' 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' rabbitmq-github: 'https://github.com/rabbitmq' - rabbitmq-server-github: '{rabbitmq-github}/rabbitmq-server/tree/main/deps' \ No newline at end of file + rabbitmq-server-github: '{rabbitmq-github}/rabbitmq-server/tree/main/deps' diff --git a/src/reference/antora/modules/ROOT/pages/amqp/broker-configuration.adoc b/src/reference/antora/modules/ROOT/pages/amqp/broker-configuration.adoc index 25fcc78241..39dfa15ce5 100644 --- a/src/reference/antora/modules/ROOT/pages/amqp/broker-configuration.adoc +++ b/src/reference/antora/modules/ROOT/pages/amqp/broker-configuration.adoc @@ -359,7 +359,7 @@ public Exchange exchange() { } ---- -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. +See the Javadoc for javadoc:org.springframework.amqp.core.QueueBuilder[`org.springframework.amqp.core.QueueBuilder`] and javadoc:org.springframework.amqp.core.ExchangeBuilder[`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()`. diff --git a/src/reference/antora/modules/ROOT/pages/amqp/connections.adoc b/src/reference/antora/modules/ROOT/pages/amqp/connections.adoc index c1b278a820..f85b670af9 100644 --- a/src/reference/antora/modules/ROOT/pages/amqp/connections.adoc +++ b/src/reference/antora/modules/ROOT/pages/amqp/connections.adoc @@ -483,7 +483,7 @@ public class MyService { ---- It is important to unbind the resource after use. -For more information, see the {spring-amqp-java-docs}/rabbit/connection/AbstractRoutingConnectionFactory.html[JavaDoc] for `AbstractRoutingConnectionFactory`. +For more information, see the javadoc:org.springframework.amqp.rabbit.connection.AbstractRoutingConnectionFactory[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. diff --git a/src/reference/antora/modules/ROOT/pages/amqp/listener-queues.adoc b/src/reference/antora/modules/ROOT/pages/amqp/listener-queues.adoc index ed6101ec5c..c9972b3688 100644 --- a/src/reference/antora/modules/ROOT/pages/amqp/listener-queues.adoc +++ b/src/reference/antora/modules/ROOT/pages/amqp/listener-queues.adoc @@ -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 {spring-amqp-java-docs}/rabbit/listener/AbstractMessageListenerContainer.html[Javadoc] for the `addQueues`, `addQueueNames`, `removeQueues` and `removeQueueNames` methods. +See the javadoc:org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer[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. diff --git a/src/reference/antora/modules/ROOT/pages/amqp/receiving-messages/async-annotation-driven/enable.adoc b/src/reference/antora/modules/ROOT/pages/amqp/receiving-messages/async-annotation-driven/enable.adoc index 422de556ef..c9d37e7a09 100644 --- a/src/reference/antora/modules/ROOT/pages/amqp/receiving-messages/async-annotation-driven/enable.adoc +++ b/src/reference/antora/modules/ROOT/pages/amqp/receiving-messages/async-annotation-driven/enable.adoc @@ -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 {spring-amqp-java-docs}/rabbit/annotation/RabbitListenerConfigurer.html[Javadoc] for full details and examples. +See the javadoc:org.springframework.amqp.rabbit.annotation.RabbitListenerConfigurer[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. diff --git a/src/reference/antora/modules/ROOT/pages/amqp/receiving-messages/micrometer.adoc b/src/reference/antora/modules/ROOT/pages/amqp/receiving-messages/micrometer.adoc index bc581083ad..8ccb1548eb 100644 --- a/src/reference/antora/modules/ROOT/pages/amqp/receiving-messages/micrometer.adoc +++ b/src/reference/antora/modules/ROOT/pages/amqp/receiving-messages/micrometer.adoc @@ -2,7 +2,7 @@ = Micrometer Integration :page-section-summary-toc: 1 -NOTE: This section documents the integration with {micrometer-micrometer-docs}[Micrometer]. +NOTE: This section documents the integration with {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). diff --git a/src/reference/antora/modules/ROOT/pages/amqp/request-reply.adoc b/src/reference/antora/modules/ROOT/pages/amqp/request-reply.adoc index 3689437cb3..e3a8634e95 100644 --- a/src/reference/antora/modules/ROOT/pages/amqp/request-reply.adoc +++ b/src/reference/antora/modules/ROOT/pages/amqp/request-reply.adoc @@ -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 {spring-amqp-java-docs}/core/AmqpTemplate.html[Javadoc of `AmqpTemplate`] for more detail. +See the javadoc:org.springframework.amqp.core.AmqpTemplate[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 {spring-amqp-java-docs}/rabbit/core/RabbitOperations.html[Javadoc for `RabbitOperations`] for more information. +See xref:amqp/template.adoc#template-confirms[Correlated Publisher Confirms and Returns] and the javadoc:org.springframework.amqp.rabbit.core.RabbitOperations[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`. diff --git a/src/reference/antora/modules/ROOT/pages/amqp/sending-messages.adoc b/src/reference/antora/modules/ROOT/pages/amqp/sending-messages.adoc index 6ff5f1257d..eff9bd900f 100644 --- a/src/reference/antora/modules/ROOT/pages/amqp/sending-messages.adoc +++ b/src/reference/antora/modules/ROOT/pages/amqp/sending-messages.adoc @@ -100,7 +100,7 @@ Message message = MessageBuilder.withBody("foo".getBytes()) .build(); ---- -Each of the properties defined on the {spring-amqp-java-docs}/core/MessageProperties.html[`MessageProperties`] can be set. +Each of the properties defined on the javadoc:org.springframework.amqp.core.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()`. diff --git a/src/reference/antora/modules/ROOT/pages/amqp/transactions.adoc b/src/reference/antora/modules/ROOT/pages/amqp/transactions.adoc index 59bb842f7b..796be4f4db 100644 --- a/src/reference/antora/modules/ROOT/pages/amqp/transactions.adoc +++ b/src/reference/antora/modules/ROOT/pages/amqp/transactions.adoc @@ -116,13 +116,13 @@ See xref:amqp/containerAttributes.adoc[Message Listener Container Configuration] [[using-rabbittransactionmanager]] == Using `RabbitTransactionManager` -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`. +The javadoc:org.springframework.amqp.rabbit.transaction.RabbitTransactionManager[] is an alternative to executing Rabbit operations within, and synchronized with, external transactions. +This transaction manager is an implementation of the javadoc:org.springframework.transaction.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 {spring-amqp-java-docs}/rabbit/core/RabbitTemplate.html[RabbitTemplate], it will autodetect a thread-bound Channel and automatically participate in its transaction. +When using Spring AMQP's javadoc:org.springframework.amqp.rabbit.core.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: diff --git a/src/reference/antora/modules/ROOT/pages/sample-apps.adoc b/src/reference/antora/modules/ROOT/pages/sample-apps.adoc index 90a2775e53..842c5c72a2 100644 --- a/src/reference/antora/modules/ROOT/pages/sample-apps.adoc +++ b/src/reference/antora/modules/ROOT/pages/sample-apps.adoc @@ -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 {spring-amqp-java-docs}/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 javadoc:org.springframework.amqp.support.converter.DefaultClassMapper[Javadoc for the `DefaultClassMapper`].