rabbitmq-server
rabbitmq-server copied to clipboard
AMQP 1.0 Application Properties lost when shovelling to an AMQP 0.9.1 broker
Describe the bug
RabbitMQ Shovel currently does not keep the AMQP 1.0 Application Properties and AMQP 0.9.1 Properties/Headers in sync when copying messages between exchanges or queues when transferring messages between AMQP 1.0 and AMQP 0.9.1 brokers as per https://www.rabbitmq.com/docs/conversions
Properties/Headers are retained when shovelling from AMQP 0.9.1 -> AMQP 1.0 but are lost when shovelling from AMQP 1.0 -> AMQP 0.9.1 in RabbitMQ V4.*.
Properties/Headers are retained in both directions in RabbitMQ V3.12.11+ and V3.13.5+.
Reproduction steps
- Set up a shovel from AMPQ 1.0 to AMQP 0.9.1
- Publish a message to the AMQP 1.0 broker with Application Properties
- The received message on the AMQP 0.9.1 broker has no Properties/Headers
Expected behavior
The message received from the shovel contains the converted Properties/Headers.
Additional context
Refer to https://github.com/rabbitmq/rabbitmq-server/issues/7508 and https://github.com/rabbitmq/rabbitmq-server/pull/11729
As explained in https://github.com/rabbitmq/rabbitmq-server/pull/11729#issuecomment-2911345020, the solution for RabbitMQ 4.x should use the rabbit_queue_type interface directly and should convert between protocols using the mc (message container) module.
Advantages:
- the well documented conversions in https://www.rabbitmq.com/docs/conversions are followed
- no duplication of conversion rules how messages are converted from AMQP 0.9.1 to AMQP 1.0 (or vice versa)
Hi @ansd, my apologies I misunderstood your prior message. I thought you were referring to a different method of fixing the bug, not that there already exists different functionality to achieve this.
Can you please direct me to the documentation on how to set this up as I have searched the RabbitMQ docs and tried a few different configurations with no success.
Below is my setup:
- RabbitMQ 4.1.0
- Messages generated in Azure Service Bus with Broker Properties (correlationID) & Custom Properties (Type, Version and routing_key) (AMQP 1.0)
- RabbitMQ shovel used to read from Service Bus and route messages to a RabbitMQ queue.
- Messages consumed using AMQP 0.9.1
I was initially doing the conversion using the shovel (Source protocol AMQP 1.0 & destination AMQP 0.9.1) and getting no properties. I have just attempted to shovel with both source and destination AMQP 1.0 and still getting no properties other than delivery_mode: 2 being added.
As mentioned, conversion using the shovel successfully retains the properties for RabbitMQ V3.12.11+ and V3.13.5+.
@DHoskin-Aurizon David is describing a different implementation for 4.x (compared to what was accepted for 3.13.x). That's not the same as "there already exists different functionality to achieve this".
What exists is a set of internal API elements that should be used in all 4.x release series.
@michaelklishin thanks for the clarification. If I understand your comment correctly, the functionality I am seeking is indeed a bug in the 4.x release series.
I believe this has been resolved through introducing of local shovels in 4.2. Local shovels use the internal rabbit_queue_type interface directly as David described.