-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Reactor exception thrown from event hub producer client #12500
Comments
The problem appears to originate in Additional Reactor components are used in the
Workaround The workaround that we are using for now is to process events individually (accepting |
@davegarred Thanks for reporting the issue. I tried reproducing this issue using the codesnippet below and I was able to send the events successfully. Can you please take a look and let us know if there is anything that you are doing differently and share a reproducible sample with us? public static void main(String[] args) {
String eventHubConnectionString = "REDACTED";
EventHubProducerClient eventHubProducerClient = new EventHubClientBuilder()
.connectionString(eventHubConnectionString)
.buildProducerClient();
EventProcessorClient processor = new EventProcessorClientBuilder()
.connectionString(eventHubConnectionString)
.consumerGroup(EventHubClientBuilder.DEFAULT_CONSUMER_GROUP_NAME)
.checkpointStore(new SampleCheckpointStore())
.retry(new AmqpRetryOptions().setMaxRetries(0))
.processEventBatch(eventBatchContext -> onEventBatch(eventBatchContext, eventHubProducerClient), 100)
.processError(context -> {
System.out.println("Error occurred on partition: " +
context.getPartitionContext().getPartitionId());
})
.processPartitionInitialization(initializationContext -> {
System.out.println("Started receiving on partition: " +
initializationContext.getPartitionContext().getPartitionId());
})
.processPartitionClose(closeContext -> {
System.out.println("Stopped receiving on partition: " +
closeContext.getPartitionContext().getPartitionId());
})
.buildEventProcessorClient();
processor.start();
System.out.println("Processor started");
}
private static void onEventBatch(EventBatchContext eventBatchContext,
EventHubProducerClient eventHubProducerClient) {
String partitionId = eventBatchContext.getPartitionContext().getPartitionId();
int batchSize = eventBatchContext.getEvents().size();
System.out.println("Received an event batch of size " + batchSize + " on partition " + partitionId);
eventBatchContext.updateCheckpoint();
eventHubProducerClient.send(Arrays.asList(new EventData("Event batch received " + batchSize)));
System.out.println("Successfully sent message from partition " + partitionId);
} Output:
|
Hi @srnagar ,
T
My dependencies:
I would encourage you to drop a break point in your consuming function, you should be able to verify that the thread provided to you is of type Thanks, |
@davegarred I have a PR to fix this issue here - #12822 |
Thanks for the help! |
Dev kubernetesconfiguration microsoft.kubernetes configuration stable 2021 03 01 (#12500) * Adds base for updating Microsoft.KubernetesConfiguration from version preview/2020-10-01-preview to version 2021-03-01 * Updates readme * Updates API version in new specs and examples * Fixed review comment * Fixed reference path error * Fixed casing error in enum
Related PR #43063 |
Describe the bug
I'm getting an IllegalStateException thrown by a reactor component when trying to send a message using
EventHubProducerClient
in the eventhubs Java SDK.Exception or Stack Trace
To Reproduce
EventData
usingEventHubProducerClient.send
within the same thread.Code Snippet
Expected behavior
The message should be published or a valid exception should be thrown.
Screenshots
n/a
Setup (please complete the following information):
com.azure:azure-messaging-eventhubs:5.1.1
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
The text was updated successfully, but these errors were encountered: