We are working over the mqtt sample using TLS, connecting to Mosquitto's test server. Everything is working fine while sending short strings, but now we are trying to send ~10-12kB. For that, we have switched the CONFIG_MQTT_MESSAGE_BUFFER_SIZE parameter to 16384 (also tried with bigger values). However, when sending this, we get automatically disconnected, getting the event MQTT_EVT_DISCONNECT in the callback function. We are using the data_publish() function given in the sample.
The error code is 36, which is the message size, so at the beginning we thought that simply the message was too big and this could not be done. However, the maximum size should admit up to 256MB and, even if the broker had limited it to an smaller value, the message should just be dropped, without the disconnection part. Moreover, we have tested it using the terminal, and we are able to send messages up to +8k characters (that's the limit the Windows cmd supports, will try later with Linux).
The message is sent only once, and we are waiting between tests, so we should not be using too many resources of their network. Are we missing something, or we are just overthinking and it is just that we cannot send so big messages?