Skip to content
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

ServiceBusSender ScheduleMessageAsync() returns timeout on exceeded message size #41869

Closed
erik-neumann opened this issue Feb 9, 2024 · 1 comment
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-triage Workflow: This issue needs the team to triage. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Bus

Comments

@erik-neumann
Copy link

Library name and version

Azure.Messaging.ServiceBus 7.17.2

Describe the bug

We're enountering a different behavior when trying to send or schedule a message that exceeds the maximum size.

When sending the message, immediatly (or at least very quickly) a ServiceBusException is thrown: "The message (id:xyz, size:262152 bytes) is larger than is currently allowed (262144 bytes). (MessageSizeExceeded)."

When trying to schedule the message, a ServiceBusException is thrown after 10 secs: "The operation was canceled. (ServiceTimeout)". This is per default, in our production environment this timeout is reached very late because of retry configuration.

Expected behavior

Same behavior when sending or scheduling a message that exceeds allowed size, returning a ServiceBusException (MessageSizeExceeded) immediatly.

Actual behavior

ScheduleMessage returns timeout after 10 secs.

Reproduction Steps

[TestClass]
public class UnitTest1
{
    private readonly ServiceBusSender _sender;

    public UnitTest1()
    {
        var client =
            new ServiceBusClient("connectionString");
        _sender = client.CreateSender("messagesize-test");
    }

    [TestMethod]
    public async Task SendMessage()
    {
        var message = CreateMessage(262144);
        // This fails immediatly
        await _sender.SendMessageAsync(message);
    }

    [TestMethod]
    public async Task ScheduleMessage()
    {
        var message = CreateMessage(262144);
        // This fails after timeout
        await _sender.ScheduleMessageAsync(message, DateTimeOffset.Now.AddMinutes(1));
    }

    private static ServiceBusMessage CreateMessage(int size)
    {
        var payload = Encoding.ASCII.GetBytes(string.Concat(Enumerable.Repeat("0", size)));
        return new ServiceBusMessage(payload);
    }
}`

### Environment

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  14.1
 OS Platform: Darwin
 RID:         osx-arm64
 Base Path:   /usr/local/share/dotnet/sdk/8.0.101/
@github-actions github-actions bot added Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-triage Workflow: This issue needs the team to triage. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Bus labels Feb 9, 2024
@jsquire jsquire self-assigned this Feb 9, 2024
@jsquire
Copy link
Member

jsquire commented Feb 9, 2024

Hi @erik-neumann. Thank you for reaching out and we regret that you're experiencing difficulties. The root cause of this appears to be that the Service Bus service does not reject the message and return the proper response to indicate to the client that the message size was exceeded. Unfortunately, that's not something that we can fix in the SDK package and will require service changes.

I've transferred this to the repository where Service Bus service issues are tracked as #697. You may also wish to consider opening an Azure support request, which may help expedite the process.

@jsquire jsquire closed this as completed Feb 9, 2024
@github-actions github-actions bot locked and limited conversation to collaborators May 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-triage Workflow: This issue needs the team to triage. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Bus
Projects
None yet
Development

No branches or pull requests

2 participants