I am using async consumers, and everything they do is async, except for a middleware. I have a custom authentication middleware that connects to the database and runs 2-3 queries.
It is suggested in the docs that if anything non-async is done in the consumer, we should use sync consumers. Same principle applies here, or is it ok to do sync stuff in a middleware as it is done only on session initializaiton?