Conversation
lchrusciel
left a comment
There was a problem hiding this comment.
I'm mostly ok with it, I've pointed out only minor changes. But can you provide any live example of usage? I'm just curious.
| ], | ||
| ], | ||
| ], | ||
| ]; |
| ], | ||
| ]; | ||
|
|
||
|
|
| 'fr_FR' => 'Vente croisée', | ||
| ], | ||
| ], | ||
| ]; |
| function it_should_be_constructed_correctly() | ||
| { | ||
| $payload = [ | ||
| 'foo' => 'bar' |
There was a problem hiding this comment.
Could be fitted into one line
| $producer->publish(json_encode([ | ||
| 'type' => 'message_type', | ||
| 'payload' => $item, | ||
| 'recordedOn' => (new \DateTime())->format('Y-m-d H:i:s'), |
There was a problem hiding this comment.
Just an idea. We could extract this format to some constant, WDYT?
|
|
||
| use Symfony\Component\EventDispatcher\Event; | ||
|
|
||
| class MessageEvent extends Event |
There was a problem hiding this comment.
Should this class be extendable?
|
|
||
| /** | ||
| * @param ProducerInterface $producer | ||
| * @param $messageType |
There was a problem hiding this comment.
It looks OK, but this kind of support for events should be added in a ItemWriterInterface decorator named like EventDispatchingItemWriter - then we wouldn't need to modify all the specs and modify existing classes but just add this one and change dependency injection configuration, separating the concerns.
|
@lchrusciel, these events are useful when you want do have some additional logic after message was published. For example, Akeneo stores categories in a @pamil, OK, I'll create the decorator. Also, i see that different |
No description provided.