How to use the kombu.uuid function in kombu

To help you get started, we’ve selected a few kombu examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github FORTH-ICS-INSPIRE / artemis / testing / detection / tester.py View on Github external
def hijack_multiple_action(db_con, connection, hijack_keys, action):
        correlation_id = uuid()
        callback_queue = Queue(
            uuid(),
            channel=connection.default_channel,
            durable=False,
            exclusive=True,
            auto_delete=True,
            max_priority=4,
            consumer_arguments={"x-priority": 4},
        )
        with connection.Producer() as producer:
            producer.publish(
                {"keys": hijack_keys, "action": action},
                exchange="",
                routing_key="db-hijack-multiple-action",
                retry=True,
                declare=[callback_queue],
                reply_to=callback_queue.name,
                correlation_id=correlation_id,
github FORTH-ICS-INSPIRE / artemis / testing / detection / tester.py View on Github external
def load_as_sets(connection):
        correlation_id = uuid()
        callback_queue = Queue(
            uuid(),
            channel=connection.default_channel,
            durable=False,
            exclusive=True,
            auto_delete=True,
            max_priority=4,
            consumer_arguments={"x-priority": 4},
        )
        with connection.Producer() as producer:
            producer.publish(
                {},
                exchange="",
                routing_key="conf-load-as-sets-queue",
                retry=True,
                declare=[callback_queue],
github FORTH-ICS-INSPIRE / artemis / testing / detection / tester.py View on Github external
def config_request_rpc(conn):
        """
        Initial RPC of this service to request the configuration.
        The RPC is blocked until the configuration service replies back.
        """
        correlation_id = uuid()
        callback_queue = Queue(
            uuid(),
            channel=conn.default_channel,
            durable=False,
            auto_delete=True,
            max_priority=4,
            consumer_arguments={"x-priority": 4},
        )

        with conn.Producer() as producer:
            producer.publish(
                "",
                exchange="",
                routing_key="config-request-queue",
                reply_to=callback_queue.name,
                correlation_id=correlation_id,
github FORTH-ICS-INSPIRE / artemis / testing / detection / tester.py View on Github external
def change_conf(connection, new_config, old_config, comment):
        changes = "".join(difflib.unified_diff(new_config, old_config))
        if changes:
            correlation_id = uuid()
            callback_queue = Queue(
                uuid(),
                channel=connection.default_channel,
                durable=False,
                auto_delete=True,
                max_priority=4,
                consumer_arguments={"x-priority": 4},
            )
            with connection.Producer() as producer:
                producer.publish(
                    {"config": new_config, "comment": comment},
                    exchange="",
                    routing_key="config-modify-queue",
                    serializer="yaml",
                    retry=True,
                    declare=[callback_queue],
                    reply_to=callback_queue.name,
                    correlation_id=correlation_id,
github FORTH-ICS-INSPIRE / artemis / backend / core / monitor.py View on Github external
def config_request_rpc(self):
            self.correlation_id = uuid()
            callback_queue = Queue(uuid(), durable=False, max_priority=2,
                    consumer_arguments={'x-priority': 2})

            self.producer.publish(
                '',
                exchange = '',
                routing_key = 'config_request_queue',
                reply_to = callback_queue.name,
                correlation_id = self.correlation_id,
                retry = True,
                declare = [callback_queue, Queue('config_request_queue', durable=False, max_priority=2)],
                priority = 2
            )
            with Consumer(self.connection,
                        on_message=self.handle_config_request_reply,
                        queues=[callback_queue], no_ack=True):
github FORTH-ICS-INSPIRE / artemis / backend / core / detection.py View on Github external
durable=False,
                auto_delete=True,
                max_priority=2,
                consumer_arguments={"x-priority": 2},
            )
            self.hijack_ongoing_queue = Queue(
                "detection-hijack-ongoing",
                exchange=self.hijack_exchange,
                routing_key="ongoing",
                durable=False,
                auto_delete=True,
                max_priority=1,
                consumer_arguments={"x-priority": 1},
            )
            self.config_queue = Queue(
                "detection-config-notify-{}".format(uuid()),
                exchange=self.config_exchange,
                routing_key="notify",
                durable=False,
                auto_delete=True,
                max_priority=3,
                consumer_arguments={"x-priority": 3},
            )
            self.update_rekey_queue = Queue(
                "detection-update-rekey",
                exchange=self.update_exchange,
                routing_key="hijack-rekey",
                durable=False,
                auto_delete=True,
                max_priority=1,
                consumer_arguments={"x-priority": 1},
            )
github FORTH-ICS-INSPIRE / artemis / backend / core / detection.py View on Github external
def config_request_rpc(self) -> NoReturn:
            """
            Initial RPC of this service to request the configuration.
            The RPC is blocked until the configuration service replies back.
            """
            self.correlation_id = uuid()
            callback_queue = Queue(
                uuid(),
                durable=False,
                auto_delete=True,
                max_priority=4,
                consumer_arguments={"x-priority": 4},
            )

            self.producer.publish(
                "",
                exchange="",
                routing_key="config-request-queue",
                reply_to=callback_queue.name,
                correlation_id=self.correlation_id,
                retry=True,
                declare=[
                    Queue(
                        "config-request-queue",
github FORTH-ICS-INSPIRE / artemis / backend / core / scheduler.py View on Github external
def __init__(self, connection):
            self.connection = connection
            self.flag = False
            self.time_to_wait = 1 # Time in secs to gather entries to perform a bulk operation
            self.time_to_wait_to_send_unhadled = 5

            self.db_clock_exchange = Exchange('db_clock', type='direct', durable=False, delivery_mode=1)

            self.db_clock_queue = Queue(uuid(), exchange=self.db_clock_exchange, routing_key='db_clock', durable=False, exclusive=True, max_priority=2,
                    consumer_arguments={'x-priority': 3})
            self.flag = True
            log.info('Scheduler Started..')
            self.db_clock_send()
github FORTH-ICS-INSPIRE / artemis / backend / core / detection.py View on Github external
def config_request_rpc(self) -> NoReturn:
            """
            Initial RPC of this service to request the configuration.
            The RPC is blocked until the configuration service replies back.
            """
            self.correlation_id = uuid()
            callback_queue = Queue(
                uuid(),
                durable=False,
                auto_delete=True,
                max_priority=4,
                consumer_arguments={"x-priority": 4},
            )

            self.producer.publish(
                "",
                exchange="",
                routing_key="config-request-queue",
                reply_to=callback_queue.name,
                correlation_id=self.correlation_id,
                retry=True,
                declare=[