Subscribes to a topic and calls the given function, when the value is published. For retained messages the first message is received on subscription, so make sure to define the function before subscribing! The function gets called with the two parameter topic and payload.
Note: Often payloads are JSON encoded. You can use the json_ expression functions to access the contained values.