Skip to content

Message body serialization other than JSON #316

Closed

Description

@aurimasniekis

Hi guys, I was looking into Enqueue\Client\Producer::prepareBody and realized that there is no way to use custom serializer in this context apart JSON

Activity

  1. makasim commented on Jan 9, 2018

    @makasim
    Member
  2. aurimasniekis commented on Jan 9, 2018

    @aurimasniekis
    Author

    But validation of content type will be done before extensions are called: https://github.com/php-enqueue/enqueue-dev/blob/master/pkg/enqueue/Client/Producer.php#L54

  3. makasim commented on Jan 9, 2018

    @makasim
    Member

    True, so we need an extra extension point, which is called before prepareBody method. Something like prePrepareBody.

  4. aurimasniekis commented on Jan 9, 2018

    @aurimasniekis
    Author

    Yep, would be awesome, as I am want to use serialized objects ;)

  5. makasim commented on Jan 9, 2018

    @makasim
    Member

    @aurimasniekis would be great if you could open a PR.

  6. aurimasniekis commented on Jan 9, 2018

    @aurimasniekis
    Author

    If we going to extend ExtensionInterface it will cause breaking changes...

  7. added this to the 0.9 milestone on Jan 9, 2018
  8. makasim commented on Aug 30, 2018

    @makasim
    Member

    @aurimasniekis in 0.9 you can do it by adding an extension with onPreSendEvent or onPreSendCommand method that converts body to a string.

    Take a look at default one https://github.com/php-enqueue/enqueue-dev/blob/master/pkg/enqueue/Client/Extension/PrepareBodyExtension.php#L15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions