Skip to content
Closed
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
6 changes: 4 additions & 2 deletions sdk/servicebus/service-bus/src/core/messageReceiver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,13 @@ export abstract class MessageReceiver extends LinkEntity<Receiver> {
}
}

protected createRheaLink(
protected async createRheaLink(
options: ReceiverOptions,
_abortSignal?: AbortSignalLike
): Promise<Receiver> {
return this._context.connection.createReceiver(options);
const receiver = await this._context.connection.createReceiver(options);
receiver.setMaxListeners(1000);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't the same be applicable to event-hubs?

And if possible, applying this logic at core-amqp might be more beneficial?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point!

Connection lives in rhea-promise. I don't want to bump the limit there as other packages than EH and SB also depend on it. We could extend Connection in core-amqp.

return receiver;
}

/**
Expand Down
6 changes: 4 additions & 2 deletions sdk/servicebus/service-bus/src/session/messageSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,13 @@ export class MessageSession extends LinkEntity<Receiver> {
}
}

protected createRheaLink(
protected async createRheaLink(
options: ReceiverOptions,
_abortSignal?: AbortSignalLike
): Promise<Receiver> {
return this._context.connection.createReceiver(options);
const receiver = await this._context.connection.createReceiver(options);
receiver.setMaxListeners(1000);
return receiver;
}

/**
Expand Down