-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix content_type for AMQP Message #740
Fix content_type for AMQP Message #740
Conversation
The property "Content-type" does not exist. Use "content_type" instead. Work for RabbitMQ.
https://www.rabbitmq.com/tutorials/amqp-concepts.html says:
This does not really reassure me that this PR is correct.. Any clue @videlalvaro? :) |
Per protocol spec it should be The other PHP library uses underscores as well: https://github.com/php-amqplib/php-amqplib/blob/master/PhpAmqpLib/Message/AMQPMessage.php#L28 so if by mistake your message is created using |
OK thanks. It seems AMQPExchange from the amqp extension uses Content-type http://php.net/manual/sr/amqpexchange.publish.php Depends on the docs language tohugh, http://php.net/manual/pl/amqpexchange.publish.php shows content_type.. So maybe it changed? @macintoshplus could you try what happens if we send both? Would that be a good way to work with all versions? Ping @lstrojny any help here would be welcome, if we can check for the extension version or something that'd be the best I guess. |
Hi, RabbitMQ ignore all unknown properties. I don't know other AMQP implementation. Send twice key for the content-type, should be a good idea. |
Why send it twice and not send the proper one, assuming RabbitMQ is the On Wed, Mar 9, 2016 at 10:14 PM, Jean-Baptiste Nahan <
|
My point was that I don't think the code is wrong, but just outdated. If the php AMQP extension indeed changed this then depending on the installed version we should send A or B. That's why I want to hear from the maintainers there before taking action either way. |
@Seldaek just go with |
OK thanks :) |
…type Fix content_type for AMQP Message
If use the AmqpHandler with the php-ext amqp, the content type is
plain/text
for each message in the queue because the property name is wrong written.This pull request, change the property name
Content-type
by correct property namecontent_type
.The patch work fine with RabbitMQ.