Azure / azure-sdk-for-java

This repository is for active development of the Azure SDK for Java. For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/java/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-java.
MIT License
2.35k stars 1.98k forks source link

[BUG] Building an EventHubClient throws IllegalArgumentException #11326

Closed jayr-davis closed 4 years ago

jayr-davis commented 4 years ago

I am a developer writing code (actually) to support Microsoft of India. (name drop!!)

I am using EventHubClientBuilder to build a ProducerClient.

Here is the stack trace:

2020-05-20 00:18:04,683 DEBUG [main] r.u.Loggers$LoggerFactory(debug:249) - Using Slf4j logging framework 2020-05-20 00:18:04,834 DEBUG [main] r.c.p.Operators(debug:259) - Negative request java.lang.IllegalArgumentException: Spec. Rule 3.9 - Cannot request a non strictly positive number: 0 at reactor.core.Exceptions.nullOrNegativeRequestException(Exceptions.java:318) ~[reactor-core-3.3.0.RELEASE.jar:3.3.0.RELEASE] at reactor.core.publisher.Operators.reportBadRequest(Operators.java:905) [reactor-core-3.3.0.RELEASE.jar:3.3.0.RELEASE] at reactor.core.publisher.Operators.validate(Operators.java:1103) [reactor-core-3.3.0.RELEASE.jar:3.3.0.RELEASE] at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.request(Operators.java:1899) [reactor-core-3.3.0.RELEASE.jar:3.3.0.RELEASE] at com.azure.core.amqp.implementation.AmqpChannelProcessor.onSubscribe(AmqpChannelProcessor.java:64) [azure-core-amqp-1.0.1.jar:?] at reactor.core.publisher.MonoRepeatPredicate.subscribeOrReturn(MonoRepeatPredicate.java:44) [reactor-core-3.3.0.RELEASE.jar:3.3.0.RELEASE] at reactor.core.publisher.Flux.subscribe(Flux.java:8120) [reactor-core-3.3.0.RELEASE.jar:3.3.0.RELEASE] at reactor.core.publisher.Flux.subscribeWith(Flux.java:8298) [reactor-core-3.3.0.RELEASE.jar:3.3.0.RELEASE] at com.azure.messaging.eventhubs.EventHubClientBuilder.buildConnectionProcessor(EventHubClientBuilder.java:532) [azure-messaging-eventhubs-5.0.2.jar:?] at com.azure.messaging.eventhubs.EventHubClientBuilder.buildAsyncClient(EventHubClientBuilder.java:475) [azure-messaging-eventhubs-5.0.2.jar:?] at com.azure.messaging.eventhubs.EventHubClientBuilder.buildClient(EventHubClientBuilder.java:508) [azure-messaging-eventhubs-5.0.2.jar:?] at com.azure.messaging.eventhubs.EventHubClientBuilder.buildProducerClient(EventHubClientBuilder.java:430) [azure-messaging-eventhubs-5.0.2.jar:?] at com.davisnet.weatherlink.farmbeatsprocessor.services.EventHubService.attemptConnectWithDelaysAndRetries(EventHubService.java:248) [classes/:?]

Here is my code (from the bottom of that stack):

Line 248: c = new EventHubClientBuilder().connectionString(locConnStr).buildProducerClient(); The value of locConnStr (with some judicious XXXing) is: Endpoint=sb://sensor-partner-eh-namespace-3XXXX.servicebus.windows.net/;SharedAccessKeyName=43XXXXXX-24a0-XXXX-bde1-82beac35XXXX;SharedAccessKey=XXXXw8MWtXXXXFRbAUqmw1XXXXCp2rWXXXXSySACzJM=;EntityPath=sensor-partner-eh-00

Debugging through, the core problem seems (to me) to be at com.azure.core.amqp.implementation.AmqpChannelProcessor.onSubscribe(AmqpChannelProcessor.java:64) Line 64: subscription.request(0)

and that zero fails validation as violating Reactor Rule 3.9 because it is not strictly positive.

I would be ECSTATIC to supply any other possible info.

Thank you. Setup:

(However, this all ALSO seems be happening on to happening on some OTHER cloud's infrastructure (cough, Bezos, cough).

srnagar commented 4 years ago

@jayr-davis Thanks for reporting the issue. This has been fixed in PR 9242. Please use the latest version of Event Hub libraries:

PS: The exception stack trace you are seeing is just a debug level log and should not impact any functionality.