Async Email Client Creation Doesn't Work

Aditi 20 Reputation points
2025-02-17T06:27:42.06+00:00

SS of azure doc

We are using Azure Email Communication Service, (azure-communication-email, version - 1.0.17).

As per the documentation for instantiating async email Client, the sample code is the same as that of Sync email Client creation.

In addition to that, if we use the mentioned code of the Async client and combine it with the PollerFlux logic mentioned in the same documentation, it gives an error, (as it treats the mail client as Sync).

Referred Documentation - Link

Can you please provide the correct syntax for instantiating the async email client?

In the same context, earlier we were using the below code for instantiating the async email client and it used to work before-

EmailAsyncClient emailClient = new EmailClientBuilder() .endpoint(endpoint) .credential(azureKeyCredential) .buildAsyncClient();

But now we have started getting this error - {"msg":"A request was made to load the default HttpClient provider but one could not be found on the classpath. If you are using a dependency manager, consider including a dependency on azure-core-http-netty or azure-core-http-okhttp. Depending on your existing dependencies, you have the choice of Netty or OkHttp implementations. Additionally, refer to https://aka.ms/azsdk/java/docs/custom-httpclient to learn about writing your own implementation.","level":"ERROR","logger":"com.azure.core.implementation.util.Providers"}

Can you guide us on how can we fix the existing logic?

Azure Communication Services
Azure Communication Services
An Azure communication platform for deploying applications across devices and platforms.
1,012 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Aditi 20 Reputation points
    2025-02-17T06:31:29.0266667+00:00

    Hi @VenkateshDodda-MSFT - Your support was really helpful in our earlier queries. Please help us with this as well.

    0 comments No comments

  2. Aditi 20 Reputation points
    2025-02-17T06:34:23.61+00:00

    Referred Document Link - Link

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.