OpenMCF logoOpenMCF

Loading...

OCI Queue

Deploys an Oracle Cloud Infrastructure Queue — a fully managed, serverless message queue for asynchronous communication between decoupled services. Supports configurable message retention, visibility timeouts, dead-letter queues, optional KMS encryption, large message support (up to 512 KB), and consumer groups for partitioned consumption.

What Gets Created

When you deploy an OciQueue resource, OpenMCF provisions:

  • Queue — a queue.Queue resource in the specified compartment with configurable retention, visibility timeout, polling timeout, optional KMS encryption, optional dead-letter queue, and optional capabilities (large messages, consumer groups).

Prerequisites

  • OCI credentials configured via environment variables or OpenMCF provider config (API Key, Instance Principal, Security Token, Resource Principal, or OKE Workload Identity)
  • A compartment OCID where the queue will be created — either a literal value or a reference to an OciCompartment resource
  • A KMS key OCID (optional) — if using customer-managed encryption

Quick Start

Create a file queue.yaml:

apiVersion: oci.openmcf.org/v1
kind: OciQueue
metadata:
  name: my-queue
  labels:
    openmcf.org/provisioner: pulumi
    pulumi.openmcf.org/organization: my-org
    pulumi.openmcf.org/project: my-project
    pulumi.openmcf.org/stack.name: dev.OciQueue.my-queue
spec:
  compartmentId:
    value: "ocid1.compartment.oc1..example"

Deploy:

openmcf apply -f queue.yaml

This creates a queue with Oracle-managed encryption, 7-day default retention, and standard message size limits. The queue OCID and messages endpoint are exported as stack outputs.

Configuration Reference

Required Fields

FieldTypeDescriptionValidation
compartmentIdStringValueOrRefOCID of the compartment where the queue will be created. Can reference an OciCompartment resource via valueFrom.Required

Optional Fields

FieldTypeDefaultDescription
customEncryptionKeyIdStringValueOrRef—OCID of a KMS master encryption key for encrypting message content. When omitted, Oracle-managed encryption is used. Can reference an OciKmsKey resource via valueFrom.
deadLetterQueueDeliveryCountint32OCI defaultNumber of delivery attempts before a message is moved to the dead-letter queue. A value of 0 disables the DLQ.
retentionInSecondsint32604800 (7 days)Retention period for messages in seconds. ForceNew — changing this value forces queue recreation.
timeoutInSecondsint32OCI defaultDefault polling timeout for GetMessages calls, in seconds.
visibilityInSecondsint32OCI defaultDefault visibility timeout for consumed messages, in seconds. A consumed message is invisible to other consumers for this duration.
channelConsumptionLimitint32OCI defaultPercentage of allocated queue resources that can be consumed by a single channel.
isLargeMessagesEnabledboolfalseEnable large message support (up to 512 KB per message). Maps to the LARGE_MESSAGES capability.
consumerGroupConfigConsumerGroupConfig—Consumer group configuration. When provided, enables the CONSUMER_GROUPS capability for partitioned consumption.

ConsumerGroupConfig

FieldTypeDefaultDescription
isPrimaryEnabledbool—Whether to enable the primary consumer group after adding the capability.
primaryDeadLetterQueueDeliveryCountint32—DLQ delivery count for the primary consumer group. Overrides the queue-level deadLetterQueueDeliveryCount. A value of 0 disables the DLQ for this group.
primaryDisplayNamestring"Primary Consumer Group"Display name for the primary consumer group.

Examples

Minimal Queue

A queue with default settings for development:

apiVersion: oci.openmcf.org/v1
kind: OciQueue
metadata:
  name: dev-queue
  labels:
    openmcf.org/provisioner: pulumi
    pulumi.openmcf.org/organization: my-org
    pulumi.openmcf.org/project: my-project
    pulumi.openmcf.org/stack.name: dev.OciQueue.dev-queue
spec:
  compartmentId:
    value: "ocid1.compartment.oc1..example"

Queue with DLQ and Custom Timeouts

A production queue with dead-letter queue enabled, extended visibility timeout, and KMS encryption:

apiVersion: oci.openmcf.org/v1
kind: OciQueue
metadata:
  name: order-processing
  labels:
    openmcf.org/provisioner: pulumi
    pulumi.openmcf.org/organization: my-org
    pulumi.openmcf.org/project: my-project
    pulumi.openmcf.org/stack.name: prod.OciQueue.order-processing
spec:
  compartmentId:
    valueFrom:
      kind: OciCompartment
      name: prod-compartment
      fieldPath: status.outputs.compartmentId
  customEncryptionKeyId:
    valueFrom:
      kind: OciKmsKey
      name: queue-key
      fieldPath: status.outputs.keyId
  deadLetterQueueDeliveryCount: 5
  retentionInSeconds: 1209600
  visibilityInSeconds: 120
  timeoutInSeconds: 20

Large Messages with Consumer Groups

A queue supporting 512 KB messages with partitioned consumption via consumer groups:

apiVersion: oci.openmcf.org/v1
kind: OciQueue
metadata:
  name: event-bus
  labels:
    openmcf.org/provisioner: pulumi
    pulumi.openmcf.org/organization: my-org
    pulumi.openmcf.org/project: my-project
    pulumi.openmcf.org/stack.name: prod.OciQueue.event-bus
spec:
  compartmentId:
    valueFrom:
      kind: OciCompartment
      name: prod-compartment
      fieldPath: status.outputs.compartmentId
  isLargeMessagesEnabled: true
  deadLetterQueueDeliveryCount: 3
  consumerGroupConfig:
    isPrimaryEnabled: true
    primaryDisplayName: "main-consumers"
    primaryDeadLetterQueueDeliveryCount: 5

Stack Outputs

After deployment, the following outputs are available in status.outputs:

OutputTypeDescription
queue_idstringOCID of the queue
messages_endpointstringEndpoint URL for consuming or publishing messages

Related Components

  • OciCompartment — provides the compartment referenced by compartmentId via valueFrom
  • OciKmsKey — provides the encryption key referenced by customEncryptionKeyId via valueFrom
  • OciAlarm — monitors queue metrics (queue depth, message age) via MQL
  • OciLogGroup — collects queue service logs

Next article

OCI Redis Cluster

OCI Redis Cluster Deploys an Oracle Cloud Infrastructure Cache (Redis) cluster — a fully managed, Redis-compatible in-memory caching service that supports both non-sharded (single primary with replicas) and sharded (horizontally scaled) topologies. What Gets Created When you deploy an OciRedisCluster resource, OpenMCF provisions: Redis Cluster — an ociredisrediscluster resource in the specified compartment and subnet. Non-sharded clusters consist of a single primary with optional replicas....
Read next article
Presets
2 ready-to-deploy configurationsView presets →