# Missing RMQ message in consume callback method

**URL:** <https://discourse.nameko.io/t/missing-rmq-message-in-consume-callback-method/692>\
**Category:** Uncategorized\
**Created:** [May 19, 2021, 6:06pm UTC](https://discourse.nameko.io/t/missing-rmq-message-in-consume-callback-method/692 "2021-05-19T18:06:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![spyrosmarko](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.nameko.io/spyrosmarko/32/29_2.png) [@spyrosmarko](https://discourse.nameko.io/u/spyrosmarko)\
**Post date:** [May 19, 2021, 6:06pm UTC](https://discourse.nameko.io/t/missing-rmq-message-in-consume-callback-method/692/1 "2021-05-19T18:06:27Z")

</div>

Hi,

I wanted to ask why at Consumer entrypoint, that will be used as `consume` decorator, the RMQ Message that includes info like `delivery_info` it’s not included at [handle\_message](https://github.com/nameko/nameko/blob/v3.0.0-rc8/nameko/messaging.py#L206). I can see that the callback that gets defined at consume decorator includes only the actual message published to RMQ. To give some background why I have been digging on it, I want to use the same callback method for multiple @consume decorators that each one of them uses different routing key. So I had the idea to use a single callback for DRY reasons and make it generic using `routing_key`.

So I have ended up subclassing [Consume](https://github.com/nameko/nameko/blob/v3.0.0-rc8/nameko/messaging.py#L127) entrypoint, and overriding it’s `handle_message` method by passing both `body` and `message` as callback’s arguments.

Doing so, I was able to do the following that works as fits my needs:

```python

e = Exchange(name="myexchange", type="topic", durable=True, delivery_mode=2)

class Service:
    name = "foo"
    
    @consume(
         queue=Queue(name="queue_1", exchange=e, routing_key="rk1"),
         prefetch_count=1,
     )
     @consume(
         queue=Queue(name="queue_2", exchange=e, routing_key="rk2"),
         prefetch_count=1,
     )
     def handle_received_message(self, body, message):
         print(body) # prints payload published
         print(message) # prints Message object, <Message object at 0x7f45f57a0ee0 with details {'state': 'RECEIVED', 'delivery_tag': 1, 'body_length': 9, 'properties': {}, 'delivery_info': {'exchange': 'myexchange', 'routing_key': 'rk1'}}>

```

Essentially, my question is if it’s OK to do so or have I broken anything internal of nameko?

Thank you in advance for your time and your reply on this.

Spyros
