- Notifications
You must be signed in to change notification settings - Fork 464
Closed
Description
The RpcClient needs a reset functionality to recover from missing server replies or other amqp expections.
In the following scenario the client will not return the result for the second call.
- RpcClient -> send request 1
- !!! request times out !!!
- RpcClient-> send request 2
- RpcServer answers request 2
- RpcClient never returns the result for the second call because it expects 2 replies in total https://github.com/php-amqplib/RabbitMqBundle/blob/master/RabbitMq/RpcClient.php#L66
Solution: Add a reset function to manually recover from failed RPC calls and use the client again.
RpcClient:php
public function reset() { $this->replies = array(); $this->requests = 0; } Note that in Symfony the client service is declared once and getting a new instance is not possible by practical means.