コード例 #1
0
def get_notification_transport(conf, url=None,
                               allowed_remote_exmods=None, aliases=None):
    """A factory method for Transport objects for notifications.

    This method should be used for notifications, in case notifications are
    being sent over a different message bus than normal messaging
    functionality; for example, using a different driver, or with different
    access permissions.

    If no transport URL is provided, the URL in the notifications section of
    the config file will be used.  If that URL is also absent, the same
    transport as specified in the messaging section will be used.

    If a transport URL is provided, then this function works exactly the same
    as get_transport.

    :param conf: the user configuration
    :type conf: cfg.ConfigOpts
    :param url: a transport URL, see :py:class:`transport.TransportURL`
    :type url: str or TransportURL
    :param allowed_remote_exmods: a list of modules which a client using this
                                  transport will deserialize remote exceptions
                                  from
    :type allowed_remote_exmods: list
    :param aliases: A map of transport alias to transport name
    :type aliases: dict
    """
    conf.register_opts(_notifier_opts,
                       group='oslo_messaging_notifications')
    if url is None:
        url = conf.oslo_messaging_notifications.transport_url
    return msg_transport._get_transport(conf, url,
                                        allowed_remote_exmods, aliases)
コード例 #2
0
ファイル: notifier.py プロジェクト: kgiusti/oslo.messaging
def get_notification_transport(conf, url=None,
                               allowed_remote_exmods=None, aliases=None):
    """A factory method for Transport objects for notifications.

    This method should be used for notifications, in case notifications are
    being sent over a different message bus than normal messaging
    functionality; for example, using a different driver, or with different
    access permissions.

    If no transport URL is provided, the URL in the notifications section of
    the config file will be used.  If that URL is also absent, the same
    transport as specified in the messaging section will be used.

    If a transport URL is provided, then this function works exactly the same
    as get_transport.

    :param conf: the user configuration
    :type conf: cfg.ConfigOpts
    :param url: a transport URL, see :py:class:`transport.TransportURL`
    :type url: str or TransportURL
    :param allowed_remote_exmods: a list of modules which a client using this
                                  transport will deserialize remote exceptions
                                  from
    :type allowed_remote_exmods: list
    :param aliases: A map of transport alias to transport name
    :type aliases: dict
    """
    conf.register_opts(_notifier_opts,
                       group='oslo_messaging_notifications')
    if url is None:
        url = conf.oslo_messaging_notifications.transport_url
    return msg_transport._get_transport(
        conf, url, allowed_remote_exmods, aliases,
        transport_cls=msg_transport.NotificationTransport)
コード例 #3
0
def get_rpc_transport(conf, url=None, allowed_remote_exmods=None):
    """A factory method for Transport objects for RPCs.

    This method should be used to ensure the correct messaging functionality
    for RPCs. RPCs and Notifications may use separate messaging systems
    that utilize different drivers, different access permissions,
    message delivery, etc.

    Presently, this function works exactly the same as get_transport. It's
    use is recommended as disambiguates the intended use for the transport
    and may in the future extend functionality related to the separation of
    messaging backends.

    :param conf: the user configuration
    :type conf: cfg.ConfigOpts
    :param url: a transport URL, see :py:class:`transport.TransportURL`
    :type url: str or TransportURL
    :param allowed_remote_exmods: a list of modules which a client using this
                                  transport will deserialize remote exceptions
                                  from
    :type allowed_remote_exmods: list
    """
    return msg_transport._get_transport(
        conf,
        url,
        allowed_remote_exmods,
        transport_cls=msg_transport.RPCTransport)
コード例 #4
0
ファイル: transport.py プロジェクト: kgiusti/oslo.messaging
def get_rpc_transport(conf, url=None,
                      allowed_remote_exmods=None):
    """A factory method for Transport objects for RPCs.

    This method should be used to ensure the correct messaging functionality
    for RPCs. RPCs and Notifications may use separate messaging systems
    that utilize different drivers, different access permissions,
    message delivery, etc.

    Presently, this function works exactly the same as get_transport. It's
    use is recommended as disambiguates the intended use for the transport
    and may in the future extend functionality related to the separation of
    messaging backends.

    :param conf: the user configuration
    :type conf: cfg.ConfigOpts
    :param url: a transport URL, see :py:class:`transport.TransportURL`
    :type url: str or TransportURL
    :param allowed_remote_exmods: a list of modules which a client using this
                                  transport will deserialize remote exceptions
                                  from
    :type allowed_remote_exmods: list
    """
    return msg_transport._get_transport(
        conf, url, allowed_remote_exmods,
        transport_cls=msg_transport.RPCTransport)