messenger-filesystem-transport icon indicating copy to clipboard operation
messenger-filesystem-transport copied to clipboard

Added sf 4.3 compatibility

Open karser opened this issue 5 years ago • 8 comments

Hi @thePanz !

The signature of TransportFactoryInterface::createTransport has changed, as of Symfony 4.3 it requires 3rd parameter: SerializerInterface.

My changes would probably break 4.2 compatibility, maybe you have better idea?

karser avatar Jun 12 '19 16:06 karser

Unfortunately the changes introduced in SF 4.3 are not compatible anymore. Check the changes in the TransportInterface. This would need more work

thePanz avatar Jun 21 '19 14:06 thePanz

That was my first attempt to switch to v4.3 but not all dependencies are ready. I'll continue working on this when I finally switch so I can test everything thoroughly.

karser avatar Jul 01 '19 16:07 karser

@thePanz Please, review my changes. I refactored the code according to the difference between AmqpExt v4.2 and v4.3.

Overall, looks like it is functioning, I tested it locally with a few thousands messages. I'm going to use this version in the dev environment.

Also there are some considerations:

  • there are ack/nack were introduced in v4.3, I added stub methods in Connection and marked them as TODO
  • In v4.3 was introduced MessageCountAwareInterface. Do we need it? If so, we need to implement it on FilesystemTransport and Connection
  • Since it introduces breaking changes, is it going to be v0.2?

karser avatar Jul 26 '19 17:07 karser

This (much needed) component [why isn't it included upstream?] needs this (much needed) update. (I can't review the PR, but depend on it to switch to messenger on 4.3)

drzraf avatar Sep 24 '19 00:09 drzraf

@drzraf the changes are quite trivial, as ack/nack requires to be able to access specific messages in the queue. This is tricky as we do not have an index of messages that we can use as a db, specifically removing a message would mean to store sparse data in our .queue file.

I am not sure on which solution would be better here. Any inputs?

thePanz avatar Sep 24 '19 10:09 thePanz

This is tricky as we do not have an index of messages that we can use as a db, specifically removing a message would mean to store sparse data in our .queue file.

Key/value storage is required. We might change format for .queue file.. It could be json, csv or even php. Or keep the same format but create multiple files for each message.

I am not sure on which solution would be better here. Any inputs?

It depends on the use case. I use this plugin only for local development and ack/nack is not that critical for me.

karser avatar Sep 24 '19 10:09 karser

@karser I am planning to deprecate and remove this transport. A better suited replacement is the doctrine-transport (or the rabbitbmq).

thePanz avatar Nov 21 '19 15:11 thePanz

That's sad. I'd say your transport better fits for local development than the alternatives you specified since it doesn't require any dependencies. I'll stick with my fork then.

karser avatar Nov 21 '19 16:11 karser