Answer the question
In order to leave comments, you need to log in
How to speed up sending emails using rabbitmq (php)?
I am writing a test in symfony, I need to send 9600 letters in the shortest possible time. I thought about resolving this issue using rabbitmq, but I don’t understand the mechanism itself, how to make the rabbit itself send letters?
Answer the question
In order to leave comments, you need to log in
in and of itself. rabbitmq, zeromq, gearman and the like do not perform tasks, you must make a handler yourself that will handle it. And such queues do a very simple thing - they allow the program to quickly transfer the task to the queue so that the handler (processors) can do business.
rabbit as Aleksey Pavlov already said is just an implementation of the queue, and how the data will get there and read out you will need to implement yourself
Make queues on redis + https://github.com/michelsalib/BCCResqueBundle
The problem is solved in very different ways. And first of all, you need to think about tricks. :)
First, one letter is sent to 9600 clients or 9600 different letters are sent? If there are 9600 clients, then you need to remember that one letter can contain many recipients. It is clear that there are limitations, but we must not forget about it.
In the second case, you need to think about multithreading. Again, all sorts of queues do not solve the problem in any way, it will simply be convenient for you to read messages from the queue. This is convenient in terms of stability as well. But it will be necessary to read in several streams.
You also need to remember that you can send several letters at a time by forming a Batch, if this is supported by the service for sending letters (if this is a service, of course).
Using a queue server for such a task is not the best solution. Rabbit is good when messages are received from many sources to a small number of consumers, in addition to a simple queue from one to another. Your problem is exactly the opposite.
Take a look at gearman.org
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question