Static shovels do not work in v4 when the topology is imported from a definitions file at boot time #14668
-
Describe the bugGiven two RabbitMQ servers, When using RabbitMQ 4.0.1, the static shovel worker fails (see the error in the attached image). It connects to the destination RabbitMQ server, but then immediately stops and closes the connection due to this error. This issue does not occur with the latest RabbitMQ v3 release (3.13.7). Therefore, I believe the breaking behavior was introduced in version 4.0.1. Since the topology is automatically imported from a definitions file at startup, I also tried configuring the Shovel plugin to wait until the queue is available by adding the following line
Please note that these issues also occurs with the latest RabbitMQ releases, 4.1.4 and 4.2-rc. Reproduction steps
Expected behaviorThe static shovel should be in a running state and not display any errors. Additional contextVersions: Rabbitmq 4.0.1, Erlang 26 (or newer) I have uploaded an intentionally simplified docker-compose file to demonstrate the issue. Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
This is not a bug. Static shovels are not particularly smart, they try to run their resource declarations and assume that all those operations will succeed. We won't try to make them smarter. Static shovels are a feature from 2009, that is, before dynamic shovels (or even the runtime parameters subsystem they depend on) existed. It has effectively no good use cases today, in particular in the described scenario where a definition file is imported. As of RabbitMQ Or, well, all but one: the relative order of shovel startup and definition import. This was addressed in 2020 in #2396, and further improved in the already mentioned change in #11793. Both the dynamic shovel doc guide and static shovel one cover the predeclared topology feature. To quote one of those guides:
|
Beta Was this translation helpful? Give feedback.
This is not a bug. Static shovels are not particularly smart, they try to run their resource declarations and assume that all those operations will succeed. We won't try to make them smarter.
There is nothing a shovel can do about a queue with a queue property mismatch (an existing queue has different properties than what a shovel is configured to use), for example.
Static shovels are a feature from 2009, that is, before dynamic shovels (or even the runtime parameters subsystem they depend on) existed. It has effectively no good use cases today, in particular in the described scenario where a definition file is imported.
Definitions will include dynamic shovel definitions, which operators…