{"record":{"id":"fe129934bd397407","repo":"nautechsystems/nautilus_trader","slug":"external-message-bus-factory-cannot-be-combined-wi","errorCode":null,"errorMessage":"external message bus factory cannot be combined with injected egress or ingress","messagePattern":"external message bus factory cannot be combined with injected egress or ingress","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/live/src/node/builder.rs","lineNumber":576,"sourceCode":"        log::info!(\n            \"Building LiveNode with {} data clients and {} execution clients\",\n            self.data_client_factories.len(),\n            self.exec_client_factories.len()\n        );\n\n        self.config.validate_runtime_support()?;\n\n        if self.config.event_store.is_some() && self.event_store_factory.is_none() {\n            anyhow::bail!(\n                \"LiveNodeConfig.event_store is set but no factory was registered; \\\n                 call LiveNodeBuilder::with_event_store(...) to install one\"\n            );\n        }\n\n        if self.external_msgbus_factory.is_some()\n            && (self.external_msgbus_egress.is_some() || self.external_msgbus_ingress.is_some())\n        {\n            anyhow::bail!(\n                \"external message bus factory cannot be combined with injected egress or ingress\"\n            );\n        }\n\n        let runner = AsyncRunner::new();\n        runner.bind_senders();\n\n        let socket_registry = SocketReconnectRegistry::default();\n\n        let kernel = NautilusKernel::new_with_dependencies(\n            self.name.clone(),\n            self.config.clone(),\n            NautilusKernelDependencies::default()\n                .with_clock_factory(self.clock_factory.take())\n                .with_event_store_factory(self.event_store_factory.take()),\n        )?;\n        #[cfg(feature = \"python\")]\n        if let Some(controller) = self.config.controller.as_ref() {","sourceCodeStart":558,"sourceCodeEnd":594,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/live/src/node/builder.rs#L558-L594","documentation":"The builder rejects configurations where an external message bus factory is supplied together with an injected external egress or ingress. An external message bus factory manages its own egress/ingress wiring, so injecting them separately would be contradictory.","triggerScenarios":"Calling LiveNodeBuilder with both with_external_msgbus_factory (factory registered) and either with_external_msgbus_egress or with_external_msgbus_ingress, then calling build().","commonSituations":"Merging two integration approaches in one node — e.g. embedding the node into an app with its own message bus bridge while also pointing it at an external bus factory; incremental migration code that left both paths active.","solutions":["Remove the external_msgbus_egress/ingress injections and let the external message bus factory supply them.","Or remove the external message bus factory registration if you want to inject egress/ingress directly.","Split into two node configurations if both mechanisms are genuinely needed."],"exampleFix":"// before\nbuilder.with_external_msgbus_factory(factory)\n       .with_external_msgbus_egress(egress);\n// after\nbuilder.with_external_msgbus_factory(factory); // factory owns egress/ingress","handlingStrategy":"validation","validationCode":"assert!(!(external_msgbus_factory_set && (egress_set || ingress_set)), \"external msgbus factory is mutually exclusive with injected egress/ingress\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Choose one message bus integration strategy per node and document it.","Centralize node construction so conflicting options cannot be set independently.","Review builder call chains for leftover wiring from previous approaches."],"tags":["rust","config-validation","message-bus"],"backgroundTag":"mutually-exclusive-options","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}