Vinelab / bowler

RabbitMQ wrapper for Laravel
MIT License
45 stars 9 forks source link

How to make tenant aware for multi tenant application? #68

Open gwachhamit opened 2 years ago

gwachhamit commented 2 years ago

How can we make this package and rabbitmq multi-tenant aware for multi-tenant application?

I am having a great problem implementing rabbitmq with this package for multi tenant application.

KinaneD commented 2 years ago

Hello @gwachhamit, You should be looking into Rabbitmq Virtual Hosts.

For multi-tenant support, your application would need to register a new Connection instance per vHost.

gwachhamit commented 2 years ago

@KinaneD I have create separate vHost per tenant. The problem is while consuming the message-event. Is there any way we can mention the rabbitmq credentials/vHost while consuming message-event. Lets say for this package we have command php artisan bowler:consume example_queue can we pass any argument to specify rabbitmq credentials/vHost?

KinaneD commented 2 years ago

Hi @gwachhamit I would really appreciate if you can share a scenario or a use case of what are your expectations.

You can get the Virtual Host of a Connection like so. The RabbitMQ setup and/or configuration are instance related not message specific.

I would like to loop in @cerpusoddarne into this thread, I hope he does not mind, since I believe he is more familiar than I am with the subject.