The example is currently using the 1st method which is @Deprecated. Looks like it should be switched over to the 2nd method? 🤔 What's an ExecutorService though?
@Deprecated
@Override
public void registerMessageHandler(IMessageHandler handler, MessageHandlerOptions handlerOptions) throws InterruptedException, ServiceBusException {
this.messageAndSessionPump.registerMessageHandler(handler, handlerOptions);
}
@Override
public void registerMessageHandler(IMessageHandler handler, MessageHandlerOptions handlerOptions, ExecutorService executorService) throws InterruptedException, ServiceBusException {
this.messageAndSessionPump.registerMessageHandler(handler, handlerOptions, executorService);
}
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
@spottedmahn Thank you for your feedback! We will review and update as appropriate.
@spottedmahn This doesn't appear to be the case per: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/servicebus/microsoft-azure-servicebus/src/main/java/com/microsoft/azure/servicebus/MessageHandlerOptions.java
We will now proceed to close this thread for now. If there are further questions regarding this matter, please reopen it and we will gladly continue the discussion.
registerMessageHandler isn't in the source file you referenced, 🤔
I believe this is the correct source code, SubscriptionClient.registerMessageHandler, referenced in the sample.

Hi @mike-urnun-msft - can you re-review and re-open this? thanks! 🙏
registerMessageHandlerisn't in the source file you referenced, 🤔
@spottedmahn checking... will update you shortly ;)
Hi team,
How is the state of this issue, any update?
Could you also update the example as well: https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-java-how-to-use-topics-subscriptions#how-to-receive-messages-from-a-subscription
Thanks.
@spottedmahn @kensonwu1 The ExecutorService class used here is the java.util.concurrent.ExecutorService class used for asynchronous concurrent execution.
I believe the intent of the new methods is to expose this as a parameter for customization but you could simply pass ForkJoinPool.commonPool() used in the deprecated method to care of the lint error or use another built-in executor.
For example, if you would want to ensure messages are processing sequentially, you could use Executers.newSingleThreadExecuter.
Hope that information helps, and we are assigning this issue to include samples for the same in the docs.
thanks for reviewing @PramodValavala-MSFT 👍
Updated the code.