{"record":{"id":"c2ed5f795617542f","repo":"apache/seatunnel","slug":"rabbitmq-02","errorCode":"RABBITMQ-02","errorMessage":"Error while creating RMQ client with queue %s at %s","messagePattern":"Error while creating RMQ client with queue (.+?) at (.+?)","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":72,"sourceCode":"    /**\n     * Constructor for RabbitmqClient.\n     *\n     * @param config RabbitMQ configuration\n     */\n    public RabbitmqClient(RabbitmqConfig config) {\n        this.config = config;\n        try {\n            this.connectionFactory = createConnectionFactory();\n            this.connection = connectionFactory.newConnection();\n            this.channel = connection.createChannel();\n\n            // set channel prefetch count\n            if (config.getPrefetchCount() != null) {\n                channel.basicQos(config.getPrefetchCount(), true);\n            }\n\n        } catch (Exception e) {\n            throw new RabbitmqConnectorException(\n                    CREATE_RABBITMQ_CLIENT_FAILED,\n                    String.format(\n                            \"Error while creating RMQ client with queue %s at %s\",\n                            config.getQueueName(), config.getHost()),\n                    e);\n        }\n    }\n\n    /**\n     * Get the current RabbitMQ channel.\n     *\n     * @return RabbitMQ channel\n     */\n    public Channel getChannel() {\n        return channel;\n    }\n\n    /**","sourceCodeStart":54,"sourceCodeEnd":90,"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#L54-L90","documentation":"The RabbitmqClient constructor performs the full client setup: opening a connection, creating the channel, declaring the queue, and applying prefetch (basicQos). Any Exception during this sequence is wrapped in RabbitmqConnectorException with CREATE_RABBITMQ_CLIENT_FAILED and a formatted message naming the queue and host, so the user can tell which broker target failed. The root cause (ConnectException, IOException, timeout, auth failure) is in the cause chain.","triggerScenarios":"new RabbitmqClient(...) where connection to host fails, queue declaration fails (e.g. PRECONDITION_FAILED due to mismatched queue arguments), basicQos fails, or authentication is rejected.","commonSituations":"Wrong host/port or broker down; wrong virtual host; queue already exists with different durable/arguments causing declaration failure; wrong username/password; firewall or DNS issues from worker nodes; TLS configuration problems.","solutions":["Read the wrapped cause for the concrete failure (connection refused, auth failure, queue declaration mismatch)","Verify host, port, virtualHost, username, password and queueName in the source/sink config","Ensure the queue exists with the exact same properties (durable, exclusive, auto-delete, arguments) the connector declares, or delete/recreate it consistently","Test broker reachability from the worker node: ping/telnet host 5672 (or 5671 for TLS)","Check RabbitMQ server logs at the time of the attempt for the channel/connection error"],"exampleFix":"// before\n# config with mismatched queue args\nqueue_name=my_queue\n# queue exists as non-durable but connector declares durable -> declaration fails\n// after\n# delete the conflicting queue or align its properties with the connector config\nrabbitmqctl delete_queue my_queue\n# then rerun; or declare durable=true when creating the queue externally","handlingStrategy":"validation","validationCode":"// pre-flight connectivity and queue check\ntry (com.rabbitmq.client.Connection c = factory.newConnection()) {\n    try (Channel ch = c.createChannel()) {\n        ch.queueDeclarePassive(config.getQueueName()); // throws if queue missing/mismatched\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    new RabbitmqClient(config, ...);\n} catch (RabbitmqConnectorException e) {\n    if (e.getErrorCode() == RabbitmqConnectorErrorCode.CREATE_RABBITMQ_CLIENT_FAILED) {\n        LOG.error(\"RMQ client creation failed for queue={} host={}: {}\",\n            config.getQueueName(), config.getHost(), e.getCause());\n    } else throw e;\n}","preventionTips":["Validate host, port, virtualHost, credentials and queueName in config before submitting","Ensure externally created queues match the connector's declared properties (durable, arguments)","Test broker reachability from worker nodes (telnet host 5672/5671)","Check RabbitMQ server logs for channel/declaration errors during failures"],"tags":["rabbitmq","amqp","connection","configuration"],"backgroundTag":"connection-refused","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}