question

xyz92-1534 avatar image
0 Votes"
xyz92-1534 asked ·

Issue with DuplicateDetectionHistoryTimeWindow when trying to send message to service bus topic

I have a C# code to send a message to the service bus topic as follows:

public class ServiceBusTopicsRepository : IServiceBusTopicsRepository
{
    private TopicClient _topicClient;

    public ServiceBusTopicsRepository(string connectionString, string entityPath)
    {
        _topicClient = new TopicClient(connectionString, entityPath);
    }

    public async Task AddMessageAsync(SyncJob job)
    {
        await _topicClient.SendAsync(CreateMessage(job));
    }

    private Message CreateMessage(SyncJob job)
    {
        var body = JsonSerializer.Serialize(job);
        var message = new Message
        {
            Body = Encoding.UTF8.GetBytes(body)
        };

        message.MessageId ="PK_RK";
        return message;
    }
}


On running the code, I see message is not being added to the topic.

MessageId is "PK_RK". DuplicateDetectionHistoryTimeWindow is 1 min

image

When I try to send message after 2 minutes, I see newly sent message is instantly ignored and dropped. Why is that?

azure-service-bus
· 1
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Working with @xyz92-1534 offline and will update this thread

0 Votes 0 ·

1 Answer

MayankBargali-MSFT avatar image
0 Votes"
MayankBargali-MSFT answered ·

The issue is not reproduced with the official service bus SDKs. The scenario is working as expected. If anyone is facing the issue please tag me in so I can look into the source code, configuration, and if there is any issue with the backend.

·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.