104 questions
0
votes
1
answer
84
views
What is the correct context to consume a RabbitMQ broker within the PHP/laravel ecosystem?
We have a system that captures telemetry data in real time. The broker we hire sends telemetry data in real time from the device they place inside our cars. This operation has been running for two ...
0
votes
0
answers
741
views
Unable to install symfony/amqp-messenger due to amqp issue
I've been trying to set up the PHP AMQP extension on WAMP server with PHP 8.2. I've placed rabbitmq.4.dll, and rabbitmq.4.pdb in the PHP root and php_amqp.dll in the ext folder. However, I keep ...
0
votes
2
answers
441
views
How to stop or timeout a consumer from consuming after specific time in RabbitMQ using php
Here is a hello world example on rabbitmq docs about consumer using php and php-amqplib package:
<?php
require_once __DIR__ . '/vendor/autoload.php';
use PhpAmqpLib\Connection\AMQPStreamConnection;...
0
votes
1
answer
101
views
Is it possible to send one message to several exchangers?
I just started studying rabbit and the following question arose: if I have a exchange TOPIC type with name adverts and a queues:
adverts_create (routing_key: `advert.create`)
adverts_edit (...
0
votes
1
answer
1k
views
I am using vladimir-yuldashev/laravel-queue-rabbitmq to connect in laravel & forge, with a RabbiqMQ message producer, Connection Lost/ broker Pipe
I have setup with the following configuration.
'derayah' => [
'driver' => 'rabbitmq',
'queue' => env('RABBITMQ_QUEUE', 'default'),
'connection' => ...
0
votes
1
answer
588
views
How to send unacked messages to DLX after TTL?
I have rabbit queue my_queue which is configured with DLX sending messages to my_queue_dlx. A test with message-ttl works as expected. A message which stays in a queue for ttl and later moved to DLX ...
0
votes
0
answers
116
views
Rabbitmq Consumer Issue
I just want my consumer to be up and ready when a message comes. I used 'nohup php consumer.php' , it's kind of working but consumer disappearing again. My question is how to keep the consumer ready ...
3
votes
1
answer
689
views
RabbitMQ messages being published twice with PHP AMQP Lib and Docker
I've setup a local instance of RabbitMQ using Docker Compose and am going through the hello world example on the RabbitMQ docs. Here is a simple attempt at connecting, creating a queue and pushing a ...
1
vote
1
answer
2k
views
How to manually ack messages in RabbitMQ?
I need to know how to manually ack the messages on the queue direct from the Consumer I created and to set a retry strategy of 5 times, each attemp increasing the time like second try 5min, third try, ...
-1
votes
1
answer
404
views
Asynchronous consumption of queue to respond to frontend Requests
In my first attemps to get my head around asynchronous messaging for microservices in php.
I built a registration form, sent the data using Ajax to a php script that publishes a message to a save ...
0
votes
1
answer
852
views
How to manage big spikes of connections to RabbitMQ
Our rabbitmq server can't keep up with connections when we have spikes above 3000 connections/second, and new connections take long to stablish (reaching 3s limit we have for failing). We need ...
2
votes
0
answers
1k
views
How to consume all messages from a RabbitMQ queue in batches?
My RabbitMQ consumer has to process messages in fixed size batches with a prefetch count of 15. This is limited to 15 in order to match AWS SES email send rate - the consumer process has to issue SES ...
0
votes
1
answer
103
views
implode of array results in RabbitMQ receiving empty msg body yet other publishers show the body
The first one is receiving data from $_POST in a login.php which calls a function from another file through require_once, and the $_POST is populated as I can echo it to my login page and see it, but ...
1
vote
0
answers
715
views
php-amqplib: how to get the number of messages in prefetched cache?
Related question:Get queue size from rabbitmq consumer's callback with PhpAmqpLib
In the above question the message count is obtained by queue_declare. However this message count only counts ...
0
votes
0
answers
207
views
What's the point of QoS settings and multiple channels in PHP AMQP implementations?
Since PHP is single-threaded there doesn't seem to be a point to increasing QoS/prefetch values and using multiple channels when working with AMQP.
I could maybe see a point in something like ReactPHP,...
0
votes
1
answer
4k
views
PHP RabbitMQ consumer stops consuming events
I have a php daemon, which uses php-amqplib, that consumes messages from RabbitMQ server. Here is a gist of it (though it's a bit more complex than that):
$callback = function (AMQPMessage $msg) {
...
5
votes
0
answers
755
views
PhpAmqpLib Getting 'PRECONDITION_FAILED - consumer ack timed out on channel 1', (0, 0),
After adding 'delivery_mode' => 2 started getting error Unrecoverable error: PreconditionFailed(406, 'PRECONDITION_FAILED - consumer ack timed out on channel 1', (0, 0), '') Timeout value used: ...
1
vote
2
answers
3k
views
How to close rabbitmq connections from consumer callback using php-amqplib
I have been able to set up a script that connects to RabbitMQ using the php-amqplib library. However, I want to be able to exit the script, if necessary.
We thought that creating a stop.txt file would ...
5
votes
0
answers
944
views
Symfony Messenger Long Running Worker and AMQP Heartbeat
In a messenger handler, if the message takes longer to process than the heartbeat, you won't be able to ack the message due to the connection going away.
Is there a way in the handler to manually keep ...
2
votes
0
answers
558
views
Rabbit Php-amqp lib client heartbeat is 0 but why server default 60 is not used?
I am testing heartbeat with long running consumers, on the rabbit documentation is stated that if the client sends 0 for heartbeat the greater value between client and server is used, but what I see ...
3
votes
1
answer
3k
views
php-amqplib - read_write_timeout and heartbeat relation
While reading php-amqplib configuration, I saw two parameters: "heartbeat" and "read_write_timeout".
On the web I found this (on 2 or 3 forums): read_write_timeout must be at least ...
1
vote
0
answers
3k
views
how to install php-amqplib in alpine image?
I use docker-compose version: '3' and need to install php-amqplib. I faced with strange behaviour. Thrown exception about missing sockets, but I installed and added to my composer.json, how to install ...
1
vote
1
answer
3k
views
Problem connecting from PHP to Apache ActiveMQ using AMQP
I tried searching the web up and down - and either they point me towards RabbitMQ which is out of the question because the customer specifically asked for ActiveMQ / Amazon MQ which is basically ...
1
vote
0
answers
4k
views
"Kafka consumer group authorization failed." occasionally?
I have a php program which have 2 php processes consuming kafka messages. But sometimes it shows errors like "Kafka consumer group authorization failed." Is there any relationship between 2 processes?
...
1
vote
1
answer
1k
views
RabbitMQ - How to reuse the same connection with multiple channels
I am trying to master some best practices for RabbitMQ. My goal is to create a single connection, and then, using on this single connection, create multiple channels on this connection.
Following the ...
0
votes
2
answers
508
views
Distribute messages from RabbitMQ to consumers running on Heroku dynos as a 'round robin'
I have a RabbitMQ setup in which jobs are sent to an exchange, which passes them to a queue. A consumer carries out the jobs from the queue correctly in turn. However, these jobs are long processes (...
3
votes
1
answer
7k
views
Failed to install php-amqplib(RabbitMQ) using composer
I'm trying to use this library. php-amqplib.
composer require php-amqplib/php-amqplib
But I am getting this error:
Using version ^2.11@dev for php-amqplib/php-amqplib
./composer.json has been ...
0
votes
1
answer
187
views
How to consume from queues with custom names (defined on a fly) with RabbitMQ
I have tasks with an ids, and each task has some amount of jobs to do:
every job for each user;
for each task, number of users and jobs are different.
And I want to put all the jobs to one queue with ...
5
votes
1
answer
4k
views
PHP ampq + rabbit MQ -- long running producer: can send messages to queues already declared, but can't declare new queues
I have a "producer" that's supposed to be always running, but it seems that after a day or so, it is still able to send messages to queues it has previously declared, but when trying to declare a new ...
1
vote
1
answer
1k
views
RabbitMQ weird behavior on dead letter queue for messages from exchanges
I am using the amqp lib for php as rabbitmq client an we want to reject a message from a queue called "test"
To not get this message lost we defined the deadletter queue called "test.deadletter".
If ...
0
votes
0
answers
186
views
RabbitMQ queue gets blank randomly with around 5K messages remaining
I have a queue to which a lot of messages are published (~10K). Connected to this queue are multiple consumers with the following code in codeigniter using the php-amqplib library
public function ...
0
votes
1
answer
760
views
RabbitMQ publishing works from console but not from browser
I have a simple PHP code that sends a message to a RabbitMQ queue, when I execute it directly from the console (#php script.php) the message is published correctly, but when I try to open the same ...
0
votes
0
answers
152
views
RabbitMQ consumer gets doubled after sometime
We are using RabbitMQ v3.7.5, AMQP 0.9.1, Erlang 20.1.7.1, PHP 7, centos 7
Our consumers are written using php-amqplib v2.9.1
We start our consumers by calling a URL using curl. The consumers work ...
4
votes
1
answer
6k
views
Get queue size from rabbitmq consumer's callback with PhpAmqpLib
I want to log working status from workers' callbacks and include a number of messages in the queue left.
The only solution I found so far is getting the second member of queue_declare result array, ...
4
votes
1
answer
4k
views
RabbitMQ store messages in exchange
I'm trying to figure out whether is possible to store messages in a RabbitMQ exchange even when there's no consumer running.
I understood (probably incorrectly) that to achieve that the exchange ...
2
votes
1
answer
1k
views
Handling exception in rabbitmq RPC model - PHP
I have a publisher and consumer (RPC model), each of them running on different nodes. The publisher publish a message to a specific queue and the consumer listens to the same queue.
While consumer ...
0
votes
1
answer
1k
views
php-amqplib - Fatal error: Call to a member function basic_get() on resource
Using a queue system for handling jobs. We have a cron run once every morning at 1am and it publishes all of our required API calls. We have another consumer cron that runs every five minutes that ...
0
votes
0
answers
285
views
Exception: Too many read attempts detected in StreamIO /var/www/html/vendor/php-amqplib/php-amqplib/PhpAmqpLib/Wire/IO/StreamIO.php 252
Exception: Too many read attempts detected in StreamIO
/var/www/html/vendor/php-amqplib/php-amqplib/PhpAmqpLib/Wire/IO/StreamIO.php
3
votes
1
answer
3k
views
Dead lettering with php-amqplib and RabbitMQ?
I'm just starting out in using php-amqplib and RabbitMQ and want a way to handle messages that, for whatever reason, can't be processed and are nack'd. I thought that one way people handle this is ...
1
vote
2
answers
5k
views
How to return response from RabbitMQ to browser
I am trying to streamline my app to reduce server load by sending complex database tasks to a RabbitMQ queue for processing by a worker dyno.
For INSERTs and UPDATEs, this has been relatively ...
1
vote
0
answers
375
views
Exclusive batch processing with fallbacks using RabbitMQ
I'm using RabbitMQ in PHP via AMQPLib and RabbitMQ Bundle (for Symfony).
The consumers work on multiple servers, that's what Rabbit is for and that's fine. I encountered however a specific case, ...
1
vote
0
answers
83
views
No message in queue if i set additionnal properties to my message
I'm using symfony 3.4 with RMQ 3.6.14. I was dealing with additional properties, but surpisingly, the message never reached RMQ server.
I put some debug point everywhere, but i can not explain it.
I'...
1
vote
1
answer
6k
views
php-amqplib connection error
I'm just doing a test to try and get RabbitMQ to work with php-amqplib. I've just edited the question so that it's using the right port. Any ideas on this?
This is my PHP file...
1 #!/usr/bin/env ...
0
votes
3
answers
13k
views
Codeigniter 3 composer and vendor directory
I have installed codeigniter 3.1.8 and installed this library https://github.com/php-amqplib/php-amqplib using composer:
composer require php-amqplib/php-amqplib
This has created a directory vendor
...
1
vote
1
answer
2k
views
RabbitMQ and php-amqplib - how to get bindings (routing keys) for an exchange?
I'm using php-amqplib library for RabbitMQ publishing/consuming messages.
I did some research, but did not found a way to list all the routing keys (bindings) that are assigned to an RabbiMQ exchange....
0
votes
1
answer
2k
views
Ensure that AMQP exchange binding exists before publishing
The System Layout
We have three systems:
An API Endpoint (Publisher and Consumer)
The RabbitMQ Server
The main application/processor (Publisher and consumer)
System 1 and 3 both use Laravel, and use ...
0
votes
1
answer
2k
views
Rabbitmq PHP consume every second
What is the best practice, to receive Data from a queue every second via php? I do this with an ajax query, what calls the php script every second. There, a connection object is created and a queue is ...
1
vote
1
answer
1k
views
What if connection is not explicitly closed using php amqplib?
Suppose, in my php script, I have opened a connection to rabbitmq using php-amqplib client. And after publishing message, I dont explicitely close the channel and connection.
I dont see any timeout ...
3
votes
3
answers
12k
views
How in RabbitMQ and PHP return task back to the queue?
How can I return message back to the queue if processing result did not suit me. Found only information about message acknowledgments but I think that it does not suit me. I need that if as a result ...
1
vote
1
answer
3k
views
Reading messages from RabbitMQ with php-amqlib is not working
I'm working on a client-server communication with PHP and RabbitMQ, using php-amqplib.
I have a producer script that looks like working fine, but my consumer does not receive anything.
I checked ...