Azure / Azure/azure-functions-java-library
Unable to access PartitionContext or get PartitionId when using EventHubTrigger
- Dominant language
- Java
- Stars
- 45
- Forks
- 49
- PR merge metrics
- No merged PRs in 30d
Description
While using EventHubTrigger, unable to access PartitionContext. Also I am not finding any other way to access the partition Id.
Please find below the code. On trying to get PartitionContext using @BindingName, partitionContext object is null.
```
@FunctionName("EhbExample")
@StorageAccount("AzureWebJobsStorage")
public void run(
@EventHubTrigger(name = "msg", cardinality = Cardinality.MANY, eventHubName = "%SourceEHName%", connection = "SourceEHConnString", consumerGroup = "%SourceEHConsumerGrp%") List eventData,
final ExecutionContext context, @BindingName("SystemPropertiesArray") SystemProperty[] systemProperties,
@BindingName("PartitionContext") PartitionContext partitionContext ) {
Logger log = context.getLogger();
log.info("Triggered Function App");
log.info("Partition Id: " + partitionContext.getPartitionId());
for (int i=0;i
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.