Patch (to be ported)
Project:
RabbitMQ
Version:
4.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
20 Jan 2024 at 05:07 UTC
Updated:
18 Feb 2024 at 19:01 UTC
Jump to comment: Most recent
Comments
Comment #3
cmlaraThis adds 2 serializers based on core's existing. Both throw an on-api Exception when a failure occurs (serialize() indicates it can never fail and does not have an exception). This is mandatory to properly implement #3416008: Make conversion from json to php serialization easier when upgrading to 4.x and simultaneously fixes a silent bug (that even core has) where serialization failures may be silently hidden. The JSON serializer matches our historical use of json_encode() as compared to Core which uses more escaping for web transfer.
We can remove our own PHP serializer after #3421234: Json and PHP serializers should throw exception on failure. We may want to keep our own JSON serializer due to difference in quoting options.
With this new structure any type of serializer can be implemented to meet the data transfer needs. In theory the core YAML serializer is already compatible and would just need to be tagged with
rabbitmq_serializerto be utilized.I have not implemented this for the Queue workers as they have their own method of defining the serializer.
This will need a 3.x backport.
This does not provide a method to change the serializer globally. I believe we can consider that acceptable given the reason we implemented PHP in 4.x was to avoid an API breach. It would seem reasonable to require an admin to configure each queue that has been verified as acceptable to use non-php serialization.
Comment #5
zach.bimson commentedComment #8
cmlaraI still need to look at backporting this to 3.x to allow a smoother path to 4.x.