{"record":{"id":"ca16172835b7c9a9","repo":"apache/seatunnel","slug":"message-too-large","errorCode":"MESSAGE_TOO_LARGE","errorMessage":"Serialized message is ${encodedSize} bytes after ${messageEncoding} encoding, exceeding the Azure Queue limit of ${MAX_ENCODED_MESSAGE_BYTES} bytes","messagePattern":"Serialized message is (.+?) bytes after (.+?) encoding, exceeding the Azure Queue limit of (.+?) bytes","errorType":"error_code","errorClass":"AzureQueueConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-azure-queue-storage/src/main/java/org/apache/seatunnel/connectors/seatunnel/azure/queue/sink/AzureQueueStorageSinkWriter.java","lineNumber":174,"sourceCode":"                                \"Failed to close Azure Queue Storage sender\",\n                                e);\n            } else {\n                failure.addSuppressed(e);\n            }\n        }\n\n        if (failure != null) {\n            throw failure;\n        }\n    }\n\n    private void validateMessageSize(int payloadSize) {\n        long encodedSize = payloadSize;\n        if (messageEncoding == MessageEncoding.BASE64) {\n            encodedSize = 4L * ((payloadSize + 2L) / 3L);\n        }\n        if (encodedSize > MAX_ENCODED_MESSAGE_BYTES) {\n            throw new AzureQueueConnectorException(\n                    AzureQueueConnectorErrorCode.MESSAGE_TOO_LARGE,\n                    \"Serialized message is \"\n                            + encodedSize\n                            + \" bytes after \"\n                            + messageEncoding.name().toLowerCase(Locale.ROOT)\n                            + \" encoding, exceeding the Azure Queue limit of \"\n                            + MAX_ENCODED_MESSAGE_BYTES\n                            + \" bytes\");\n        }\n    }\n\n    private void checkSendError() {\n        Throwable failure = sendError.get();\n        if (failure != null) {\n            throw writeFailure(failure);\n        }\n    }\n","sourceCodeStart":156,"sourceCodeEnd":192,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-azure-queue-storage/src/main/java/org/apache/seatunnel/connectors/seatunnel/azure/queue/sink/AzureQueueStorageSinkWriter.java#L156-L192","documentation":"validateMessageSize() computes the encoded size of a serialized message (Base64 inflates by ~4/3) and throws AzureQueueConnectorException(MESSAGE_TOO_LARGE) when it exceeds MAX_ENCODED_MESSAGE_BYTES — Azure Queue Storage's 64KB message limit. Called from write() before sending, so oversized messages fail the write rather than the Azure API call.","triggerScenarios":"write() produces a payload whose raw size, or Base64-encoded size (4 * ceil(payloadSize/3)), exceeds the Azure Queue message limit.","commonSituations":"Large rows/JSON documents from the upstream source, enabling BASE64 message encoding which adds ~33% overhead, or wide tables with big blob columns.","solutions":["Reduce record size upstream (truncate/split/aggregate large fields)","Switch message_encoding from BASE64 to NONE if possible to avoid 33% overhead","Pre-filter oversized records before the sink with a transform","Compress payload if the consumer supports it"],"exampleFix":"// before\nmessage_encoding = BASE64  // 48KB payload -> 64KB+ encoded\n// after\nmessage_encoding = NONE    // or reduce payload size","handlingStrategy":"validation","validationCode":"int encoded = encoding == MessageEncoding.BASE64\n    ? 4 * ((payload.length + 2) / 3)\n    : payload.length;\nif (encoded > 65536) throw new IllegalArgumentException(\"message exceeds Azure 64KB limit\");","typeGuard":null,"tryCatchPattern":"try {\n    writer.write(record);\n} catch (AzureQueueConnectorException e) {\n    if (e.getErrorCode() == AzureQueueConnectorErrorCode.MESSAGE_TOO_LARGE) {\n        // route to dead-letter / split the record\n    }\n}","preventionTips":["Bound record size upstream with transforms","Account for Base64's 4/3 overhead when encoding is enabled","Alert on large source rows feeding this sink"],"tags":["azure","message-size","limit","payload"],"backgroundTag":"payload-too-large","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}