'How to publish to and consume from other rabbitmq exchange in nameko service?

I am working with nameko to develop a microservice in python. I want to listen on some queue which is defined in different exchange in rabbitMQ. Also I want to publish to other Exchange with routing key from this nameko service.

How can I do that?

You can assume that all exchanges are on same rabbitMQ instance/broker. Thanks :)



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source