Creating a Stream

Configure and create a stream in the Streaming service.

Before publishing messages to a stream or consuming messages from a stream, you must first create a stream. When creating a stream, consider your partitioning and security strategies. To review requirements for creating and managing streams, see Getting Started with Streaming.

Using OCI SDKs

To create a stream, use the createStream method of StreamAdminClient.

See the Developer Guide to Streaming for detailed SDK examples.

Using Resource Manager and Terraform

Use the oci_streaming_stream resource in Terraform configurations to create a stream in a compartment.

For example:

resource "oci_streaming_stream" "stream" {
  compartment_id     = var.compartment_ocid
  name               = "<stream_name>"
  partitions         = "<number_of_partitions>"
  retention_in_hours = "<retention_in_hours>"
}