You add the handler under the message section of gateway event scripts on the receiving gateway:
The messageHandler parameter matches the gateway message handler name (“logger” in the example shown).
You add the handler under the message section of gateway event scripts on the receiving gateway: