def _subscribe_broadcast(self, sub_id, channel, callback, **kwargs):
        """Listen to a broadcast topic, notify via callback function.
        :param sub_id: ID for this subscription in the transport layer
        :param channel: Topic name to subscribe to
        :param callback: Function to be called when messages are received
        :param **kwargs: Further parameters for the transport layer. For example
          ignore_namespace: Do not apply namespace to the destination name
          retroactive:      Ask broker to send old messages if possible
          transformation:   Transform messages into different format. If set
                            to True, will use 'jms-object-json' formatting.
        """
        headers = {}
        if kwargs.get("ignore_namespace"):
            destination = "/topic/" + channel
        else:
            destination = "/topic/" + self._namespace + channel
        if kwargs.get("retroactive"):
            headers["activemq.retroactive"] = "true"
        if kwargs.get("transformation"):
            if kwargs["transformation"] == True:
                headers["transformation"] = "jms-object-json"
            else:
                headers["transformation"] = kwargs["transformation"]
        self._conn.subscribe(destination, sub_id, headers=headers)
def _subscribe_broadcast ( self , sub_id , channel , callback , ** kwargs ) : headers = { } if kwargs . get ( "ignore_namespace" ) : destination = "/topic/" + channel else : destination = "/topic/" + self . _namespace + channel if kwargs . get ( "retroactive" ) : headers [ "activemq.retroactive" ] = "true" if kwargs . get ( "transformation" ) : if kwargs [ "transformation" ] == True : headers [ "transformation" ] = "jms-object-json" else : headers [ "transformation" ] = kwargs [ "transformation" ] self . _conn . subscribe ( destination , sub_id , headers = headers )
Listen to a broadcast topic, notify via callback function.
        :param sub_id: ID for this subscription in the transport layer
        :param channel: Topic name to subscribe to
        :param callback: Function to be called when messages are received
        :param **kwargs: Further parameters for the transport layer. For example
          ignore_namespace: Do not apply namespace to the destination name
          retroactive:      Ask broker to send old messages if possible
          transformation:   Transform messages into different format. If set
                            to True, will use 'jms-object-json' formatting.