Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Event Hubs] Merge feature branch for buffered producer #18590

Merged
merged 6 commits into from
Nov 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions sdk/eventhub/event-hubs/review/event-hubs.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ import { TokenCredential } from '@azure/core-auth';
import { WebSocketImpl } from 'rhea-promise';
import { WebSocketOptions } from '@azure/core-amqp';

// @public
export interface BufferedCloseOptions extends OperationOptions {
flush?: boolean;
}

// @public
export interface BufferedFlushOptions extends OperationOptions {
}

// @public
export interface Checkpoint {
consumerGroup: string;
Expand Down Expand Up @@ -55,6 +64,10 @@ export interface CreateBatchOptions extends OperationOptions {
// @public
export const earliestEventPosition: EventPosition;

// @public
export interface EnqueueEventOptions extends SendBatchOptions {
}

// @public
export interface EventData {
body: any;
Expand Down Expand Up @@ -82,6 +95,30 @@ export interface EventDataBatch {
tryAdd(eventData: EventData | AmqpAnnotatedMessage, options?: TryAddOptions): boolean;
}

// @public
export class EventHubBufferedProducerClient {
HarshaNalluru marked this conversation as resolved.
Show resolved Hide resolved
constructor(connectionString: string, options: EventHubBufferedProducerClientOptions);
constructor(connectionString: string, eventHubName: string, options: EventHubBufferedProducerClientOptions);
constructor(fullyQualifiedNamespace: string, eventHubName: string, credential: TokenCredential | NamedKeyCredential | SASCredential, options: EventHubBufferedProducerClientOptions);
close(options?: BufferedCloseOptions): Promise<void>;
enqueueEvent(event: EventData | AmqpAnnotatedMessage, options?: EnqueueEventOptions): Promise<number>;
enqueueEvents(events: EventData[] | AmqpAnnotatedMessage[], options?: EnqueueEventOptions): Promise<number>;
get eventHubName(): string;
flush(options?: BufferedFlushOptions): Promise<void>;
get fullyQualifiedNamespace(): string;
getEventHubProperties(options?: GetEventHubPropertiesOptions): Promise<EventHubProperties>;
getPartitionIds(options?: GetPartitionIdsOptions): Promise<Array<string>>;
getPartitionProperties(partitionId: string, options?: GetPartitionPropertiesOptions): Promise<PartitionProperties>;
}

// @public
export interface EventHubBufferedProducerClientOptions extends EventHubClientOptions {
maxEventBufferLengthPerPartition?: number;
maxWaitTimeInMs?: number;
onSendEventsErrorHandler: (ctx: OnSendEventsErrorContext) => Promise<void>;
onSendEventsSuccessHandler?: (ctx: OnSendEventsSuccessContext) => Promise<void>;
}

// @public
export interface EventHubClientOptions {
customEndpointAddress?: string;
Expand Down Expand Up @@ -190,6 +227,19 @@ export const logger: AzureLogger;

export { MessagingError }

// @public
export interface OnSendEventsErrorContext {
error: Error;
events: Array<EventData | AmqpAnnotatedMessage>;
partitionId: string;
}

// @public
export interface OnSendEventsSuccessContext {
events: Array<EventData | AmqpAnnotatedMessage>;
partitionId: string;
}

// @public
export interface OperationOptions {
abortSignal?: AbortSignalLike;
Expand Down
Loading