Azure / Azure/azure-functions-java-worker

ServiceBus support with partition and duplicate detection

Open
#337 1 comment 0 reactions 0 assignees View on GitHub
area:java-functions New Feature
Dominant language
Java
Stars
103
Forks
74
Avg merge
4d 8h
Merged PRs (30d)
2

Description

We try to send messages to ServiceBus using functions binding. Bellow Code worked without partitions. But we are facing issues with partition and duplicate detection.

@ServiceBusQueueOutput
@ServiceBusTopicOutput

Sample code to reproduce this issue

```
@FunctionName("QueueTrigger")
public void run(
@ServiceBusQueueTrigger(name = "inMessage", queueName = "%sbInputQueue%", connection = "sbconnection") Message inMessage,
@ServiceBusTopicOutput(name = "topicMessage", topicName = "fx-demo-topic", subscriptionName = "fx-demo-subscription", connection = "sbconnection") OutputBinding topicMessage,
final ExecutionContext context) {

context.getLogger().info("Queue Msg Received " + inMessage.toString());

topicMessage.setValue(inMessage);

context.getLogger().info("Java Service Bus Listing Queue trigger executed.");
}
}
```
Error message :

System.Private.CoreLib: Exception while executing function: Functions.QueueTrigger. Microsoft.Azure.ServiceBus: Message to a partitioned entity with duplicate detection enabled must have either PartitionKey or MessageId

Contributor guide

Open the contributing guide

Research direction

Start with the @ServiceBusTopicOutput binding in the reproduced QueueTrigger function and the reported Service Bus exception. Trace how the Java worker creates the outgoing Message for partitioned entities with duplicate detection enabled. Done means the supplied reproduction no longer fails while retaining the expected partition and duplicate-detection behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, java
Domain
backend, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.