I am working on a multi tenant multi database architecture application using laravel which basically means that every tenant in the application ha their own database, own sets of users, resources and so on.
Now I am trying to implement queues and caching in the application, I am trying to use redis for that. A sample code looks like this:
$mailer->send('emails.welcome', ['user' => $user], function ($message) use ($user) {
$message->from("admin@admin.com", "Admin");
$message->to($user->email, $user->first_name)->subject("Welcome!");
});
This is to send a welcome email on user sign up. But the queueing is storing all the queues in the same database in the same redis instance, different tenant emails will get mixed up as I can tell.
How to hook into laravel 5 and change the queue behaviour to either store the jobs for each tenant in a seperate database or store extra meta information about the tenant a particular job belongs to? And then also to tell laravel to parse that extra meta information and connect to the right tenant db before proceeding with the job?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire