Pubsub message size limit issue

Nayan Das 71 Reputation points
2021-07-26T10:41:20.067+00:00

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
Azure Web PubSub
An Azure service that provides real-time messaging for web applications using WebSockets and the publish-subscribe pattern.
59 questions
{count} votes

Accepted answer
  1. Grmacjon-MSFT 15,851 Reputation points
    2021-07-27T05:48:34.087+00:00

    Hi @Nayan Das ,

    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


0 additional answers

Sort by: Most helpful