The SC-Connectors `ServiceConnector` can be customized via
`ServiceConnectorConfig`.
* Allow end-user to specify such a bean and support its injection in the
`rabbitConnectionFactory` and `producerConnectionFactory` bean definitions
**Cherry-pick to 1.3.x**
Add `spring-cloud-spring-service-connector` dependency to be able to
request from the application context only specific `RabbitConnectionFactoryConfig`.
Use `ObjectProvider.getIfUnique()` for the case when we have not a single
`RabbitConnectionFactoryConfig` bean in the ctx
* Configure Cloud CCF via Boot's `RabbitProperties`
* Obtain from the Cloud only one CF service
The `RabbitMessageChannelBinder` creates an internal distinct
`ConnectionFactory` instance based on the `RabbitProperties` for the
non-transactional producers to avoid dead locks when connection
is blocked.
In case of Cloud Connectors the `ConnectionFactory` bean is overridden,
but not `RabbitProperties`.
Therefore the original `ConnectionFactory` for consumers is good,
cloud-based, but for producers it is still based on the `RabbitProperties`
from Spring Boot, in most cases with default options.
* Add one more `producerConnectionFactory` `@Bean` to the
`CloudConnectors` configuration to obtain a distinct `ConnectionFactory`
instance from the cloud provider
* When we ara not in the cloud profile, create a fresh `ConnectionFactory`
based on the `RabbitProperties`
* Inject the extra `producerConnectionFactory` instance into the
`RabbitMessageChannelBinder` instead of the internal non-stable solution
**Cherry-pick to 1.3.x**
Fixes https://github.com/spring-cloud/spring-cloud-stream-binder-rabbit/issues/83
Expressions for the routing key and delay (when using a delayed exhange) that
include the `payload` failed because they were evaluated after the payload was
serialized.
If either expression includes `payload`, add an interceptor to evaluate the expressions
before serialization and add the results as headers.
Polish tests
Resolves#83Resolves#111
Resolves https://github.com/spring-cloud/spring-cloud-stream-binder-rabbit/issues/104
To handle the use case of a Rabbit cluster with non-HA queues where the node hosting
a queue is down, set `missingQueuesFatal` to `false` by default.
Expose this property in the consumer config, together with the redeclaration retry properties.
Docs
Fixesspring-cloud/spring-cloud-stream-binder-rabbit#95
* To avoid blocked connection dead lock on consumers add
`ConnectionFactory` clone in the `RabbitMessageChannelBinder` for
non-transactional producers
* Add `DisposableBean` implementation into the `RabbitMessageChannelBinder`
to `destroy` all the spawned internal connection factories including
`LocalizedQueueConnectionFactory`
Address some PR comments:
* Copy `RabbitConnectionFactory` from the injected `CCF`
* Don't wrap `producerCF` into the `LocalizedQueueCF`
* Polishing code style
Make Latebinding test transactional
So the same connection factory is used.
There is a race condition in the proxy.
Resolves https://github.com/spring-cloud/spring-cloud-stream-binder-rabbit/issues/75
Instead of setting `ignoreDeclarationExceptions` in the provisioner's `RabbitAdmin`, catch
the exception in the provisioner.
Use a `DeclarationExceptionEvent` to determine that the exception was thrown in some other
admin and treat the condition as fatal.