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.


You can also use Oracle Cloud Infrastructure Service Connector Hub to consume data from a stream and pass messages to Object Storage or any other supported Service 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.