Consuming Messages

This information describes consuming messages.

Consuming messages from a stream requires you to:

  • Create a cursor.
  • Use the cursor to read messages.
  • Use the returned cursor to continue reading messages.

You can use an individual consumer to read messages from one or more streams, or use consumer groups to read messages from a stream.

Tip

You can also use Oracle Cloud Infrastructure Connector Hub to consume data from a stream and pass messages to Object Storage or any other supported Connector Hub target.

While you can use the Console to view the latest messages in a stream, you should use the CLI, API, or an SDK to manage cursors and consume from your stream.

To consume messages using the Oracle Cloud Infrastructure (OCI) SDKs, see the Developer Guide to Streaming.

If you take advantage of Streaming's Kafka compatibility, see Developing with Kafka and Streaming.

Tip

You can also use Oracle Cloud Infrastructure Connector Hub to consume data from a stream and pass messages to Object Storage or any other supported Connector Hub target.

Required IAM Policy

To use Oracle Cloud Infrastructure, you must be granted security access in a policy  by an administrator. This access is required whether you're using the Console or the REST API with an SDK, CLI, or other tool. If you get a message that you don’t have permission or are unauthorized, verify with your administrator what type of access you have and which compartment  to work in.

For administrators: The policy in Let streaming admins manage streaming resources lets the specified group do everything with streaming and related Streaming service resources.

You can create a policy that gives a tenant stream-pull access to consume data from a stream in another tenant. See Accessing Streaming Resources Across Tenancies and Details for the Streaming Service if you want to dig deeper into writing policies for the Streaming service.

If you're new to policies, see Getting Started with Policies and Common Policies.