{"record":{"id":"0f507fdaa4cd2dec","repo":"apache/seatunnel","slug":"rabbitmq-04","errorCode":"RABBITMQ-04","errorMessage":"Cannot send RMQ message to queue %s at host %s","messagePattern":"Cannot send RMQ message to queue (.+?) at host (.+?)","errorType":"error_code","errorClass":"RabbitmqConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-rabbitmq/src/main/java/org/apache/seatunnel/connectors/seatunnel/rabbitmq/client/RabbitmqClient.java","lineNumber":172,"sourceCode":"     */\n    public void write(byte[] msg) {\n        try {\n            if (StringUtils.isEmpty(config.getRoutingKey())) {\n                channel.basicPublish(\"\", config.getQueueName(), null, msg);\n            } else {\n                // not support set returnListener\n                channel.basicPublish(\n                        config.getExchange(), config.getRoutingKey(), false, false, null, msg);\n            }\n        } catch (IOException e) {\n            if (config.isLogFailuresOnly()) {\n                log.error(\n                        \"Cannot send RMQ message to queue {} at host {}\",\n                        config.getQueueName(),\n                        config.getHost(),\n                        e);\n            } else {\n                throw new RabbitmqConnectorException(\n                        SEND_MESSAGE_FAILED,\n                        String.format(\n                                \"Cannot send RMQ message to queue %s at host %s\",\n                                config.getQueueName(), config.getHost()),\n                        e);\n            }\n        }\n    }\n\n    public void close() {\n        Exception t = null;\n        try {\n            if (channel != null && channel.isOpen()) {\n                channel.close();\n            }\n        } catch (IOException | TimeoutException e) {\n            t = e;\n        }","sourceCodeStart":154,"sourceCodeEnd":190,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-rabbitmq/src/main/java/org/apache/seatunnel/connectors/seatunnel/rabbitmq/client/RabbitmqClient.java#L154-L190","documentation":"RabbitmqClient.write throws RabbitmqConnectorException(SEND_MESSAGE_FAILED) when publishing a message to the RabbitMQ exchange/queue fails and retry mode is not enabled. The exception wraps the underlying IOException/TimeoutException from the RabbitMQ java client, naming the queue and host that could not receive the message.","triggerScenarios":"channel.basicPublish(...) in write() throws — broker unreachable, channel closed, publish confirm timeout, or queue unavailable. When retry mode is enabled the client only logs; otherwise it throws.","commonSituations":"RabbitMQ broker restarted or network partition during a sink job; wrong host/port or vhost credentials; message larger than broker max frame; the RMQ channel was closed earlier by an exception so subsequent publishes fail.","solutions":["Verify broker connectivity from the engine node (ping/telnet host 5672) and check RabbitMQ server logs for connection/channel errors","Confirm queue, virtualHost, username/password in the config are correct with rabbitmqctl list_queues","If retry is configured, keep it enabled so transient publish failures are retried instead of failing the job; otherwise consider network/heartbeat timeout tuning","Increase RabbitMQ max message/frame size if large payloads trigger channel closure"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// before starting the job\ntry (com.rabbitmq.client.Connection c = factory.newConnection()) {\n  System.out.println(\"RabbitMQ reachable: \" + c.isOpen());\n} catch (Exception e) {\n  throw new IllegalStateException(\"Cannot reach RabbitMQ broker\", e);\n}","typeGuard":null,"tryCatchPattern":"try {\n  client.write(row);\n} catch (RabbitmqConnectorException e) {\n  if (isSendMessageFailed(e)) {\n    log.warn(\"RMQ publish failed, will retry\", e);\n    // backoff and re-publish or rely on checkpoint restart\n  } else {\n    throw e;\n  }\n}","preventionTips":["Enable retry mode in the sink config for transient publish failures","Monitor broker health and network between engine and broker","Keep heartbeat/timeout values tuned for message size and latency"],"tags":["rabbitmq","network","publish","io"],"backgroundTag":"network-request-failed","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}