I am new to RabbitMQ and using PHP-AMQPlib with HA-Policy. I have started creating queues there for my campaigning through CRON. All the entries are getting queued in timely manner. Also I have a plan of having one consumer alive all the time so the queue message are consumed almost instantly. But the main problem I am facing the Idle consumers/connections/channels are getting removed in any time. As a result the messages which are gathering in the queue are not released until or unless I create one manually.
So anyone please help me to make the consumer alive all the time.
--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi Alvaro,
It’s good to write to you once again. Please read this carefully. I am a newbie in RabbitMQ and using the repository you have uploaded to github [https://github.com/videlalvaro/php-amqplib]. This is working fine with simple queue. But I badly need to implement a feature of having some of the connections to be alive all the time or say infinite time, In case of a producer the connection needs to be closed with no effect [which I have done already], but in the time of consumer, the connection needs to alive all the time as the queue required to be consumed instantly [Sorry, no help].
That’s why we are running our producer through CRON and the queues are getting generated in regular intervals. Whereas the worker is fired once and that will consume for infinite time, as my application really leads me this way.
The main challenge lies in keep my consumer connection awake all time. It dies in no time.I applied heartbeat with 30 sec. that’s fine. The connections are set as auto-delete false. That’s fine too. They are durable. Again fine.
I have in my head a couple of question right now,1. The AMQPConnection constructor are having these parameters
public function __construct(
i. $host,
ii. $port,
iii. $user,
iv. $password,
v. $vhost = '/',
vi. $insist = false,
vii. $login_method = 'AMQPLAIN',
viii. $login_response = null,
ix. $locale = 'en_US',
x. $connection_timeout = 2,
xi. $read_write_timeout = 60,
xii. $context = null,
xiii. $keepalive = false,
xiv. $heartbeat = 30
)
What is the connection timeout, and what will be its value to keep it alive all the time? I passed ‘ ’, 0, 10000 with no result.
2. When I keep $keepalive = true, the system eventually punches me back with these errors.
( ! ) Fatal error: Uncaught exception 'AMQPIOException' with message 'Can not enable keepalive: function socket_import_stream does not exist'
( ! ) AMQPIOException: Can not enable keepalive: function socket_import_stream does not exist
I could not help me out to find any method in the repository with the same name, or I blindly make some mistakes. The repository is not containing any functions.
Probably I express my problem properly so Please help me out of this. Sorry for this long topic. Tons of thanx in advance.
--