You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I'm working on a project that uses both normal rpcs nameko.rpc.rpc and retryable rpcs nameko_amqp_retry.rpc.rpc
What I expected:
I expected to be able to call either type of rpcs without an order.
What happens:
If i call the methods in a way like normal rpc, retyable rpc, normal rpc, retyable rpc (...) it works fine, but if I change the order or always try to call the same it errors out every other time with MethodNotFound
Why:
This cause an issue where the providers change every time there is an rpc call.
I tracked down the issue to it being due to class variables. In the file nameko_amqp_retry/rpc.py the class RPC creates the consumer again as a class variable. This makes the self._providers have different values for normal rpcs and retyable rpcs.
Where does it happen:
nameko_amqp_retry/rpc.py
fromnameko.rpcimportRpcConsumerasNamekoRpcConsumerclassRpcConsumer(NamekoRpcConsumer):
...
classRpc(NamekoRpc):
rpc_consumer=RpcConsumer()
# rpc_consumer = NamekoRpcConsumer() # If we use this or if we compelitly remove # the rpc_consumer it works finebackoff_publisher=BackoffPublisher()
pipenv run nameko shell
>>> n.rpc.service_test.rpc_from_nameko() # Runs fine
>>> n.rpc.service_test.rpc_from_nameko() # Errors out
nameko.exceptions.MethodNotFound: rpc_from_nameko
>>> n.rpc.service_test.rpc_from_nameko() # Runs fine again
...
And so on
The text was updated successfully, but these errors were encountered:
Hello,
I'm working on a project that uses both normal rpcs
nameko.rpc.rpc
and retryable rpcsnameko_amqp_retry.rpc.rpc
What I expected:
I expected to be able to call either type of rpcs without an order.
What happens:
If i call the methods in a way like normal rpc, retyable rpc, normal rpc, retyable rpc (...) it works fine, but if I change the order or always try to call the same it errors out every other time with MethodNotFound
Why:
This cause an issue where the providers change every time there is an rpc call.
I tracked down the issue to it being due to class variables. In the file
nameko_amqp_retry/rpc.py
the class RPC creates the consumer again as a class variable. This makes theself._providers
have different values for normal rpcs and retyable rpcs.Where does it happen:
nameko_amqp_retry/rpc.py
Example:
Service in
service_test.py
In console 1:
nameko run "service_test:Service"
In console 2:
The text was updated successfully, but these errors were encountered: