GitXplorerGitXplorer
k

jms-messenger-adapter

public
9 stars
8 forks
0 issues

Commits

List of commits on branch master.
Verified
e676dc7c607c51e1d637d0783e75b4716e4e1abf

Make adapter compatible with PHP8 (#22)

committed 3 years ago
Verified
8d4949ab535202934fb84e6f385db3aaa475d98b

Added new stamps from symfony 5.2 (#21)

committed 4 years ago
Verified
12fe6c807e0c4b0728d9aff1638cb27eaf6227c5

Added symfony 5.1, changed type of Exception from Interface to concrete implementation (#20)

committed 4 years ago
Verified
aac8ee0a1b5f2eae05fbe9cb9ed2cf0ac7bf3966

Added missing properties to Symfonys FlattenException. (#19)

committed 4 years ago
Unverified
595e1b320ae765b19d0997bcd51c8e688102edb3

Update dev-master version

kkunicmarko20 committed 5 years ago
Unverified
df7f87d0b000377f665004c63366ccb55f61feae

Allow failure for e2e test

kkunicmarko20 committed 5 years ago

README

The README file for this repository.

JMS Messenger Adapter

Use JMS Serializer with Symfony Messenger.

PHP Version Latest Stable Version Latest Unstable Version

Build Status Coverage Status

Documentation

Installation

Add dependency with Composer:

composer require kunicmarko/jms-messenger-adapter

Symfony

Enable the bundle for all environments:

// bundles.php
return [
    //...
    KunicMarko\JMSMessengerAdapter\Bridge\Symfony\JMSMessengerAdapterBundle::class => ['all' => true],
];

Configuration

#config/packages/jms_messenger.yaml
jms_messenger:
    format: json # xml, json
    serializer_id: messenger.transport.jms_serializer

Serialized id should be configured in the messenger config, in case you did not get the recipe, just add:

#config/packages/jms_messenger.yaml
framework:
  messenger:
    enabled: true
    serializer:
      default_serializer: messenger.transport.jms_serializer

Stamps

This library provides additional stamps that will use JMS Deserialization/Serialization Context for serializing/deserializing messages.

use JMS\Serializer\SerializationContext;
use KunicMarko\JMSMessengerAdapter\Stamp\SerializationContextStamp;

$context = SerializationContext::create();
$context->setGroups(['foo']);
        
$messageBus->dispatch(new Message(), [new SerializationContextStamp($context)]);