Commit Graph

46 Commits

Author SHA1 Message Date
Artem Bilan
c96a62f163 GH-2939: Rely on custom AmqpHeaders.RETRY_COUNT for server retries
Fixes: https://github.com/spring-cloud/spring-cloud-stream/issues/2939

The RabbitMQ 4.0 does not deal with client side `x-*` headers.
Therefore, an `x-death.count` is not incremented anymore when
message is re-published from client back to the broker.

* Spring AMQP 3.2 has introduced an `AmqpHeaders.RETRY_COUNT` custom header.
Use `messageProperties.incrementRetryCount()` in the `RabbitMessageChannelBinder`
when we re-published message back to the broker for server-side retries
* Fix docs respectively

Resolves #3019
2024-10-17 12:00:11 +02:00
Soby Chacko
bf9ea9e626 Fix Rabbit binder compiliation issues 2024-10-14 14:19:45 -04:00
Oleg Zhurakousky
6f9809eba1 Fix depreactions 2024-09-27 16:41:56 +02:00
Oleg Zhurakousky
56047ddb19 GH-2997 Fix support for producer's error-handler-definition
Resolves #2997
2024-09-24 17:20:46 +02:00
Soby Chacko
29a3558329 Make MessageConverterHelper bean names distinct in binders. 2024-09-19 16:16:41 -04:00
Oleg Zhurakousky
14c10462f8 GH-2994, GH-2986 Add initial support for customizing Message Converter behavior
primarily during batch processing.
2024-09-16 16:10:38 +02:00
Ömer Çelik
8e5f67a1a6 Code cleanup
Resolves #2990
2024-08-20 15:03:39 +02:00
Ömer Çelik
7fefaa38c0 Code cleanup 2024-08-20 12:53:03 +02:00
spencergibb
42c42104ea Fixed compile errors with replacements for deprecations 2024-08-05 15:53:43 -04:00
Soby Chacko
244de0fcea Rabbit biner AOT/native runtime hints
* Add missing native runtime hints for the Rabbit binder properties classes

Resolves https://github.com/spring-cloud/spring-cloud-stream/issues/2938
2024-05-29 16:59:46 -04:00
Soby Chacko
fd9fa80055 Test cleanup
* Use `EnableAutoConfiguration` instead of `SpringBootApplication` in tests
2024-05-16 15:28:54 -04:00
Artem Bilan
3e24d331db Rework observability for Rabbit Binder (#2903)
Fixes: #2901 

* Rework an observation for Rabbit Binder

The observation propagation doesn't work in multi-binder configuration

* Remove `ObservationAutoConfiguration` since it is not visible in case of multi-binder configuration
* Instead move `setObservationEnabled` flag setting to the `RabbitMessageChannelBinder`
* Add `io.micrometer.observation.ObservationRegistry` into `shared.beans` to make it visible for binder-specific application context
* Add `RabbitMultiBinderObservationTests` integration test where Rabbit Binder is in a multi-binder environment

As a side effect, this fixes an observation propagation for the Kafka binder as well in the multi-binder environment.
Its configuration is OK, but an `ObservationRegistry` must make it visible for the binder-specific application context.
See the mentioned `shared. beans`

Related to https://github.com/spring-cloud/spring-cloud-stream/issues/2901
Also see https://github.com/spring-cloud/spring-cloud-stream/issues/2902 for possible evolution

* Update the copyright of the affected classes
2024-02-14 18:53:06 -05:00
Soby Chacko
bafffad0f5 Test cleanup in rabbit binder modules
- Remove the test name prefix from the test methods in the rabbit binder modules
 - package protected tests in rabbit binder

Part of fixing https://github.com/spring-cloud/spring-cloud-stream/issues/2371.
2023-11-08 12:49:00 -05:00
Soby Chacko
36a43be235 package protected tests in rabbit binder 2023-11-02 15:34:17 -04:00
Oleg Zhurakousky
38ce1f79d9 Fix property value type 2023-09-26 07:09:46 +02:00
Byungjun You
7895025c47 Use 'instanceof' pattern variable
Update authors and copyright years

Fixing checkstyle issue
2023-01-26 11:30:04 -05:00
刘鑫
af2df8ba0e some new features of jdk to optimize the code 2023-01-03 14:09:58 +01:00
Oleg Zhurakousky
b8a492bf90 Kotlin cleanup 2022-12-27 15:42:36 +01:00
Oleg Zhurakousky
c9778d88c9 Fixing checkstyle from previous commit
Resolves #2567
2022-11-29 11:30:50 -08:00
Kim Escobar
c1ce3cec75 Fix ClassCastException when using batch mode
Fix ClassCastException when handling error while using batch mode that prevents the republish of the message into the DLQ. The issue happened whenever the republish to dlq was enabled or if republish was disabled and max attempts were > 1 while the batch mode was enabled, because the handler was not expecting the the sourceData for the ErrorMessage could be a list of amqp message.
2022-11-29 10:40:17 -08:00
Oleg Zhurakousky
58ef5b0479 GH-2570 Ensure consistency in error handling
Rework error handling documentation
Remove dependence and usage of global errorChannel

Resolves #2570
2022-11-29 10:04:03 -08:00
Oleg Zhurakousky
b86e713a58 Fix general Observablity support as well as Rabbit Observability support 2022-10-24 17:42:43 +02:00
Gary Russell
d93a4a0c4a GH-2510: RabbitMQ Super Streams Concurrency
Add support for concurrency.

Use try with resources in stream tests.

Fix Test with Latest Boot

Resolves #2524
2022-10-19 09:36:30 +02:00
Oleg Zhurakousky
d77f07e7e8 Polishing 2022-10-13 16:49:08 +02:00
Gary Russell
48c8550753 Remove Usage of RabbitMQ http-client
Replace with `WebClient`.
2022-10-13 16:48:56 +02:00
Oleg Zhurakousky
7bd67c7776 Revert "Revert "GH-2510: Rabbit Binder Scale-out on Super Stream""
This reverts commit c28873c870.
2022-10-06 14:01:00 +02:00
Oleg Zhurakousky
c28873c870 Revert "GH-2510: Rabbit Binder Scale-out on Super Stream"
This reverts commit 16c8591ddd.
2022-10-05 21:31:01 +02:00
Oleg Zhurakousky
2e6eadefa3 Set more 'proxyBeanMethods' to false 2022-10-05 13:27:07 +02:00
Oleg Zhurakousky
3317d38779 Set 'proxyBeanMethods' to false 2022-10-05 09:30:04 +02:00
Gary Russell
16c8591ddd GH-2510: Rabbit Binder Scale-out on Super Stream
Resolves https://github.com/spring-cloud/spring-cloud-stream/issues/2510

New feature on RabbitMQ (Super Stream with Single Active Consumer) enables
scaling out app instances when using this queue type/config.

`RabbitStreamMessageHandler` is now available in Spring Integration.
2022-09-27 12:51:42 -04:00
Oleg Zhurakousky
60ddac5560 Polish Kinesis binder following previous commit 2022-09-27 17:03:15 +02:00
Oleg Zhurakousky
5035a40990 GH-2512, 2507 Establish binder identity & change error channel binding scheme
This commit establishes the concept of binder identity (binder instance identity) to be used in cases where unique-to-the-binder-instance naming is required.
For example such naming is required to fix GH-2507 where error channel names could colide if two binders use the same destination name.

Resolves #2512
Resolves #2507
2022-09-27 16:02:24 +02:00
Oleg Zhurakousky
65c6274a11 GH-2511 Fix Rabbit environment tests/binder
Resolves #2511
2022-09-26 11:39:45 +02:00
Oleg Zhurakousky
00d0c6bacf Add new spring-boot .imports files and move auto-configuration classes there 2022-09-22 17:53:47 +02:00
Oleg Zhurakousky
fbdf2dc40b Fix Rabbit tests 2022-09-12 15:27:52 +02:00
Gary Russell
4fda96507c GH-2453: RMQ: Full Support for Alternate Exchange
Resolves https://github.com/spring-cloud/spring-cloud-stream/issues/2453

Previously, to configure the use of an alternative exchange (used to route
messages when no queue is bound), the user had to manually declare the
exchange and any bindings, and modify the destination exchange using a
`DeclarablesCustomizer` bean.

Add first class support to configure the destination exchange and, optionally,
provision the alternate exchange as well as optionally binding a specific
queue to it.

Resolves #2502
2022-09-01 16:44:15 +02:00
Gary Russell
f7146ad02e GH-2483: RMQ: Fix Redeclare Multi Routing Keys
Resolves https://github.com/spring-cloud/spring-cloud-stream/issues/2483

https://github.com/spring-cloud/spring-cloud-stream-binder-rabbit/issues/242
added support for binding a queue with multiple routing keys. However, only
one binding was added to the `autoRedeclarContext`.

Use the `Declarables` wrapper to support multiple instances with the same
name.

**cherry-pick to 3.2.x**
Resolves #2484
2022-08-18 15:47:17 +02:00
Chris Bono
f94da9d311 Update Spring Boot from 3.0.0-M4 -> 3.0.0-SNAPSHOT
Adapts to the following changes in upstreams libs:

- Spring Kafka removed ListenableFuture
- Spring AOT changed generator API

Fixes #2473 #2465

Checkstyle fixes
2022-08-09 10:32:25 -04:00
Oleg Zhurakousky
88e5f88270 GH-2455 Fix the AOT Binding initialization logic
This commit also includes partial work to ensure framework works in full native/AOT mode.

Also, PollableBean remains and will simply not work in AOT mode until https://github.com/spring-projects/spring-framework/issues/28748 is resolved. That said, i will be deprecating t and it will be removed in the next release given that we already have configurable alternative

Resolves #2456
2022-07-22 13:53:51 +02:00
Chris Bono
3de0ed44e2 Use testcontainers for Rabbit binder integration tests
Fixes #2341

Resolves #2358
2022-04-22 12:15:10 +02:00
ben-enfuse-io
e983366b8b Change compression level to Integer and only set if not null.
Resolves https://github.com/spring-cloud/spring-cloud-stream/issues/2328
2022-04-14 10:53:55 -04:00
spencergibb
ee50d722a5 formatting 2022-03-30 12:44:56 -04:00
Christian Tzolov
d57b445a62 Add connectionFactory getter
Resolves #2314
2022-03-30 12:09:34 -04:00
Gary Russell
8a8a440c73 GH-2307: Fix Problems with Rabbit Declarables
Resolves https://github.com/spring-cloud/spring-cloud-stream/issues/2307

- when creating `Declarables` beans for redeclaration after a connetion failure
  2 DLX/DLQ bindings used the same bean name so the second one was never recovered/
- removing consumer `Declarable` beans from the `autoDeclareContext` was incomplete
- removing producer `Declarable` beans was not performed at all

- fix bean names; fix cleanup; add tests for all config scenarios
- check cleanup in all `RabbitBinderTests`

**cherry-pick to 3.2.x when the mono repo is established**
Resolves #2309
2022-03-25 11:21:55 +01:00
Soby Chacko
e1232ae731 Restructuring the repository 2022-02-23 19:42:29 -05:00
Soby Chacko
585f77e589 Relocate both Kafka and Rabbit binders within core 2022-02-23 15:41:13 -05:00