There is no standard mechanism to do this.
The normal way would be to subscribe to the original messages topic with a client which does the transformation then re-published it on a new topic that the end device is subscribed to.
There are libraries that let you implement your own broker that include hooks that should allow you to manipulate messages on the fly if needed.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…