There is a whapps_util:amqp_pool_request/3 you could use instead of this.