Hi All,
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