Scenario: Sending Queue Messages to a Function

Integrate Queue with Functions using Connector Hub.

This scenario involves creating a function and then referencing that function as a target in a connector (Connector Hub)  to receive and process messages from queues.

Sending queue messages to a function.

The payload received by the function contains only messages from the queue.

For a related tutorial, see Use OCI Functions and OCI Queue to Authorize User Capabilities without Exposing Admin Privilege to Approvers.

For help with troubleshooting, see Troubleshooting Connectors.

Required IAM Policy

If you're a member of the Administrators group, you already have the required access to execute this scenario. Otherwise, you need access to Functions.

The workflow for creating the connector includes a default policy when needed to provide permission for writing to the target service. If you're new to policies, see Getting Started with Policies and Common Policies.

Error Handling When Processing Queues

Note

In the context of queue messages sent to functions, partial failures during processing of messages within a batch aren't supported.

When a function that's processing a batch of messages from a queue encounters an error, all messages in that batch become visible in the queue again, including messages that the function processed successfully. Therefore, a message could be processed by the function several times. As with any target, the connector keeps retrying indefinitely until the function target succeeds. For more information, see Delivery Details.

If a failure occurs while processing a batch of messages, the delivery count for those messages is still increased. If the delivery count for a message reaches the maximum defined at the queue level, then the message is sent to the dead letter queue. For more information, see Delivery count.

To prevent reprocessing of messages, make your function idempotent.

Confirm That the New Connector Moves Data

After you create the connector, confirm that it's moving data.

  • Enable logs for the connector to get details on data flow.
  • Check for expected results at the target service.

Confirming that data is moved helps you avoid automatic deactivation, which happens when a connector fails for a long time.