Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add queue interop driver #320

Merged
merged 3 commits into from
Sep 3, 2017

Conversation

makasim
Copy link
Contributor

@makasim makasim commented Jul 19, 2017

The driver can work with any queue interop compatible transport such as:

It also provide an extended driver version for amqp interop compatible transports. It supports some amqp specific features such as queue declaration and message couting.

TODO:

  • add tests
  • add doc

I welcome everyone who is interested in MQs to join the queue interop group

@acrobat
Copy link
Member

acrobat commented Jul 19, 2017

Thanks for the PR @makasim!

@sagikazarmark should we still merge this or have new drivers directly in a separate repo like we are going to do in #256? Or still add it here and move the packages out all in one time?

@makasim
Copy link
Contributor Author

makasim commented Jul 21, 2017

Is it going to be merged? I need kind of approval to push it forward (add tests and doc.)


return $this->consumers[$queueName];
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing newline

use Interop\Queue\PsrConsumer;
use Interop\Queue\PsrContext;

class InteropDriver implements Driver
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be final.

@sagikazarmark
Copy link
Contributor

I would be more comfortable with a separate repo.

@henrikbjorn can you please grant @acrobat and me access to creating new repos. I would like to start separating drivers in a few weeks.

@makasim
Copy link
Contributor Author

makasim commented Jul 24, 2017

Could you please create a repo for me too so I can move stuff there as well.

@kynx
Copy link
Contributor

kynx commented Jul 24, 2017

If someone's going to be separating out drivers can you have a look at https://github.com/bernardphp/OpenCloud? I did a pr for an opencloud driver ages ago- happy to pick it up again if there's any feedback.

@henrikbjorn
Copy link
Contributor

henrikbjorn commented Jul 24, 2017 via email

@henrikbjorn
Copy link
Contributor

@kynx ill merge the opencloud one and feel free to pick it up again to match the new master,

@acrobat
Copy link
Member

acrobat commented Jul 25, 2017

Yes @kynx we will merge that pr! We will start soon with moving the drivers to separate repo's and then we will also pick up your and this PR!

@sagikazarmark
Copy link
Contributor

@henrikbjorn Thanks!

@sagikazarmark
Copy link
Contributor

@henrikbjorn can you also please add me to a package on packagist as well?

The vendor is already taken by someone else. You may ask them to add your package and give you maintainership access. If they add you as a maintainer on any package in that vendor namespace, you will then be able to add new packages in that namespace. The packages already in that vendor namespace can be found at bernard

@henrikbjorn
Copy link
Contributor

What is your Packagist username?

@sagikazarmark
Copy link
Contributor

mark.sagikazar

@henrikbjorn
Copy link
Contributor

Done

@acrobat
Copy link
Member

acrobat commented Jul 26, 2017

Thanks @henrikbjorn!

@sagikazarmark
Copy link
Contributor

Thanks

@makasim
Copy link
Contributor Author

makasim commented Aug 10, 2017

Added AmqpInteropDriver which extends the functionality of InteropDriver with AMQP specific features. It could be used with php-amqplib, amqp-ext and bunny libs.

@makasim
Copy link
Contributor Author

makasim commented Aug 10, 2017

@sagikazarmark regarding separate repository. Isn't the code still merged to this repository and later it is split to the separate repository. If so, I don't see a reason why should we wait till it happens.

@makasim
Copy link
Contributor Author

makasim commented Aug 11, 2017

Added tests and docs. Ready for review.

@sagikazarmark
Copy link
Contributor

Isn't the code still merged to this repository and later it is split to the separate repository.

I am okay with merging code here (with a bit of squashing looking at the history), but I would like to avoid more releases before the driver refactor.

@makasim
Copy link
Contributor Author

makasim commented Aug 15, 2017

@sagikazarmark rebased&squashed

@makasim
Copy link
Contributor Author

makasim commented Aug 21, 2017

@sagikazarmark could you please take a look at this?

@acrobat
Copy link
Member

acrobat commented Aug 21, 2017

I've took some time off and a bit of vacation in the last weeks, but I will make some time to review pr's in the coming days!

@makasim
Copy link
Contributor Author

makasim commented Aug 21, 2017

@acrobat great! just let me know if there is anything that should be done.

@sagikazarmark
Copy link
Contributor

TBH I am not 100% sure why there is a separate driver for AMQP. That's the first thing that popped up after a quick review. Can't see any explanation in the docs either.

Other than that it's quite a PR, so I need some more time to review it.

@makasim
Copy link
Contributor Author

makasim commented Aug 22, 2017

@sagikazarmark amqp interop is an exnteded version of queue interop and it defines AMQP specific things such as create\remove a queue, ability to get message count and so on.

Obviously that any amqp interop compatible transport could be used with InteropDriver driver.

The amqp interop currently supports three major amqp clients available in PHP: php-amqplib, amqp-ext and bunny and any of them will work with AmqpInteropDriver.

@makasim
Copy link
Contributor Author

makasim commented Aug 22, 2017

Worth to mention that I am going to provide support for these interop drivers.

@sagikazarmark
Copy link
Contributor

Thanks for the explanation, I thought something similar. Just for me to understand: the AmqpInterop driver contains some extra logic for AMQP implementations which are not supported by the plain Interop driver, but any AMQP implementation should work with the normal Interop driver as well.

Is that correct?

I wonder if it would make sense to extend the interop driver instead of passing it to the AmqpInterop driver. From the above explanation it seems it does.

@makasim
Copy link
Contributor Author

makasim commented Aug 23, 2017

Is that correct?

@sagikazarmark you are absolutely right

I wonder if it would make sense to extend the interop driver instead of passing it to the AmqpInterop driver.

we can have one single driver and some if isntanceof AmqpInterop inside to enhance amqp interop features. Let me know if it is more preferred way that the current one.

@sagikazarmark
Copy link
Contributor

we can have one single driver and some if isntanceof AmqpInterop inside to enhance amqp interop features. Let me know if it is more preferred way that the current one.

Well, if we can say that it's unlikely that over time we have to fill the Interop driver with tons of ifs to support all kinds of interop variants then that could work for me as well. Would make things simpler for sure.

@makasim
Copy link
Contributor Author

makasim commented Aug 23, 2017

I don't expect anything to be added over time.

@makasim
Copy link
Contributor Author

makasim commented Aug 24, 2017

@sagikazarmark merged everything in InteropDriver.

Copy link
Contributor

@sagikazarmark sagikazarmark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had one comment, apart from that looks good to me.

/**
* @return PsrContext
*/
public function getContext()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drivers are an internal thing to Bernard. Is there any reason to expose the context?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. The method has been removed.

@makasim
Copy link
Contributor Author

makasim commented Aug 28, 2017

@sagikazarmark @acrobat a kind remainder.

Sorry If I am insistent on this one, I don't want to put this into the pending tray

@sagikazarmark
Copy link
Contributor

No problem, keep pushing it. I will give it a last shot today.

Copy link
Member

@acrobat acrobat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@sagikazarmark sagikazarmark merged commit c1e6755 into bernardphp:master Sep 3, 2017
@sagikazarmark
Copy link
Contributor

Thanks @makasim

@makasim makasim deleted the queue-interop branch September 3, 2017 17:35
@makasim
Copy link
Contributor Author

makasim commented Sep 3, 2017

Thank you too. Would you like to join queue interop group? I would really happy to see you there.

@acrobat
Copy link
Member

acrobat commented Sep 3, 2017

👍 thanks @makasim!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants