def add_listener(self, on_message=None):
request = topic_add_message_listener_codec.encode_request(self.name, False)<EOL>def handle(item, publish_time, uuid):<EOL><INDENT>member = self._client.cluster.get_member_by_uuid(uuid)<EOL>item_event = TopicMessage(self.name, item, publish_time, member, self._to_object)<EOL>on_message(item_event)<EOL><DEDENT>return self._start_listening(request,<EOL>lambda m: topic_add_message_listener_codec.handle(m, handle),<EOL>lambda r: topic_add_message_listener_codec.decode_response(r)['<STR_LIT>'],<EOL>self.partition_key)<EOL>
Subscribes to this topic. When someone publishes a message on this topic, on_message() function is called if
provided.

:param on_message: (Function), function to be called when a message is published.
:return: (str), a registration id which is used as a key to remove the listener.