Consuming Messages
Using a specified cursor, consume messages from a stream in the Streaming service.
Consuming messages from a stream requires you to:
- Create a cursor.
- Use the cursor to get, or 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.
Following are tasks that you can do related to consuming messages.
- Creating a Cursor
- Creating a Group Cursor
- Getting (Reading) Messages
- Sending a Heartbeat
- Manually Committing an Offset
- Getting the Current State of a Consumer Group
- Updating a Consumer Group
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.
You can show the latest messages in a stream using the Console. However, to consume messages from the stream, you use the CLI, API, or an SDK to create and use cursors.
To consume messages using OCI SDKs, see the Developer Guide to Streaming. See also Developing with Kafka and Streaming.
Required IAM Policy
To use Oracle Cloud Infrastructure, an administrator must be a member of a group granted security access in a policy by a tenancy 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 the tenancy administrator what type of access you have and which compartment your access works 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. For more information about Streaming policies, see Accessing Streaming Resources Across Tenancies and Details for the Streaming Service.
If you're new to policies, see IAM Policies Overview.