Normally, by pika
driver, when we set a consumer, we should pass a callback as parameter. On new message, pika will invoke the callback with 4 arguments: ch, method, property, body
.
I need my callback to get just one argument: body
.
I mean:
def my_callback(body):
pass
Instead of:
def my_callback(ch, method, property, body):
pass
How can I implement it?
As @jdehesa said, the solution is using lambda
expression, like so:
lambda ch, method, property, body: my_callback(body)