Skip to content

Eventhub consumer processor #3851

@ouertani

Description

@ouertani

Bug Title

EventProcessor for all partitions

Crate Name

azure_messaging_eventhubs

Crate Version

0.32

Description

As this example : https://github.com/Azure/azure-sdk-for-rust/blob/8e2bda39c0137b4ab87dcd354584f01aa9ed35e9/sdk/eventhubs/azure_messaging_eventhubs/examples/eventhubs_processor_client.rs#L84C5-L84C69 the next partition will not be changed and a loop should used like ```
let mut handles: Vec<_> = vec![];
for _ in 0..self.nb_partition_count {
let sink_processor = self.sink_processor.clone();
let event_processor = event_processor.clone();

        let handle = tokio::task::spawn_blocking(move || {
            // If process_event is sync or you need to block
            // Note: this runs on a blocking thread pool
            tokio::runtime::Handle::current().block_on(async {
                let partition_client = event_processor.next_partition_client().await?;
                debug!("partition id : {}", partition_client.get_partition_id());
                process_event(partition_client, sink_processor).await
            })
        });
        handles.push(handle);
    }
Is this correct?

### Steps to Reproduce

run this example https://github.com/Azure/azure-sdk-for-rust/blob/8e2bda39c0137b4ab87dcd354584f01aa9ed35e9/sdk/eventhubs/azure_messaging_eventhubs/examples/eventhubs_processor_client.rs and check if the processor loops on partitions

### Checklist

- [x] Follow our [Code of Conduct](https://github.com/Azure/azure-sdk-for-rust/blob/main/CODE_OF_CONDUCT.md)
- [x] Check that there isn't already an issue that request the same bug to avoid creating a duplicate.
- [x] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.

Metadata

Metadata

Assignees

Labels

Event Hubscustomer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-triageWorkflow: This issue needs the team to triage.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

Projects

Status

Assigned to Partner

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions