farmer icon indicating copy to clipboard operation
farmer copied to clipboard

Add support for setting service bus max message size

Open MartinWa opened this issue 2 years ago • 1 comments

The changes in this PR are as follows:

  • For a Service Bus Topic it adds the max_message_size property. This allows configuring the large messages feature in premium subscriptions.
  • Updated Microsoft.Azure.Management.ServiceBus to version 5.0.0 to support this setting

I have read the contributing guidelines and have completed the following:

  • [ ] Tested my code end-to-end against a live Azure subscription.
  • [x] Updated the documentation in the docs folder for the affected changes.
  • [x] Written unit tests against the modified code that I have made.
  • [x] Updated the release notes with a new entry for this PR.
  • [x] Checked the coding standards outlined in the contributions guide and ensured my code adheres to them.

If I haven't completed any of the tasks above, I include the reasons why here:

  • I do not currently have access to Azure to test this but I have done so in the past.

Below is a minimal example configuration that includes the new features, which can be used to deploy to Azure:

let myServiceBus = serviceBus {
    name "my-namespace"
    sku (Premium OneUnit)
    add_topics [
        topic {
            name "topicA"
            max_message_size 1024<Kb>
        }
    ]
}

MartinWa avatar Apr 22 '24 19:04 MartinWa

@MartinWa We'll schedule some time in to test this end-to-end and then merge in - looks good in principle. Thank you :-)

isaacabraham avatar May 03 '24 12:05 isaacabraham

I tested this out on codespaces and did a deployment. With the Premium SKU it's fine, but it has this obscure error on Standard:

SubCode=40000. Bad Request. To know more visit https://aka.ms/sbResourceMgrExceptions. . TrackingId:aa804be5-4469-41dd-9547-216f926e1e16_G3, SystemTracker:my-namespace-1234.servicebus.windows.net:topicA, Timestamp:2024-06-08T15:01:59 (Code: MessagingGatewayBadRequest)

It does say in the documentation, but it's unfortunate the preflight validation doesn't give an error.

This property is only used in Premium today and default is 1024.

It would be helpful to raise an error on the Farmer side if trying to use this property on Basic or Standard. We don't do this for topics today either even though they wouldn't work on Basic, so I opened #1110 to address these scenarios for service bus validation.

ninjarobot avatar Jun 08 '24 15:06 ninjarobot

@isaacabraham I tested this today and it works as designed.

image

ninjarobot avatar Jun 08 '24 15:06 ninjarobot