Middlewares should differentiate between published and consumed messages

There are cases where we want middleware to operate only on messages that are either being published or consumed and it's not always possible to tell based on the directionality of the message.