Azure / Azure/azure-sdk-for-java

[FEATURE REQ] Allow configuration of Reactive Scheduler on SDK or Client level

Open
#48,827 1 comment 0 reactions 2 assignees Claimed by @alzimmermsft View on GitHub
common customer-reported feature-request needs-team-attention
Dominant language
Java
Stars
2.6k
Forks
2.2k
Avg merge
2d 8h
Merged PRs (30d)
178

Description

**Is your feature request related to a problem? Please describe.**

My application has a dedicated thread pool for IO operations that I want to use for azure-sdk async clients (namely eventhubs and blob storage ones) as a `Scheduler` instead of `Schedulers.boundedElastic()` but I couldn't find any way to set it across the sdk, or client specific. EventHubClientBuilder has a `EventHubClientBuilder scheduler(Scheduler scheduler)` method but it's not `public`. `BlobServiceClientBuilder` doesn't have such method.

**Describe the solution you'd like**
Some way to configure Scheduler for all SDK or client basis. Such as

```
EventHubClientBuilder()
.connectionString(...)
.scheduler(customScheduler) // method exist but package private
.buildAsyncProducerClient()

BlobServiceClientBuilder()
.scheduler(customScheduler) // method doesn't exist
.buildAsyncClient()
```

**Describe alternatives you've considered**
I'm currently using `Mono publishOn(Scheduler scheduler)` method but it's kind of error prone. Also I'm not sure that's enough to avoid creation of the `Schedulers.boundedElastic()` pool for consumer clients. Here's how my code looks now:

```
eventHubProducerClient.send(data, sendOptions)
.publishOn(customScheduler)
.subscribe(...)
```

**Additional context**
N/A

**Information Checklist**
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report
- [X] Description Added
- [X] Expected solution specified

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.