rabbitmq-server icon indicating copy to clipboard operation
rabbitmq-server copied to clipboard

ActiveMQ to RabbitMQ shovel results in amqp header data being inserted in message data

Open MrRoss256 opened this issue 1 year ago • 5 comments

Describe the bug

As discussed on the Slack thread https://rabbitmq.slack.com/archives/C1EDN83PA/p1727472217316949, when a message is exchanged between an ActiveMQ broker and a RabbitMQ broker using a dynamic shovel some binary data appears at the beginning of the message. This looks like some AMQP control data. The shovel is configured as AMQP 1.0 -> AMQP 1.0, although the issue appears to happen with AMQP 1.0 -> AMQP 0.9.1.

The comment from the team was that the amqp-value data is being copied to the data section, and that the shovel has not been updated for the latest 4.0.2 release.

The issue existed in v3.

RabbitMQ: 4.0.2 amqp-client: 0.1.0 AWS ActiveMQ Version: 5.18.4

Reproduction steps

  1. Create a dynamic shovel between an Active MQ broker and RabbitMQ, shovel definition below (the same issue occurs with a 1.1 -> 0.9.1 shovel). ActiveMQ is the source broker at 192.168.56.45.
  {
    "node": "rabbit@host",
    "timestamp": "2024-10-05 12:02:22",
    "name": "ActiveMQ",
    "vhost": "/",
    "type": "dynamic",
    "state": "running",
    "src_uri": "amqp://guest:[email protected]:5672?verify=verify_none",
    "src_protocol": "amqp10",
    "dest_protocol": "amqp10",
    "dest_uri": "amqp://guest:guest@localhost:5672",
    "src_address": "OUT_Q",
    "dest_address": "IN_Q",
    "blocked_status": "running"
  }
  1. Exchange a message between the ActiveMQ broker and consume it from the RabbitMQ broker (note the issue can be seen on the RabbitMQ management console where the message will be represented in Base64).
  2. The consumed message will have a few bytes of binary data appended to it. The message sent is "Message", what is received is "�SwMessage" (base 64 AFN3oQdNZXNzYWdl).

Expected behavior

The message published by ActiveMQ should be consumed by the client without the binary data.

Additional context

No response

MrRoss256 avatar Oct 04 '24 21:10 MrRoss256

@MrRoss256 I'd like to see more information than "create a dynamic shovel". What exactly should be the parameters?

michaelklishin avatar Oct 04 '24 23:10 michaelklishin

Thanks @michaelklishin, added additional details of the shovel configuration extracted from the /api/shovels/ API.

MrRoss256 avatar Oct 05 '24 15:10 MrRoss256

This is a bug in the shovel plugin. The shovel plugin must forward the bare message as is instead of converting from an amqp-value section to a data section.

ansd avatar Oct 07 '24 06:10 ansd

Can confirm similar behavior with Azure Service Bus to RMQ v3.13.7

Message Body is in Base64 and upon decode the actual json text message is prefixed with �Sw Leveraging Decode + Strip using regex match ^[^_]*\{ and replace with { before actually processing the json text message further

zoomingrocket avatar May 30 '25 18:05 zoomingrocket

This is the same thing fundamentally that https://github.com/rabbitmq/rabbitmq-server/issues/13957.

michaelklishin avatar May 30 '25 19:05 michaelklishin