Re: [rabbitmq-users] Re: Rabbit saving extra bytes for AMQP 1.0 messages

391 views
Skip to first unread message

Gabor K

unread,
Feb 25, 2019, 5:38:33 AM2/25/19
to rabbitm...@googlegroups.com
Hi,
I have the same issue:
if AMQP 0-9-1 and AMQP 1.0 client exchanges messages via RMQ 3.7.12, the received payload contains extra bytes in both direction.
Checking the issue it seemed to me that the shovel plugin could be the solution.
Shovel can do protocol conversion between AMQP 0-9-1 and 1.0.
But sending the messages via shovel did not solve the issue: the payload still contains the extra bytes.
Can you please clarify me if the shovel plugin is necessary in connecting AMQP 0-9-1 and 1.0 clients?
Thank you:
Gabor

Karl Nilsson

unread,
Feb 25, 2019, 6:29:47 AM2/25/19
to rabbitmq-users
It is not necessary no. As I explained in the other thread the extra bytes comes from the client encoding the body of your message inside an AMQP 1.0 value (most likely). Only AMQP 1.0 _data_ encoded messages are passed through as pure binary data. If you can control how your client encodes it's data you can work around this right now.

The alternative is that your consumers AMQP 1.0 decode the received message first.



It _could_ be possible to also map a single AMQP 1.0 binary value to a plain binary inside 0.9.1 _but_ it would be sent to AMQP 1.0 consumers as an AMQP 1.0 _data_ message instead of a value. Perhaps this doesn't matter so much but it is still a mutation of the original message which may or may not be desirable.

Cheers
Karl

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Karl Nilsson

Gabor

unread,
Feb 25, 2019, 8:50:17 AM2/25/19
to rabbitmq-users
Hi Karl,
thank you for your fast response.
I understand that without using the shovel the AMQP 0-9-1 message is somehow converted/mapped to AMQP 1.0 as well.
Why do not you suggest to receive the AMQP 0-9-1 by shovel, let shovel convert the message to AMQP 1.0 and send the AMQP 1.0 to the receiver client?
What is the disadvantage of shovel?
Thank you:
Gabor

Karl Nilsson

unread,
Feb 25, 2019, 10:04:29 AM2/25/19
to rabbitm...@googlegroups.com
If you need a shovel (i.e. a simple "client" that moves messages from/to a queue to/from some other endpoint that runs inside RabbitMQ) then use the shovel. There are no benefits in how the shovel encodes/decodes messages over a normal AMQP 1.0 client that I know of (and I worked on that feature) that would warrant using a shovel over a client in any other scenarios.


Karl Nilsson

Pivotal/RabbitMQ

Gabor

unread,
Feb 27, 2019, 10:20:40 AM2/27/19
to rabbitmq-users
Hi Karl,

thank you for your help again.
I would just like to summarize our main experience in solving the issue:
if AMQP 1.0 client sends message to 0-9-1 client and encodes her payload as binary in a "data section" (i.e. not in amqp-sequence section, not in amqp-value section) the 0-9-1 client shall get the the complete payload without any extra bytes.

Regards: Gabor

Karl Nilsson

unread,
Feb 27, 2019, 10:58:45 AM2/27/19
to rabbitm...@googlegroups.com
Yes

Stephane Renault

unread,
Nov 15, 2019, 9:35:02 AM11/15/19
to rabbitmq-users
Hi Karl,

I need to send a rabbitMQ (AMQP0.9.1) message to the IBM MQ (AMQP1.0) via a shovel, the message  arrives in the queue but there is a header in message data and in IBM MQ the format is MQAMQP.

The dynamic Shovel is defined by RabbitMQ command rabbitmqctl : 
rabbitmqctl -n RMQFRRTTST01 -q set_parameter -p /vtst shovel SHOV_LOQ.RABBIT2MQ '{"src-uri": "amqp:///%2Fvtst", "src-queue": "LOQ.RABBIT2MQ", "src-protocol": "amqp091", "dest-uri": ["amqp://mqm:***@sb034tts.mc2.renault.fr:5672/?heartbeat=5&connection_timeout=50000"], "dest-protocol": "amqp10","dest-add-forward-headers":true, "dest-address": "RABBIT2MQ","prefetch-count":1, "dest-properties": {"to":"amqp://sb034tts.mc2.renault.fr:5672/RABBIT2MQ", content_type":"text/plain","content_encoding":"utf8"}, "dest-application-data": {body? data? amqp-sequence? amqp-value?...}, "ack-mode":"on-confirm","delete-after":"never","reconnect-delay":1800}'

What should i set in the application-data to avoid the extra characters (.Su..) be added in the message data ? 
0053 75A0 074D 5347 5F54 5354           '.Su..MSG_TST    '
 
Thank you for your help.
Stéphane.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitm...@googlegroups.com.

To post to this group, send email to rabbitm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Karl Nilsson

Pivotal/RabbitMQ
Reply all
Reply to author
Forward
0 new messages