MWEB-999 AMQP first step

Don't merge it yet
could you move this logic to the separate named function?