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.
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 you should work in.
For administrators: The policy in Let streaming users manage streams 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.