552 Commits

Author SHA1 Message Date
Gary Russell
7a92b41af8 GH-2546: Fix Super Stream Example in Docs (#2547)
Resolves https://github.com/spring-projects/spring-amqp/issues/2546

Incorrectly added prototype scope to the bean (copy/paste from test).
2023-10-25 09:48:54 -04:00
Gary Russell
d748fdfcbb Change Defaults
**cherry-pick to 3.0.x, 2.4.x**

(cherry picked from commit 09c612c4ba)
2023-10-02 12:19:29 -04:00
Gary Russell
2228d1fb0d 3.0.x Min Versions (Doc) 2023-09-07 16:59:16 -04:00
Gary Russell
1fdfe650ac GH-2482: Option for Containers to Stop Immediately
Resolves https://github.com/spring-projects/spring-amqp/issues/2482

`forceStop` means stop after the current record and requeue all prefetched.

Just close the channel - canceling the consumer first causes a race condition which
could allow another exclusive or single-active consumer to start processing while
this container is still running.

Also support async stop on DMLC (previously only available on the SMLC).

**cherry-pick to 2.4.x**
2023-07-12 14:56:48 -04:00
Gary Russell
469e7f50fe GH-2472: Doc SSL with Java or Boot
Resolves https://github.com/spring-projects/spring-amqp/issues/2472
2023-06-15 13:10:03 -04:00
Gary Russell
0cfe2f94d4 GH-2473: Clarify Choosing a Connection Factory (#2474)
Resolves https://github.com/spring-projects/spring-amqp/issues/2473
2023-06-15 12:10:24 -04:00
Gary Russell
a75b3d0837 GH-2467: Micrometer Observation for Streams
Resolves https://github.com/spring-projects/spring-amqp/issues/2467

* Fix race in test.

* Add tracing test; fix possible NPEs in stream contexts.

* Change input dir for doc generation.

* Strip package from new conventions in gen'd doc.

* Docs; polishing; fix doc generation for duplicate enum values.

* Use stream convention, regardless of native listener or not.
2023-06-01 12:05:54 -04:00
Toshiaki Maki
974a4a915f Fix typo in stream.adoc
`ConvertableFuture` -> `CompletableFuture`
2023-05-30 10:33:23 -04:00
Gary Russell
6b4b908bf4 GH-2451: Add StreamAdmin
Resolves https://github.com/spring-projects/spring-amqp/issues/2451

**cherry-pick to 2.4.x**
2023-05-25 16:29:36 -04:00
Gary Russell
e492b98bf8 GH-2461: RabbitListenerErrorHandler with Async
Resolves https://github.com/spring-projects/spring-amqp/issues/2461
2023-05-25 13:12:19 -04:00
Artem Bilan
e452af157e GH-1210: Add Kotlin suspend functions support (#2460)
* GH-1210: Add Kotlin suspend functions support

Fixes https://github.com/spring-projects/spring-amqp/issues/1210

Kotlin Coroutines are essentially `Future` wrapping.
Therefore, it is natural to have `suspend` support on `@RabbitListener`
methods as we do now for `CompletableFuture` and `Mono`

* Introduce some utilities since we cannot reuse existing from Spring Messaging:
they are there about Kotlin Coroutines only for reactive handlers
* Some code clean up in the `RabbitListenerAnnotationBeanPostProcessor`
for the latest Java
* Add optional dep for `kotlinx-coroutines-reactor` and document the feature

* * Remove unused import
2023-05-25 10:58:14 -04:00
Daniel Hammer
6b720bbd22 Docs; Align client connection order reference
Mention an `addressShuffleMode` option when describing a fail over connection factory behavior.
2023-05-23 12:06:34 -04:00
Gary Russell
d77e2d4d54 GH-2447: Publisher Confirms/Returns Doc Polishing
Resolves https://github.com/spring-projects/spring-amqp/issues/2447
2023-04-11 17:12:02 -04:00
Gary Russell
b117372ea8 GH-2445: Doc Stream Provisioning and Dependency
Resolves https://github.com/spring-projects/spring-amqp/issues/2445
2023-04-10 11:15:17 -04:00
Gonçalo Marques
b3a4b2589e Fix some typos in documentation 2023-01-18 10:25:37 -05:00
Gonçalo Montalvão Marques
c88a6580d9 Fix typo in amqp.adoc 2022-12-14 09:56:34 -05:00
Gary Russell
97df895c8e GH-1541: Fix Container Docs
Resolves https://github.com/spring-projects/spring-amqp/issues/1541

Containers can have zero queues.
2022-11-28 12:15:33 -05:00
Gary Russell
ce78ad3728 Docs for Native Images 2022-11-17 14:20:55 -05:00
Gary Russell
d8f78ee291 GH-1533: Template Receive with Consumer Args
Resolves https://github.com/spring-projects/spring-amqp/issues/1533

Allow setting consumer arguments when using non-zero receive
timeouts using the `RabbitTemplate`.

**cherry-pick to 2.4.x**
2022-11-15 14:11:20 -05:00
Gonçalo Montalvão Marques
e19be2e206 Fix typo in amqp.adoc 2022-11-14 08:23:26 -05:00
Gary Russell
79808a84b3 GH-1382: Republish Recoverer Improvements
Resolves https://github.com/spring-projects/spring-amqp/issues/1382

Add expressions; make private method protected.

**cherry-pick to 2.4.x**
2022-10-28 14:39:56 -04:00
Gary Russell
f2fc13b6e1 GH-1425: Configure ReplyPostProcessor via Factory
Resolves https://github.com/spring-projects/spring-amqp/issues/1425
2022-10-26 14:33:43 -04:00
Gary Russell
36e98a735f GH-1444: Observation Doc Gen Polishing
- single task for spans and metrics
- always gen and remove packages from file names

* Fix link in What's New; add observation properties to container factory.
2022-10-21 16:54:40 -04:00
Gary Russell
b9b83f9bf8 GH-1517: Docs and Polishing for Composite Cust. 2022-10-18 09:36:31 -04:00
Gary Russell
b1ae21cad9 GH-1419: Add RestTemplateNodeLocator
- also remove hard dependency on `spring-webflux` from `spring-rabbit-junit`.

* Use reactor-netty-http.

* Fix Javadoc.
2022-10-11 14:39:39 -04:00
Gary Russell
c143c5b022 GH-1419: Remove RabbitMQ http-client Usage
Resolves https://github.com/spring-projects/spring-amqp/issues/1419

Use Spring WebFlux instead, while allowing the user to choose some other technology
in the `LocalizedQueueConnectionFactory`.

* Rename DefaultNodeLocator; add generics.
* Remove unnecessary dependencies.
2022-10-11 11:09:51 -04:00
Gary Russell
639eb160ee GH-1444: Observablility Documentation
Resolves https://github.com/spring-projects/spring-amqp/issues/1507

Refactor for latest snapshots; add documentation generation.
Use NOOP registry and supplier for context.

Also fix class tangles.

Disable auto doc generation and polish manually.

* Fix observation of batch listeners; disable more tests temporarily.

* Add remoteServiceName to contexts; fix race in test.

* Add tests for remoteServiceName.

* Set the service name instead of overriding the getter.

* Re-enable tests.

* Switch to Spring Snapshots, Revert "Re-enable tests."

This reverts commit e0a80e372fe0e5954ddc734e2fbbf5aabe457fc9.

* Disable logback adjuster.

* Disable logback appender tests.
2022-10-06 14:14:38 -04:00
Gary Russell
506abd5e9c GH-1509: Add Concurrency for Super Streams
Resolves https://github.com/spring-projects/spring-amqp/issues/1509
2022-10-04 14:59:15 -04:00
Gary Russell
732f0da284 GH-1465: Super Stream Support in Template 2022-09-27 11:37:30 -04:00
Gary Russell
66e5c11b04 GH-1444: Listener Observability Initial Commit (#1500)
* GH-1444: Listener Observability Initial Commit

- expand scope to include error handler: https://github.com/spring-projects/spring-amqp/pull/1287
- tracing can't be used with a batch listener (multiple messages in listener call)

* Rename Sender/Receiver contexts and other PR review comments.

* Rename contexts to Rabbit...; supply default KeyValues via the conventions.

* Javadoc polishing.

* Don't add default KV to high-card KVs.

* Fix previous commit.

* Fix contextual name (receiver side).

* Fix checkstyle.

* Polish previous commit.

* Fix contextual name (sender side)

* Remove contextual names from observations.

* Fix checkstyle.

* Remove customization of KeyValues from conventions.

* Add `getDefaultConvention()` to observations.

* Fix since 3.0.

* Support wider convention customization.

* Convention type safety.

* Fix Test - not sure why PR build succeeded.

* Add Meters to ObservationTests.

* Fix checkstyle.

* Make INSTANCE final.

* Add integration test.

* Test all available integrations.

* Remove redundant test code.

* Move getContextualName to conventions.

* Add docs.

* Fix doc link.

Co-authored-by: Artem Bilan <abilan@vmware.com>

* Remove unnecessary method overrides; make tag names more meaningful.

* Move getName() from contexts to conventions.

* Fix Race in Test

* Fix Race in Test.

Co-authored-by: Artem Bilan <abilan@vmware.com>
2022-09-19 13:57:15 -04:00
Gary Russell
80f8c9c82c GH-1473: Remove Unnecessary Deprecated Interfaces
See https://github.com/spring-projects/spring-amqp/issues/1473
See https://github.com/spring-projects/spring-amqp/issues/1480

Migration interfaces to assist moving to `CompletableFuture` have been
removed from 2.4.x due to Boot auto configuration issues.

Therefore, these interfaces never existed in a released version of 2.4.x.
2022-09-13 11:18:09 -04:00
Gary Russell
02f03863b3 GH-1465: Part II - Super Stream SAC
Resolves https://github.com/spring-projects/spring-amqp/issues/1465

Add support for single active consumers on super streams.

Stop containers in test.

Use Snapshot Repo

Use snapshot repo; use TestContainers.
2022-09-07 17:19:16 -04:00
Gary Russell
ba4b62e255 GH-1449: Fix Auto Recovery Docs
Resolves https://github.com/spring-projects/spring-amqp/issues/1449
2022-09-06 15:15:11 -04:00
Ruben Vervaeke
c929cd5d35 GH-1497: Use RANDOM as default addressShuffleMode
Resolves https://github.com/spring-projects/spring-amqp/issues/1497

GH-1497: Remove deprecated setShuffleAddresses method

GH-1497: Fix failing setAddressesTwoHosts

Doc Polishing.
2022-09-06 10:16:10 -04:00
Gary Russell
158d5cd5e2 GH-1491: Support Optional/null Payloads
Resolves https://github.com/spring-projects/spring-amqp/issues/1491

**cherry-pick to 2.4.x**

* Improve connection factory bean in test.
2022-08-09 15:44:58 -04:00
Gary Russell
d96aa71ec1 GH-1489: Batch RabbitListener Improvements
Resolves https://github.com/spring-projects/spring-amqp/issues/1489

- allow listeners to consume `Collection<?>` as well as `List<?>`
- detect a non-batch listener method in the batch adapter
- coerce `batchListener` to `true` when `consumerBatchEnabled` is true
2022-08-04 16:24:50 -04:00
Gary Russell
97a508e379 GH-1480: Switch to CompletableFuture in s-r-stream
Resolves https://github.com/spring-projects/spring-amqp/issues/1480

Also reinstate deprecated `AsyncAmqpTemplate2`.
2022-07-28 16:53:42 -04:00
Gary Russell
b03a0bc9af GH-1473: Switch to CompletableFuture
Resolves https://github.com/spring-projects/spring-amqp/issues/1473

* Deprecate `AsyncRabbitTemplate2`.
* Copy implementation from  `AsyncRabbitTemplate2` to `AsyncRabbitTemplate`
* Fix other `ListenableFuture` usages.
2022-07-28 16:08:58 -04:00
Gary Russell
d143d4b7ae GH-1465: Part 1: Provision Super Streams over AMQP
See https://github.com/spring-projects/spring-amqp/issues/1465

Inspired by 29b1a3eca7/src/test/java/com/rabbitmq/stream/impl/TestUtils.java (L244-L276)

* Docs and Polishing.

- address PR review
- move abstract test class to `support`
2022-06-16 13:18:33 -04:00
Gary Russell
cffebb9d27 GH-1459: Improve MeterRegistry Discovery
Resolves https://github.com/spring-projects/spring-amqp/issues/1459

* Add micrometer properties and container customizers to LCFB.

* Use `ObjectProvider` to locate registry.
2022-05-18 15:39:40 -04:00
Gary Russell
bf32231ad6 GH-1455: AdviceChain on Stream Listener Container
Resolves https://github.com/spring-projects/spring-amqp/issues/1455

Add an advice chain to the stream listener container and its factory.
Add a `StreamMessageRecoverer` for native stream messages.
Add a retry interceptor to work with native stream messages.

**cherry-pick to 2.4.x**

* Add since to new setter.
2022-04-27 10:47:27 -04:00
Jay
015b969437 Fix AddressResolver typo in the amqp.adoc 2022-04-11 11:08:46 -04:00
Yann Bolliger
547c140906 More formatting typos 2022-04-05 09:57:51 -04:00
Yann Bolliger
de6ab797c1 Fix typo in amqp.adoc 2022-04-05 09:57:51 -04:00
Leonardo Ferreira
eccdb47155 GH-1434: Mixed CFs With/Without Confirms/Returns
GH-1434 allowing to rabbit template have multiple connection factories with not same confirms and returns flags.

GH-1434 avoiding call obtainTargetConnectionFactory twice

GH-1434 test

GH-1434 javadoc + removing else

GH-1434 fixing checkstyle

GH-1434 using publisherConfirms from PooledChannelConnectionFactory

GH-1434 adapting AbstractRoutingConnectionFactory

GH-1434 javadoc & checkstyle & BeforeEach > BeforeAll

GH-1434 javadoc

GH-1434 doc

GH-1434 doc
2022-03-30 15:28:24 -04:00
Gary Russell
cdf1a9cda0 GH-1420: Move 2.4.x What's New to Appendix
Previous commit had wrong GH.
2022-03-09 13:28:44 -05:00
Gary Russell
1cbdb7de47 GH-1251: Jackson2JsonMessageConverter Improvements
Resolves https://github.com/spring-projects/spring-amqp/issues/1420

- detect and use `charset` in `contentType` when present
- allow Jackson to determine the decode `charset` via `ByteSourceJsonBootstrapper.detectEncoding()`
- allow configuration of the `MimeType` to use, which can include a `charset` parameter

**cherry-pick to main - will require what's new fix**

* Fix typo in doc.
# Conflicts:
#	src/reference/asciidoc/whats-new.adoc
2022-03-09 13:05:35 -05:00
Gary Russell
a3aedc6707 Revise Issue Template etc. 2022-02-17 16:04:17 -05:00
Gary Russell
8b2cc61f7e GH-1422: @RabbitListener: Fix Broker-Named Queues
Resolves https://github.com/spring-projects/spring-amqp/issues/1422

Broker-named queues did not work with `@RabbitListener` because the BPP
only passed the name of the queue bean, not the bean itself, into the
endpoint.

Support bean injection; fall back to the previous behavior if a mixture
of beans and names are encountered (the containers don't support both
types of configuration).

Add a note to the javadoc to indicate that broker-named queues are not
supported via `queuesToDeclare` and `bindings` properties; such queues
must be declared as discrete beans.

* Docs.

**cherry-pick to `2.4.x` & `2.3.x`**
2022-02-14 12:13:40 -05:00
Muhammad Hewedy
49bc52d4fd fix multi-rabbit example
RoutingConnectionFactory is not a ConnectionFactory
2022-02-03 09:25:26 -05:00