# Batch processing

**URL:** <https://discourse.nameko.io/t/batch-processing/198>\
**Category:** googlegroup\
**Created:** [June 16, 2017, 12:21am UTC](https://discourse.nameko.io/t/batch-processing/198 "2017-06-16T00:21:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marco\_Lavagnino](https://avatars.discourse-cdn.com/v4/letter/m/96bed5/32.png) [@Marco\_Lavagnino](https://discourse.nameko.io/u/Marco_Lavagnino)\
**Post date:** [June 16, 2017, 12:21am UTC](https://discourse.nameko.io/t/batch-processing/198/1 "2017-06-16T00:21:28Z")

</div>

In my service I process requests in batches - this is because I use a GPU  
and it's faster to process batches of data.

I'd like to put requests individually on the rabbitmq queue, tough.

How could I process batches of rabbitmq messages?

---

<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:** [June 19, 2017, 9:55am UTC](https://discourse.nameko.io/t/batch-processing/198/2 "2017-06-19T09:55:17Z")

</div>

Hi,

This isn't something supported out of the box, but nameko tries to be  
extensible wherever possible. In this case you might be able to create your  
own subclass of `nameko.messaging.Consumer`, overriding `handle_message` to  
batch up incoming messages and only spawning a worker when you have  
collected enough messages

Best,  
David

> **···**
>
> On Friday, 16 June 2017 01:21:28 UTC+1, marco.l...@gmail.com wrote:
> 
> > In my service I process requests in batches - this is because I use a GPU  
> > and it's faster to process batches of data.
> > 
> > I'd like to put requests individually on the rabbitmq queue, tough.
> > 
> > How could I process batches of rabbitmq messages?
