* When output-bindings config is explicitly used for StreamBridge
and the RabbitMQ routing-key-expression is provided, Spring Cloud Stream
is throwing an exception due to a proper function is not found in
the catalog. Bypassing this step and letting the bootstrapping continues
if output-bindings and RabbitMQ routing-key-expression combination is used.
* Adding tests to verify
Resolves https://github.com/spring-cloud/spring-cloud-stream/issues/2921
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
Remove also a duplicated code from the `setAsync()`
which, essentially, may lead to the problem with class loader when `context-propagation` is optional on classpath
Resolves https://github.com/spring-cloud/spring-cloud-stream/issues/2883
When an applicaiton provides a custom errorChannel bean that is not of type
`PublishSubscribeChannel`, the application fails to start with a CCE. This is
because `BindingServiceConfiguration` uses a hard cast on `PublishSubscribeChannel`
without pre-checking the channel type. Fixing this issue.
Fixes https://github.com/spring-cloud/spring-cloud-stream/issues/2885
The `DirectWithAttributesChannel` used by `StreamBridge` is missing naming
information. Adding the proper application context and component name data
to the channel so that it is able to construct a name when queried.
The expectation is like this `Binder<T, C extends ConsumerProperties, P extends ProducerProperties>`
so, the `BinderCustomizer` must be in extension bounds as well.
* Move Javadocs from the `BinderCustomizer.customize()` to the class level
* Add `BinderCustomizer` verification to the `KafkaConfigCustomizationTests`
Fixes https://github.com/spring-cloud/spring-cloud-stream/issues/2794
The custom ObjectMapper used in AMCB is unable to serialize java.time.Duration
values. To fix this, the ObjectMapper needs to register the JavaTimeModule from
the jackson-datatype-jsr310 libarary.
Adding a test to verify the fix.
- When closing multi-binder contexts, the application throws a StackOverflow error
due to an unnecessary addition of the binder child context as a separate bean
in the main context. This was done previously for testing purposes.
- Disabling the affected tests in the Pulsar binder until we come up with a
different solution.
Resolves https://github.com/spring-cloud/spring-cloud-stream/issues/2870
- When there are multiple output bindings present and one of them defines
a routing-key-expression, there is a bug that bypasses the code that skips
the output conversion. This results in the framework attempts a pre-mature
type conversion causing in later downstream errors. This happens because
MessageConverterConfigurer tries to find a corresponding function for the
entire function definition rather than using the individual function under
consideraion. Fixing this issue by properly keeping track of the function
name keyed off of the channel name, since channel name is what
MessageConverterConfigurer uses to retrieve info about the function name.
Resolves https://github.com/spring-cloud/spring-cloud-stream/issues/2847
- With pollable consumers, bindings actuator endpoint throws
an exception since it cannot find the binding key in the bindings
map (the key is stroed with the actual destination topic).
Addressing this issue by quering the binding with the binding name.
Resolves https://github.com/spring-cloud/spring-cloud-stream/issues/2849
- In child test contexts, we are not able to set the logging levels
and this affects certain AOT integration tests. This does not seem
to be an issue in real applications. Adjust the logging levels
becasue of this in BinderChildContextInitializer and related classes.
- Re-enable BinderChildContextInitializerTests
- Add KafkaStreams related native hints (Note: Once we add the
Kafka Streams specific 3rd party hints to the reachability
metadata repository, we will remove those hints from the binder)
- Related changes in DefaultBinderFactory
- KafkaStreamsBindableProxyFactory changes triggered by AOT/native
Resolves https://github.com/spring-cloud/spring-cloud-stream/issues/2323
Addressing PR review comments
Resolves#2832
- When using multi-binders with custom binders and running in AOT mode,
there is a regression that is causing some issues for propertly
identifying the binders during the AOT phase. It forces the users
to provide property in the form of `spring.cloud.stream.binders.binders...`
Fixing this issue by properly binding the custom binders in BinderChildContextInitializer.
Resolves https://github.com/spring-cloud/spring-cloud-stream/issues/2828Resolves#2834
- When native encoding is used, StreamBridge is not setting
partitioning interceptor which calls the PartitionHandler.
This is a regression issue and adding the interceptor explicitly
when native encoding is used.
Resolves https://github.com/spring-cloud/spring-cloud-stream/issues/2815Resolves#2831
- Ensure that the Pulsar binder default properties can be properly
expressed via spring.cloud.stream.pulsar.default property prefix.
- Add the binder child context bean with the name binderName_binderProducingContext
into the parent application context so that individual beans from the binder context
can be easily queried.
Resolves https://github.com/spring-cloud/spring-cloud-stream/issues/2806
- When StreamBridge#send is called with binder-name and custom content-type,
it does not honor the content-type value, but default to application/json.
Fixing this issue for this call path by explicitly checking for any custom
content-type provided on the binding.
Resolves https://github.com/spring-cloud/spring-cloud-stream/issues/2805Resolves#2813