# Documentation for publish/consume?

**URL:** <https://discourse.nameko.io/t/documentation-for-publish-consume/364>\
**Category:** Uncategorized\
**Created:** [November 5, 2018, 5:34am UTC](https://discourse.nameko.io/t/documentation-for-publish-consume/364 "2018-11-05T05:34:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shirishc](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.nameko.io/shirishc/32/30_2.png) [@shirishc](https://discourse.nameko.io/u/shirishc)\
**Post date:** [November 5, 2018, 5:34am UTC](https://discourse.nameko.io/t/documentation-for-publish-consume/364/1 "2018-11-05T05:34:32Z")

</div>

Hi,

My understanding of the Nameko is still basic. So please forgive and guide me if my statements sound incorrect. I do love Nameko for what it does in the RPC/Event world but I found it a bit limiting when it comes to real decoupling (which is what I why chose Microservices architecture). I have RPC in which I do need to know the “client” service (which is fair enough) and in Pub-Sub event example - I need to know the Producer service.

I really do the love the “topic exchange” in RabbitMQ where I worry not about the source but type of messages. Specially the usage of wildcard to get the right kind. How can I have that flexibility in Nameko ? Or how can I read messages created by non-Nameko services ?

After a lot of search - I found Publish/Consume in this forum which might be useful for me. Is there a documentation for this Publish/Consume ? I found that the documentation in [https://nameko.readthedocs.io/en/stable/](https://nameko.readthedocs.io/en/stable/) has zero mention of this. Is that by design or just that the documentation is lagging far behind the code ? Is there a more detailed documentation of different other hidden gems ?

Can someone please guide if there is a more detailed documentation somewhere other than the above ? I know that I am just being lazy about reading the code in github to get a better understanding but I was hoping that I could just use it without opening the hood too wide.

Thanks and Regards,  
Shirish.

---

<div class="post-metadata">

**Author:** ![mattbennett](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.nameko.io/mattbennett/32/13_2.png) [@mattbennett](https://discourse.nameko.io/u/mattbennett)\
**Post date:** [November 6, 2018, 5:11pm UTC](https://discourse.nameko.io/t/documentation-for-publish-consume/364/2 "2018-11-06T17:11:52Z")

</div>

Hey Shirish,

You’re right that the official docs currently have no mention of the lower-level Publish/Consume AMQP extensions, even though they’ve been part of the library from the very beginning. Nameko Events are in fact just a thin abstraction on top of Publish/Consume.

The best reference at the moment is the code. Both Publish and Consume live in the [messaging](https://github.com/nameko/nameko/blob/master/nameko/messaging.py) module.

Their API is not very complicated:

The `Publisher` DependencyProvider accepts a kombu `Exchange` object, and the `@consume` entrypoint accepts a kombu `Queue` object. They will be declared on the broker at publish- or consume-time if they don’t already exist.

You can configure all sorts of AMQP messaging paradigms using these two objects, including topic/wildcard routing.

The reason it hasn’t been documented is partly because it’s a “lower level” API and partly because I don’t love the idea of passing kombu objects around. I think it would be preferable if you could specify queue bindings and so on directly with the Nameko extensions and have them pass through to the AMQP library transparently, rather than forcing users to understand the Nameko API _and_ the Kombu API.

Hope that helps. Feel free to ask here if you have specific questions.
