question

NayanDas-0964 avatar image
0 Votes"
NayanDas-0964 asked Grmacjon-MSFT commented

Pubsub message size limit issue

When we are trying to send a large pubsub json message to a group, the pubsub rest api is throwing 500 Internal Error. We are using azure messaging python sdk to send message to a pubsub group. We checked the request content length of the api call and found it to be 6903 Bytes. Below is the code for the same:

 response = pubsub_service_client.send_request(
             build_send_to_group_request(
                 settings.AZURE_PUBSUB_HUB_NAME,
                 group,
                 json=data,
             )
         )
 print(response)
 print(response.request.headers)

The output of above code for large data variable is :

 <HttpResponse: 500 Internal Server Error, Content-Type: plain/text>
 {'Content-Length': '6903', 'Content-Type': 'application/json', 'User-Agent': 'azsdk-python-messaging-webpubsubservice/1.0.0b1 Python/3.7.3 (Darwin-19.5.0-x86_64-i386-64bit)', 'Authorization': 'Bearer <Redacted access token>'}


We want to know the size limit of the pubsub message, if any, which can be published to a group or directly sent to a user.



azure-web-pubsub
· 1
5 |1600 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.

Hi @NayanDas-0964,

Thanks for bring this to our attention. We are checking internally with the engineering team to see if there is size limit for sending messages via Azure PubSub and will update this thread when we hear back from them.

Best
Grace

0 Votes 0 ·

1 Answer

Grmacjon-MSFT avatar image
0 Votes"
Grmacjon-MSFT answered Grmacjon-MSFT commented

Hi @NayanDas-0964,

Based on the response from the engineering team, Azure PubSub has a temporarily 4K message size limit as of right now. However, the limit will be increased to 1M in the next regular release (coming up in the near future) so that you can send larger payloads.

Hope that helps.

Thanks,
Grace

· 4
5 |1600 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.

Thanks for the info. But the size limit should be specified in the docs and the pubsub rest api should return 400 with some error message instead of 500.

Also, can we know when the message size be increased to 1M? Because 4Kb is too low for the use case we have.

0 Votes 0 ·

Hi @NayanDas-0964,

Thank you for your valuable feedback. I have shared your feedback with the engineering team. The Azure web-pubsub docs will be updated once the limit size has been updated. The estimated timeline for the increase in message size limit is about a month time frame.

Best,
Grace

0 Votes 0 ·

@Grmacjon-MSFT Is the message size limit increased to 1MB now?

0 Votes 0 ·

Yes, the size limit has been increased @Rajshekar-6579

0 Votes 0 ·