{"record":{"id":"b4ed59b6dc51fd99","repo":"aeron-io/aeron","slug":"egresslistener-must-be-specified-on-aeroncluster-context","errorCode":null,"errorMessage":"egressListener must be specified on AeronCluster.Context","messagePattern":"egressListener must be specified on AeronCluster\\.Context","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"aeron-cluster/src/main/java/io/aeron/cluster/client/AeronCluster.java","lineNumber":1537,"sourceCode":"                ownsAeronClient = true;\n            }\n\n            if (null == idleStrategy)\n            {\n                idleStrategy = new BackoffIdleStrategy(1, 10, 1000, 1000);\n            }\n\n            if (null == credentialsSupplier)\n            {\n                credentialsSupplier = new NullCredentialsSupplier();\n            }\n\n            if (null == egressListener)\n            {\n                egressListener =\n                    (clusterSessionId, timestamp, buffer, offset, length, header) ->\n                    {\n                        throw new ConfigurationException(\n                            \"egressListener must be specified on AeronCluster.Context\");\n                    };\n            }\n\n            if (null == controlledEgressListener)\n            {\n                controlledEgressListener =\n                    (clusterSessionId, timestamp, buffer, offset, length, header) ->\n                    {\n                        throw new ConfigurationException(\n                            \"controlledEgressListener must be specified on AeronCluster.Context\");\n                    };\n            }\n        }\n\n        /**\n         * Has the context had the {@link #conclude()} method called.\n         *","sourceCodeStart":1519,"sourceCodeEnd":1555,"githubUrl":"https://github.com/aeron-io/aeron/blob/6d60124e15e35c11b49ba2e3c2c2858a09a18803/aeron-cluster/src/main/java/io/aeron/cluster/client/AeronCluster.java#L1519-L1555","documentation":"Context.conclude() installs a placeholder egressListener that throws ConfigurationException('egressListener must be specified on AeronCluster.Context') when no real listener was provided. Egress events would otherwise be silently dropped, so the library fails instead of losing messages.","triggerScenarios":"Connecting an AeronCluster without calling ctx.egressListener(...) and without providing a controlledEgressListener default, then receiving an egress event that invokes the placeholder.","commonSituations":"Client code expecting only pollEgress via the controlled listener; forgetting the plain listener when both subscription modes are relevant; copy-paste of a Context from a project that sets listeners elsewhere.","solutions":["Set ctx.egressListener((clusterSessionId, timestamp, buffer, offset, length, header) -> ...) before connect()","Or set a controlledEgressListener so conclude() does not install the throwing default for the plain listener path","If you intentionally ignore responses, supply a no-op listener rather than leaving it null"],"exampleFix":"// before\nnew AeronCluster.Context().ingressChannel(...).egressChannel(...); // no listener\n// after\nnew AeronCluster.Context()\n    .ingressChannel(...)\n    .egressChannel(...)\n    .egressListener((clusterSessionId, timestamp, buffer, offset, length, header) ->\n        handleEgress(buffer, offset, length));","handlingStrategy":"validation","validationCode":"if (ctx.egressListener() == null && ctx.controlledEgressListener() == null) {\n    throw new IllegalArgumentException(\"provide egressListener or controlledEgressListener before connect()\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always register at least one egress listener in your client bootstrap","Use a no-op listener when responses are intentionally ignored rather than leaving null"],"tags":["configuration","callback","cluster-client"],"backgroundTag":"missing-required-config-field","analyzedSha":"6d60124e15e35c11b49ba2e3c2c2858a09a18803","analyzedAt":"2026-09-12T11:17:07.683Z","contentChangedAt":"2026-09-12T11:17:07.683Z","schemaVersion":2},"datasetVersion":"2026-09-19T12:17:13.211Z"}