|
| 1 | +.. Licensed to the Apache Software Foundation (ASF) under one |
| 2 | + or more contributor license agreements. See the NOTICE file |
| 3 | + distributed with this work for additional information |
| 4 | + regarding copyright ownership. The ASF licenses this file |
| 5 | + to you under the Apache License, Version 2.0 (the |
| 6 | + "License"); you may not use this file except in compliance |
| 7 | + with the License. You may obtain a copy of the License at |
| 8 | +
|
| 9 | + .. http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +
|
| 11 | + .. Unless required by applicable law or agreed to in writing, |
| 12 | + software distributed under the License is distributed on an |
| 13 | + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | + KIND, either express or implied. See the License for the |
| 15 | + specific language governing permissions and limitations |
| 16 | + under the License. |
| 17 | +
|
| 18 | +.. NOTE TO CONTRIBUTORS: |
| 19 | + Please, only add notes to the Changelog just below the "Changelog" header when there are some breaking changes |
| 20 | + and you want to add an explanation to the users on how they are supposed to deal with them. |
| 21 | + The changelog is updated and maintained semi-automatically by release manager. |
| 22 | +
|
| 23 | +
|
| 24 | +IBM MQ Message Queue |
| 25 | +==================== |
| 26 | + |
| 27 | +.. contents:: |
| 28 | + :local: |
| 29 | + :depth: 2 |
| 30 | + |
| 31 | + |
| 32 | +IBM MQ Queue Provider |
| 33 | +--------------------- |
| 34 | + |
| 35 | +Implemented by :class:`~airflow.providers.ibm.mq.queues.mq.IBMMQMessageQueueProvider` |
| 36 | + |
| 37 | +The IBM MQ Queue Provider is a |
| 38 | +:class:`~airflow.providers.common.messaging.providers.base_provider.BaseMessageQueueProvider` |
| 39 | +that uses IBM MQ as the underlying message queue system. |
| 40 | + |
| 41 | +It allows you to send and receive messages using IBM MQ queues in your Airflow workflows |
| 42 | +via the common message queue interface |
| 43 | +:class:`~airflow.providers.common.messaging.triggers.msg_queue.MessageQueueTrigger`. |
| 44 | + |
| 45 | + |
| 46 | +.. include:: /../src/airflow/providers/ibm/mq/queues/mq.py |
| 47 | + :start-after: [START ibmmq_message_queue_provider_description] |
| 48 | + :end-before: [END ibmmq_message_queue_provider_description] |
| 49 | + |
| 50 | + |
| 51 | +.. _howto/triggers:IBMMQMessageQueueTrigger: |
| 52 | + |
| 53 | + |
| 54 | +IBM MQ Message Queue Trigger |
| 55 | +---------------------------- |
| 56 | + |
| 57 | +Implemented by :class:`~airflow.providers.ibm.mq.triggers.mq.AwaitMessageTrigger` |
| 58 | + |
| 59 | +Inherited from |
| 60 | +:class:`~airflow.providers.common.messaging.triggers.msg_queue.MessageQueueTrigger` |
| 61 | + |
| 62 | +Wait for a message in a queue |
| 63 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 64 | + |
| 65 | +Below is an example of how you can configure an Airflow DAG to be triggered |
| 66 | +by a message arriving in an IBM MQ queue. |
| 67 | + |
| 68 | +.. exampleinclude:: /../tests/system/ibm/mq/example_dag_message_queue_trigger.py |
| 69 | + :language: python |
| 70 | + :start-after: [START howto_trigger_message_queue] |
| 71 | + :end-before: [END howto_trigger_message_queue] |
| 72 | + |
| 73 | + |
| 74 | +How it works |
| 75 | +------------ |
| 76 | + |
| 77 | +1. **IBM MQ Message Queue Trigger** |
| 78 | + The ``AwaitMessageTrigger`` listens for messages from an IBM MQ queue. |
| 79 | + |
| 80 | +2. **Asset and Watcher** |
| 81 | + The ``Asset`` abstracts the external entity, the IBM MQ queue in this example. |
| 82 | + The ``AssetWatcher`` associates a trigger with a name. This name helps you |
| 83 | + identify which trigger is associated with which asset. |
| 84 | + |
| 85 | +3. **Event-Driven DAG** |
| 86 | + Instead of running on a fixed schedule, the DAG executes when the asset receives |
| 87 | + an update (for example, when a new message arrives in the queue). |
| 88 | + |
| 89 | +For how to use the trigger, refer to the documentation of the |
| 90 | +:ref:`Messaging Trigger <howto/trigger:MessageQueueTrigger>`. |
0 commit comments