Example #1
0
 def _get_queue(queue_suffix):
     queue_name = queue_utils.get_queue_name(
         queue_name_base="st2.sensor.watch",
         queue_name_suffix=queue_suffix,
         add_random_uuid_to_suffix=True,
     )
     return reactor.get_sensor_cud_queue(queue_name, routing_key="#")
Example #2
0
 def _get_queue(queue_suffix):
     if not queue_suffix:
         # pick last 10 digits of uuid. Arbitrary but unique enough for the TriggerWatcher.
         u_hex = uuid.uuid4().hex
         queue_suffix = uuid.uuid4().hex[len(u_hex) - 10:]
     queue_name = 'st2.sensor.watch.%s' % queue_suffix
     return reactor.get_sensor_cud_queue(queue_name, routing_key='#')
Example #3
0
 def _get_queue(queue_suffix):
     if not queue_suffix:
         # pick last 10 digits of uuid. Arbitrary but unique enough for the TriggerWatcher.
         u_hex = uuid.uuid4().hex
         queue_suffix = uuid.uuid4().hex[len(u_hex) - 10:]
     queue_name = 'st2.sensor.watch.%s' % queue_suffix
     return reactor.get_sensor_cud_queue(queue_name, routing_key='#')
Example #4
0
 def _get_queue(queue_suffix):
     queue_name = queue_utils.get_queue_name(queue_name_base='st2.sensor.watch',
                                             queue_name_suffix=queue_suffix,
                                             add_random_uuid_to_suffix=True
                                             )
     return reactor.get_sensor_cud_queue(queue_name, routing_key='#')
Example #5
0
    ACTIONSCHEDULER_REQUEST_QUEUE,
    ACTIONRUNNER_WORK_QUEUE,
    ACTIONRUNNER_CANCEL_QUEUE,
    NOTIFIER_ACTIONUPDATE_WORK_QUEUE,
    RESULTSTRACKER_ACTIONSTATE_WORK_QUEUE,
    RULESENGINE_WORK_QUEUE,
    STREAM_ANNOUNCEMENT_WORK_QUEUE,
    STREAM_EXECUTION_ALL_WORK_QUEUE,
    STREAM_LIVEACTION_WORK_QUEUE,
    STREAM_EXECUTION_OUTPUT_QUEUE,
    WORKFLOW_EXECUTION_WORK_QUEUE,
    WORKFLOW_EXECUTION_RESUME_QUEUE,
    # Those queues are dynamically / late created on some class init but we still need to
    # pre-declare them for redis Kombu backend to work.
    reactor.get_trigger_cud_queue(name="st2.preinit", routing_key="init"),
    reactor.get_sensor_cud_queue(name="st2.preinit", routing_key="init"),
]


def _do_register_exchange(exchange, connection, channel, retry_wrapper):
    try:
        kwargs = {
            "exchange": exchange.name,
            "type": exchange.type,
            "durable": exchange.durable,
            "auto_delete": exchange.auto_delete,
            "arguments": exchange.arguments,
            "nowait": False,
            "passive": False,
        }
        # Use the retry wrapper to increase resiliency in recoverable errors.
Example #6
0
QUEUES = [
    ACTIONSCHEDULER_REQUEST_QUEUE,
    ACTIONRUNNER_WORK_QUEUE,
    ACTIONRUNNER_CANCEL_QUEUE,
    EXPORTER_WORK_QUEUE,
    NOTIFIER_ACTIONUPDATE_WORK_QUEUE,
    RESULTSTRACKER_ACTIONSTATE_WORK_QUEUE,
    RULESENGINE_WORK_QUEUE,
    STREAM_ANNOUNCEMENT_WORK_QUEUE,
    STREAM_EXECUTION_WORK_QUEUE,
    STREAM_LIVEACTION_WORK_QUEUE,

    # Those queues are dynamically / late created on some class init but we still need to
    # pre-declare them for redis Kombu backend to work.
    reactor.get_trigger_cud_queue(name='st2.preinit', routing_key='init'),
    reactor.get_sensor_cud_queue(name='st2.preinit', routing_key='init')
]


def _do_register_exchange(exchange, connection, channel, retry_wrapper):
    try:
        kwargs = {
            'exchange': exchange.name,
            'type': exchange.type,
            'durable': exchange.durable,
            'auto_delete': exchange.auto_delete,
            'arguments': exchange.arguments,
            'nowait': False,
            'passive': False
        }
        # Use the retry wrapper to increase resiliency in recoverable errors.
Example #7
0
    NOTIFIER_ACTIONUPDATE_WORK_QUEUE,
    RESULTSTRACKER_ACTIONSTATE_WORK_QUEUE,
    RULESENGINE_WORK_QUEUE,

    STREAM_ANNOUNCEMENT_WORK_QUEUE,
    STREAM_EXECUTION_ALL_WORK_QUEUE,
    STREAM_LIVEACTION_WORK_QUEUE,
    STREAM_EXECUTION_OUTPUT_QUEUE,

    WORKFLOW_EXECUTION_WORK_QUEUE,
    WORKFLOW_EXECUTION_RESUME_QUEUE,

    # Those queues are dynamically / late created on some class init but we still need to
    # pre-declare them for redis Kombu backend to work.
    reactor.get_trigger_cud_queue(name='st2.preinit', routing_key='init'),
    reactor.get_sensor_cud_queue(name='st2.preinit', routing_key='init')
]


def _do_register_exchange(exchange, connection, channel, retry_wrapper):
    try:
        kwargs = {
            'exchange': exchange.name,
            'type': exchange.type,
            'durable': exchange.durable,
            'auto_delete': exchange.auto_delete,
            'arguments': exchange.arguments,
            'nowait': False,
            'passive': False
        }
        # Use the retry wrapper to increase resiliency in recoverable errors.