Options
All
  • Public
  • Public/Protected
  • All
Menu

Class StreamClient

This service client does not use circuit breakers by default if the user has not defined a circuit breaker configuration.

Hierarchy

  • StreamClient

Constructors

constructor

  • new StreamClient(params: common.AuthParams, clientConfiguration?: common.ClientConfiguration): StreamClient

Properties

Protected _bodyDuplexMode

_bodyDuplexMode: any = undefined

Protected _circuitBreaker

_circuitBreaker: typeof Breaker | null = null

Protected _clientConfiguration

_clientConfiguration: ClientConfiguration

Protected _defaultHeaders

_defaultHeaders: any

Protected _endpoint

_endpoint: string = ""

Protected _httpClient

_httpClient: HttpClient

Protected _httpOptions

_httpOptions: any = undefined

Protected _realmSpecificEndpointTemplateEnabled

_realmSpecificEndpointTemplateEnabled: boolean | undefined = undefined

targetService

targetService: string = "Stream"

Static Protected endpointServiceName

endpointServiceName: string = ""

Static Protected serviceEndpointTemplate

serviceEndpointTemplate: string = "https://streaming.{region}.oci.{secondLevelDomain}"

Accessors

endpoint

  • get endpoint(): string
  • set endpoint(endpoint: string): void

logger

useRealmSpecificEndpointTemplate

  • set useRealmSpecificEndpointTemplate(realmSpecificEndpointTemplateEnabled: boolean): void
  • Determines whether realm specific endpoint should be used or not. Set realmSpecificEndpointTemplateEnabled to "true" if the user wants to enable use of realm specific endpoint template, otherwise set it to "false"

    Parameters

    • realmSpecificEndpointTemplateEnabled: boolean

      flag to enable the use of realm specific endpoint template

    Returns void

Methods

close

  • close(): void

consumerCommit

  • Provides a mechanism to manually commit offsets, if not using commit-on-get consumer semantics. This commits offsets assicated with the provided cursor, extends the timeout on each of the affected partitions, and returns an updated cursor.

    This operation uses {@link common.OciSdkDefaultRetryConfiguration} by default if no retry configuration is defined by the user.

    throws

    OciError when an error occurs

    example

    Click here to see how to use ConsumerCommit API.

    Parameters

    Returns Promise<ConsumerCommitResponse>

    ConsumerCommitResponse

consumerHeartbeat

  • Allows long-running processes to extend the timeout on partitions reserved by a consumer instance.

    This operation uses {@link common.OciSdkDefaultRetryConfiguration} by default if no retry configuration is defined by the user.

    throws

    OciError when an error occurs

    example

    Click here to see how to use ConsumerHeartbeat API.

    Parameters

    Returns Promise<ConsumerHeartbeatResponse>

    ConsumerHeartbeatResponse

createCursor

  • Creates a cursor. Cursors are used to consume a stream, starting from a specific point in the partition and going forward from there. You can create a cursor based on an offset, a time, the trim horizon, or the most recent message in the stream. As the oldest message inside the retention period boundary, using the trim horizon effectively lets you consume all messages in the stream. A cursor based on the most recent message allows consumption of only messages that are added to the stream after you create the cursor. Cursors expire five minutes after you receive them from the service.

    This operation uses {@link common.OciSdkDefaultRetryConfiguration} by default if no retry configuration is defined by the user.

    throws

    OciError when an error occurs

    example

    Click here to see how to use CreateCursor API.

    Parameters

    Returns Promise<CreateCursorResponse>

    CreateCursorResponse

createGroupCursor

getGroup

  • Returns the current state of a consumer group.

    This operation uses {@link common.OciSdkDefaultRetryConfiguration} by default if no retry configuration is defined by the user.

    throws

    OciError when an error occurs

    example

    Click here to see how to use GetGroup API.

    Parameters

    Returns Promise<GetGroupResponse>

    GetGroupResponse

getMessages

  • Returns messages from the specified stream using the specified cursor as the starting point for consumption. By default, the number of messages returned is undefined, but the service returns as many as possible. To get messages, you must first obtain a cursor using the {@link #createCursor(CreateCursorRequest) createCursor} operation. In the response, retrieve the value of the 'opc-next-cursor' header to pass as a parameter to get the next batch of messages in the stream.

    This operation uses {@link common.OciSdkDefaultRetryConfiguration} by default if no retry configuration is defined by the user.

    throws

    OciError when an error occurs

    example

    Click here to see how to use GetMessages API.

    Parameters

    Returns Promise<GetMessagesResponse>

    GetMessagesResponse

putMessages

  • Emits messages to a stream. There's no limit to the number of messages in a request, but the total size of a message or request must be 1 MiB or less. The service calculates the partition ID from the message key and stores messages that share a key on the same partition. If a message does not contain a key or if the key is null, the service generates a message key for you. The partition ID cannot be passed as a parameter.

    This operation does not retry by default if the user has not defined a retry configuration.

    throws

    OciError when an error occurs

    example

    Click here to see how to use PutMessages API.

    Parameters

    Returns Promise<PutMessagesResponse>

    PutMessagesResponse

shutdownCircuitBreaker

  • shutdownCircuitBreaker(): void

updateGroup

  • Forcefully changes the current location of a group as a whole; reseting processing location of all consumers to a particular location in the stream.

    This operation uses {@link common.OciSdkDefaultRetryConfiguration} by default if no retry configuration is defined by the user.

    throws

    OciError when an error occurs

    example

    Click here to see how to use UpdateGroup API.

    Parameters

    Returns Promise<UpdateGroupResponse>

    UpdateGroupResponse