Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Async Net::AMQP::RabbitMQ

by ait (Hermit)
on Jun 29, 2020 at 14:55 UTC ( [id://11118657]=note: print w/replies, xml ) Need Help??


in reply to Async Net::AMQP::RabbitMQ

Hi there dcpetrov,

Whilst I am not familiar with the Net::AMQP::RabbitMQ particulars, is RabbitMQ your only option for MQ?

Many times I have found that most MQ needs can easily be handled in simpler ways. For example, in Postgres 9.5 onward incorporates "skip locked" which allows you to implement simple queues right on your database rather that incorporating yet another tool, especially not one written in Java (LOL, sorry I couldn't resist) Erlang (thanks Fletch for pointing out).

But seriously, if you happen to be using pg as your RDBMS already, or are a fan of KISS (not necessarily the rock band), PostgreSQL's native support to implement MQ can easily handle 10K TPS which is usually much more that you will need on most MQs. Not saying you can always replace a dedicated MQ system, but many times, there is rarely a need to implement a full fledged MQ. Moreover, lots of programming tasks could benefit from implementing more MQs but coders shy away because of the complexity and the need to incorporate yet another technology to your stack. For these situations, simple and native Postgres MQs are very apt.

E.g. you can implement a queue on any table, with any structure and pop it with a simple query like so (BTW works great on DBD:Pg):

delete from out_queue where id = (select id from out_queue order by id + for update skip locked limit 1) returning *

Here is a good introduction:
https://www.pgcon.org/2016/schedule/attachments/414_queues-pgcon-2016.pdf

If you are worried about performance of Pg in general:
https://akorotkov.github.io/blog/2016/05/09/scalability-towards-millions-tps/

There is also a specialized MQ on Pg called PGQ. I have never used it so can't comment more:
https://wiki.postgresql.org/wiki/PGQ_Tutorial

Finally, not sure if this is still maintained but I used this POE-based MQ system many years ago and it was quite good. IIRC you don't even need to know POE to use it:
https://metacpan.org/pod/POE::Component::MessageQueue

Replies are listed 'Best First'.
Re^2: Async Net::AMQP::RabbitMQ
by Fletch (Bishop) on Jun 29, 2020 at 16:04 UTC

    RabbitMQ is written in Erlang; you may be thinking of ActiveMQ which is Java (and C++ maybe?).</nitpick></pedant>

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11118657]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2024-04-19 08:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found