# New blog post: Microservices with Python, RabbitMQ and Nameko

**URL:** <https://discourse.nameko.io/t/new-blog-post-microservices-with-python-rabbitmq-and-nameko/125>\
**Category:** googlegroup\
**Created:** [March 5, 2016, 12:02am UTC](https://discourse.nameko.io/t/new-blog-post-microservices-with-python-rabbitmq-and-nameko/125 "2016-03-05T00:02:25Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bruno\_Rocha](https://avatars.discourse-cdn.com/v4/letter/b/ad7895/32.png) [@Bruno\_Rocha](https://discourse.nameko.io/u/Bruno_Rocha)\
**Post date:** [March 5, 2016, 12:02am UTC](https://discourse.nameko.io/t/new-blog-post-microservices-with-python-rabbitmq-and-nameko/125/1 "2016-03-05T00:02:25Z")

</div>

Microservices with Python, RabbitMQ and Nameko

> **[Microservices with Python, RabbitMQ and Nameko](http://brunorocha.org/python/microservices-with-python-rabbitmq-and-nameko.html)**
>
> "Micro-services is the new black" - Splitting the project in to independently scalable services is the currently the best option to ensure the evolution of the code. In Python there is a Framework called "Nameko" which makes it very easy and...

---

<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:** [March 6, 2016, 1:20pm UTC](https://discourse.nameko.io/t/new-blog-post-microservices-with-python-rabbitmq-and-nameko/125/2 "2016-03-06T13:20:53Z")

</div>

Nice!

Did you consider using a nameko service for the "API" component? (Using the  
@http entrypoint)

It would be amazing if there was a flasgger equivalent for nameko 😉

> **···**
>
> On Saturday, March 5, 2016 at 12:02:25 AM UTC, Bruno Rocha wrote:
> 
> > Microservices with Python, RabbitMQ and Nameko
> > 
> > [http://brunorocha.org/python/microservices-with-python-rabbitmq-and-nameko.html](http://brunorocha.org/python/microservices-with-python-rabbitmq-and-nameko.html)

---

<div class="post-metadata">

**Author:** ![Remco\_Boerma](https://avatars.discourse-cdn.com/v4/letter/r/df705f/32.png) [@Remco\_Boerma](https://discourse.nameko.io/u/Remco_Boerma)\
**Post date:** [March 10, 2016, 2:28pm UTC](https://discourse.nameko.io/t/new-blog-post-microservices-with-python-rabbitmq-and-nameko/125/3 "2016-03-10T14:28:22Z")

</div>

Nice article!

You use .async() of rpc but don't care about the results. I have 2  
questions about that:

1) isn't it creating a lot of overhead if you would send messages this  
way? (return queue preparation and all that)  
2) what happens with the result anyway? Do you end up with a stuffed  
rabbit? dead letters?

Thanks!

> **···**
>
> Op zaterdag 5 maart 2016 01:02:25 UTC+1 schreef Bruno Rocha:
> 
> > Microservices with Python, RabbitMQ and Nameko
> > 
> > [http://brunorocha.org/python/microservices-with-python-rabbitmq-and-nameko.html](http://brunorocha.org/python/microservices-with-python-rabbitmq-and-nameko.html)

---

<div class="post-metadata">

**Author:** ![7ooony](https://avatars.discourse-cdn.com/v4/letter/7/6de8d8/32.png) [@7ooony](https://discourse.nameko.io/u/7ooony)\
**Post date:** [May 9, 2016, 10:18am UTC](https://discourse.nameko.io/t/new-blog-post-microservices-with-python-rabbitmq-and-nameko/125/4 "2016-05-09T10:18:21Z")

</div>

I get the same YagAddressError as the commenter on your article Vihar Popat:

Traceback (most recent call last):

File "\<console\>", line 1, in \<module\>

File  
"/home/centos/projects/service-mail/service\_env/lib/python2.7/site-packages/nameko/  
rpc.py", line 351, in \_\_call\_\_

return reply.result()

File  
"/home/centos/projects/service-mail/service\_env/lib/python2.7/site-packages/nameko/  
rpc.py", line 337, in result

raise deserialize(error)

RemoteError: YagAddressError

> **···**
>
> -----------  
> This happens only when using nameko, otherwise Yagmail works fine. So it's  
> a problem with nameko's data serialization? Does anyone know what's going  
> on?
> 
> On Saturday, March 5, 2016 at 7:02:25 AM UTC+7, Bruno Rocha wrote:
> 
> > Microservices with Python, RabbitMQ and Nameko
> > 
> > [http://brunorocha.org/python/microservices-with-python-rabbitmq-and-nameko.html](http://brunorocha.org/python/microservices-with-python-rabbitmq-and-nameko.html)

---

<div class="post-metadata">

**Author:** ![Bruno\_Rocha](https://avatars.discourse-cdn.com/v4/letter/b/ad7895/32.png) [@Bruno\_Rocha](https://discourse.nameko.io/u/Bruno_Rocha)\
**Post date:** [March 7, 2016, 5:49pm UTC](https://discourse.nameko.io/t/new-blog-post-microservices-with-python-rabbitmq-and-nameko/125/5 "2016-03-07T17:49:17Z")

</div>

I did not tried Nameko http yet. But I will take a look and try to develop  
a port of Flasgger (Swaggeko?)

Does Nameko http uses werkzeug routing Rules? if so, it is easy to port.

> **···**
>
> On Sun, Mar 6, 2016 at 10:20 AM, Matt Bennett \<bennett.matthew@gmail.com\> wrote:
> 
> > Nice!
> > 
> > Did you consider using a nameko service for the "API" component? (Using  
> > the @http entrypoint)
> > 
> > It would be amazing if there was a flasgger equivalent for nameko 😉
> > 
> > On Saturday, March 5, 2016 at 12:02:25 AM UTC, Bruno Rocha wrote:
> > 
> > > Microservices with Python, RabbitMQ and Nameko
> > > 
> > > [http://brunorocha.org/python/microservices-with-python-rabbitmq-and-nameko.html](http://brunorocha.org/python/microservices-with-python-rabbitmq-and-nameko.html)
> > 
> > --  
> > You received this message because you are subscribed to a topic in the  
> > Google Groups "nameko-dev" group.  
> > To unsubscribe from this topic, visit  
> > [https://groups.google.com/d/topic/nameko-dev/QijBX\_DMsJ8/unsubscribe\](https://groups.google.com/d/topic/nameko-dev/QijBX_DMsJ8/unsubscribe%5C).  
> > To unsubscribe from this group and all its topics, send an email to  
> > nameko-dev+unsubscribe@googlegroups.com.  
> > To post to this group, send email to nameko-dev@googlegroups.com.  
> > To view this discussion on the web, visit  
> > [https://groups.google.com/d/msgid/nameko-dev/222ba4ed-5a86-4801-843c-ed8a11e0d512%40googlegroups.com](https://groups.google.com/d/msgid/nameko-dev/222ba4ed-5a86-4801-843c-ed8a11e0d512%40googlegroups.com)  
> > \<[https://groups.google.com/d/msgid/nameko-dev/222ba4ed-5a86-4801-843c-ed8a11e0d512%40googlegroups.com?utm\_medium=email&utm\_source=footer&gt](https://groups.google.com/d/msgid/nameko-dev/222ba4ed-5a86-4801-843c-ed8a11e0d512%40googlegroups.com?utm_medium=email&utm_source=footer&gt);  
> > .  
> > For more options, visit [https://groups.google.com/d/optout\](https://groups.google.com/d/optout%5C).
> 
> --
> 
> \*Bruno Rocha - @rochacbruno \<[http://twitter.com/rochacbruno&gt;\](http://twitter.com/rochacbruno&gt;%5C)\*  
> [http://brunorocha.org](http://brunorocha.org)  
> [rochacbruno (Bruno Rocha) · GitHub](http://github.com/rochacbruno)  
> [http://linkedin.com/in/rochacbruno](http://linkedin.com/in/rochacbruno)  
> [Google Workspace Updates: New community features for Google Chat and an update on Currents](http://plus.google.com/+BrunoRocha1) \<[Google Workspace Updates: New community features for Google Chat and an update on Currents](http://plus.google.com/+BrunoRocha1&gt);

---

<div class="post-metadata">

**Author:** ![Bruno\_Rocha](https://avatars.discourse-cdn.com/v4/letter/b/ad7895/32.png) [@Bruno\_Rocha](https://discourse.nameko.io/u/Bruno_Rocha)\
**Post date:** [March 10, 2016, 2:50pm UTC](https://discourse.nameko.io/t/new-blog-post-microservices-with-python-rabbitmq-and-nameko/125/6 "2016-03-10T14:50:12Z")

</div>

> 1) isn't it creating a lot of overhead if you would send messages this  
> way? (return queue preparation and all that)

&nbsp;&nbsp;&nbsp;&nbsp;In the case of email sending I don't care about the results  
immediately, the caller will get the results in the email body after. I  
don't know if async has overheads.

> 2) what happens with the result anyway? Do you end up with a stuffed  
> rabbit? dead letters?

&nbsp;&nbsp;&nbsp;Since the "consumer/worker" finished the task it sends "ack" signal to  
rabbit. I don't think there is "dead letters" after that, even if the  
consumer fails, messages has an TTL there.

> **···**
>
> --
> 
> \*Bruno Rocha - @rochacbruno \<[http://twitter.com/rochacbruno&gt;\](http://twitter.com/rochacbruno&gt;%5C)\*  
> [http://brunorocha.org](http://brunorocha.org)  
> [rochacbruno (Bruno Rocha) · GitHub](http://github.com/rochacbruno)  
> [http://linkedin.com/in/rochacbruno](http://linkedin.com/in/rochacbruno)  
> [Google Workspace Updates: New community features for Google Chat and an update on Currents](http://plus.google.com/+BrunoRocha1) \<[Google Workspace Updates: New community features for Google Chat and an update on Currents](http://plus.google.com/+BrunoRocha1&gt);

---

<div class="post-metadata">

**Author:** ![Bruno\_Rocha](https://avatars.discourse-cdn.com/v4/letter/b/ad7895/32.png) [@Bruno\_Rocha](https://discourse.nameko.io/u/Bruno_Rocha)\
**Post date:** [July 19, 2016, 2:39am UTC](https://discourse.nameko.io/t/new-blog-post-microservices-with-python-rabbitmq-and-nameko/125/7 "2016-07-19T02:39:42Z")

</div>

I updated the post and example code available  
here: [GitHub - rochacbruno/nameko-example: Code for example in this post: http://brunorocha.org/python/microservices-with-python-rabbitmq-and-nameko.html](https://github.com/rochacbruno/nameko-example) (suggestions and PRs  
are welcome)

> **···**
>
> On Monday, May 9, 2016 at 7:18:21 AM UTC-3, 7oo...@gmail.com wrote:
> 
> > I get the same YagAddressError as the commenter on your article Vihar  
> > Popat:
> > 
> > Traceback (most recent call last):
> > 
> > File "\<console\>", line 1, in \<module\>
> > 
> > File  
> > "/home/centos/projects/service-mail/service\_env/lib/python2.7/site-packages/nameko/  
> > rpc.py", line 351, in \_\_call\_\_
> > 
> > return reply.result()
> > 
> > File  
> > "/home/centos/projects/service-mail/service\_env/lib/python2.7/site-packages/nameko/  
> > rpc.py", line 337, in result
> > 
> > raise deserialize(error)
> > 
> > RemoteError: YagAddressError
> > 
> > -----------  
> > This happens only when using nameko, otherwise Yagmail works fine. So it's  
> > a problem with nameko's data serialization? Does anyone know what's going  
> > on?
> > 
> > On Saturday, March 5, 2016 at 7:02:25 AM UTC+7, Bruno Rocha wrote:
> > 
> > > Microservices with Python, RabbitMQ and Nameko
> > > 
> > > [http://brunorocha.org/python/microservices-with-python-rabbitmq-and-nameko.html](http://brunorocha.org/python/microservices-with-python-rabbitmq-and-nameko.html)

---

<div class="post-metadata">

**Author:** ![David\_Szotten](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.nameko.io/david_szotten/32/6_2.png) [@David\_Szotten](https://discourse.nameko.io/u/David_Szotten)\
**Post date:** [March 7, 2016, 6:03pm UTC](https://discourse.nameko.io/t/new-blog-post-microservices-with-python-rabbitmq-and-nameko/125/8 "2016-03-07T18:03:29Z")

</div>

Yep, nameko http is built on top of werkzeug, just like flask. Rules:

> <https://github.com/nameko/nameko/blob/master/nameko/web/handlers.py#L25>

David

> **···**
>
> On Monday, 7 March 2016 17:49:37 UTC, Bruno Rocha wrote:
> 
> > I did not tried Nameko http yet. But I will take a look and try to develop  
> > a port of Flasgger (Swaggeko?)
> > 
> > Does Nameko http uses werkzeug routing Rules? if so, it is easy to port.
> > 
> > On Sun, Mar 6, 2016 at 10:20 AM, Matt Bennett \<bennett...@gmail.com \> \<javascript:\>\> wrote:
> > 
> > > Nice!
> > > 
> > > Did you consider using a nameko service for the "API" component? (Using  
> > > the @http entrypoint)
> > > 
> > > It would be amazing if there was a flasgger equivalent for nameko 😉
> > > 
> > > On Saturday, March 5, 2016 at 12:02:25 AM UTC, Bruno Rocha wrote:
> > > 
> > > > Microservices with Python, RabbitMQ and Nameko
> > > > 
> > > > [http://brunorocha.org/python/microservices-with-python-rabbitmq-and-nameko.html](http://brunorocha.org/python/microservices-with-python-rabbitmq-and-nameko.html)
> > > 
> > > --  
> > > You received this message because you are subscribed to a topic in the  
> > > Google Groups "nameko-dev" group.  
> > > To unsubscribe from this topic, visit  
> > > [https://groups.google.com/d/topic/nameko-dev/QijBX\_DMsJ8/unsubscribe\](https://groups.google.com/d/topic/nameko-dev/QijBX_DMsJ8/unsubscribe%5C).  
> > > To unsubscribe from this group and all its topics, send an email to  
> > > nameko-dev+...@googlegroups.com \<javascript:\>.  
> > > To post to this group, send email to namek...@googlegroups.com  
> > > \<javascript:\>.  
> > > To view this discussion on the web, visit  
> > > [https://groups.google.com/d/msgid/nameko-dev/222ba4ed-5a86-4801-843c-ed8a11e0d512%40googlegroups.com](https://groups.google.com/d/msgid/nameko-dev/222ba4ed-5a86-4801-843c-ed8a11e0d512%40googlegroups.com)  
> > > \<[https://groups.google.com/d/msgid/nameko-dev/222ba4ed-5a86-4801-843c-ed8a11e0d512%40googlegroups.com?utm\_medium=email&utm\_source=footer&gt](https://groups.google.com/d/msgid/nameko-dev/222ba4ed-5a86-4801-843c-ed8a11e0d512%40googlegroups.com?utm_medium=email&utm_source=footer&gt);  
> > > .  
> > > For more options, visit [https://groups.google.com/d/optout\](https://groups.google.com/d/optout%5C).
> > 
> > --
> > 
> > \*Bruno Rocha - @rochacbruno \<[http://twitter.com/rochacbruno&gt;\](http://twitter.com/rochacbruno&gt;%5C)\*  
> > [http://brunorocha.org](http://brunorocha.org)  
> > [rochacbruno (Bruno Rocha) · GitHub](http://github.com/rochacbruno)  
> > [http://linkedin.com/in/rochacbruno](http://linkedin.com/in/rochacbruno)  
> > [Google Workspace Updates: New community features for Google Chat and an update on Currents](http://plus.google.com/+BrunoRocha1) \<[Google Workspace Updates: New community features for Google Chat and an update on Currents](http://plus.google.com/+BrunoRocha1&gt);

---

<div class="post-metadata">

**Author:** ![David\_Szotten](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.nameko.io/david_szotten/32/6_2.png) [@David\_Szotten](https://discourse.nameko.io/u/David_Szotten)\
**Post date:** [March 10, 2016, 3:14pm UTC](https://discourse.nameko.io/t/new-blog-post-microservices-with-python-rabbitmq-and-nameko/125/9 "2016-03-10T15:14:06Z")

</div>

async without waiting:

the service container will still receive the reply, but discard it

> **···**
>
> On Thursday, 10 March 2016 14:50:32 UTC, Bruno Rocha wrote:
> 
> > 1) isn't it creating a lot of overhead if you would send messages this
> > 
> > > way? (return queue preparation and all that)
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;In the case of email sending I don't care about the results  
> > immediately, the caller will get the results in the email body after. I  
> > don't know if async has overheads.
> > 
> > > 2) what happens with the result anyway? Do you end up with a stuffed  
> > > rabbit? dead letters?
> > 
> > &nbsp;&nbsp;&nbsp;Since the "consumer/worker" finished the task it sends "ack" signal to  
> > rabbit. I don't think there is "dead letters" after that, even if the  
> > consumer fails, messages has an TTL there.
> > 
> > --
> > 
> > \*Bruno Rocha - @rochacbruno \<[http://twitter.com/rochacbruno&gt;\](http://twitter.com/rochacbruno&gt;%5C)\*  
> > [http://brunorocha.org](http://brunorocha.org)  
> > [rochacbruno (Bruno Rocha) · GitHub](http://github.com/rochacbruno)  
> > [http://linkedin.com/in/rochacbruno](http://linkedin.com/in/rochacbruno)  
> > [Google Workspace Updates: New community features for Google Chat and an update on Currents](http://plus.google.com/+BrunoRocha1) \<[Google Workspace Updates: New community features for Google Chat and an update on Currents](http://plus.google.com/+BrunoRocha1&gt);

---

<div class="post-metadata">

**Author:** ![Remco\_Boerma](https://avatars.discourse-cdn.com/v4/letter/r/df705f/32.png) [@Remco\_Boerma](https://discourse.nameko.io/u/Remco_Boerma)\
**Post date:** [March 10, 2016, 4:00pm UTC](https://discourse.nameko.io/t/new-blog-post-microservices-with-python-rabbitmq-and-nameko/125/10 "2016-03-10T16:00:47Z")

</div>

Thanks Bruno, David for clearing that up.

David, do you know if there is much overhead in setting up the response  
queues and such?

> **···**
>
> Op donderdag 10 maart 2016 16:14:07 UTC+1 schreef David Szotten:
> 
> > async without waiting:
> > 
> > the service container will still receive the reply, but discard it
> > 
> > On Thursday, 10 March 2016 14:50:32 UTC, Bruno Rocha wrote:
> > 
> > > 1) isn't it creating a lot of overhead if you would send messages this
> > > 
> > > > way? (return queue preparation and all that)
> > > 
> > > &nbsp;&nbsp;&nbsp;&nbsp;In the case of email sending I don't care about the results  
> > > immediately, the caller will get the results in the email body after. I  
> > > don't know if async has overheads.
> > > 
> > > > 2) what happens with the result anyway? Do you end up with a stuffed  
> > > > rabbit? dead letters?
> > > 
> > > &nbsp;&nbsp;&nbsp;Since the "consumer/worker" finished the task it sends "ack" signal to  
> > > rabbit. I don't think there is "dead letters" after that, even if the  
> > > consumer fails, messages has an TTL there.
> > > 
> > > --
> > > 
> > > \*Bruno Rocha - @rochacbruno \<[http://twitter.com/rochacbruno&gt;\](http://twitter.com/rochacbruno&gt;%5C)\*  
> > > [http://brunorocha.org](http://brunorocha.org)  
> > > [rochacbruno (Bruno Rocha) · GitHub](http://github.com/rochacbruno)  
> > > [http://linkedin.com/in/rochacbruno](http://linkedin.com/in/rochacbruno)  
> > > [Google Workspace Updates: New community features for Google Chat and an update on Currents](http://plus.google.com/+BrunoRocha1)  
> > > \<[Google Workspace Updates: New community features for Google Chat and an update on Currents](http://plus.google.com/+BrunoRocha1&gt);

---

<div class="post-metadata">

**Author:** ![David\_Szotten](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.nameko.io/david_szotten/32/6_2.png) [@David\_Szotten](https://discourse.nameko.io/u/David_Szotten)\
**Post date:** [March 10, 2016, 5:34pm UTC](https://discourse.nameko.io/t/new-blog-post-microservices-with-python-rabbitmq-and-nameko/125/11 "2016-03-10T17:34:29Z")

</div>

the reply queue in rabbit is only set up once for the whole container.  
there will be some small amount of overhead in actually sending and  
receiving the replies, but i've not got any measurements i'm afraid

d

> **···**
>
> On Thursday, 10 March 2016 16:00:47 UTC, remco....@gmail.com wrote:
> 
> > Thanks Bruno, David for clearing that up.
> > 
> > David, do you know if there is much overhead in setting up the response  
> > queues and such?
> > 
> > Op donderdag 10 maart 2016 16:14:07 UTC+1 schreef David Szotten:
> > 
> > > async without waiting:
> > > 
> > > the service container will still receive the reply, but discard it
> > > 
> > > On Thursday, 10 March 2016 14:50:32 UTC, Bruno Rocha wrote:
> > > 
> > > > 1) isn't it creating a lot of overhead if you would send messages this
> > > > 
> > > > > way? (return queue preparation and all that)
> > > > 
> > > > &nbsp;&nbsp;&nbsp;&nbsp;In the case of email sending I don't care about the results  
> > > > immediately, the caller will get the results in the email body after. I  
> > > > don't know if async has overheads.
> > > > 
> > > > > 2) what happens with the result anyway? Do you end up with a stuffed  
> > > > > rabbit? dead letters?
> > > > 
> > > > &nbsp;&nbsp;&nbsp;Since the "consumer/worker" finished the task it sends "ack" signal  
> > > > to rabbit. I don't think there is "dead letters" after that, even if the  
> > > > consumer fails, messages has an TTL there.
> > > > 
> > > > --
> > > > 
> > > > \*Bruno Rocha - @rochacbruno \<[http://twitter.com/rochacbruno&gt;\](http://twitter.com/rochacbruno&gt;%5C)\*  
> > > > [http://brunorocha.org](http://brunorocha.org)  
> > > > [rochacbruno (Bruno Rocha) · GitHub](http://github.com/rochacbruno)  
> > > > [http://linkedin.com/in/rochacbruno](http://linkedin.com/in/rochacbruno)  
> > > > [Google Workspace Updates: New community features for Google Chat and an update on Currents](http://plus.google.com/+BrunoRocha1)  
> > > > \<[Google Workspace Updates: New community features for Google Chat and an update on Currents](http://plus.google.com/+BrunoRocha1&gt);
