{"record":{"id":"dbb7e3eb5ccd0ce0","repo":"nautechsystems/nautilus_trader","slug":"external-ingress-receiver-unavailable","errorCode":null,"errorMessage":"external ingress receiver unavailable","messagePattern":"external ingress receiver unavailable","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/common/src/msgbus/backing.rs","lineNumber":83,"sourceCode":"///\n/// Implementations own the concrete backing technology and provide the runtime-facing publication\n/// surface used by the core bus. With the `live` feature, the same backing can also hand an\n/// inbound receiver to the live bridge.\npub trait MessageBusBacking {\n    /// Returns `true` if the backing has been closed.\n    fn is_closed(&self) -> bool;\n\n    /// Queues a serialized bus message for external egress.\n    fn publish(&self, message: BusMessage);\n\n    /// Takes the inbound message receiver for live bridge consumption.\n    ///\n    /// # Errors\n    ///\n    /// Returns an error if the receiver has already been taken or is unavailable.\n    #[cfg(feature = \"live\")]\n    fn take_receiver(&mut self) -> anyhow::Result<MessageBusExternalReceiver> {\n        anyhow::bail!(\"external ingress receiver unavailable\")\n    }\n\n    /// Closes the backing and releases any owned resources.\n    fn close(&mut self);\n}\n\n/// External egress surface for serialized message bus publications.\n///\n/// The core bus passes each outbound message as a [`BusMessage`] carrying the\n/// `topic`, `payload_type`, and serialized `payload`. Implementations must not block the publishing\n/// thread. If the underlying channel is full, drop the message in the implementation rather than\n/// applying back-pressure to the node.\npub trait MessageBusExternalEgress {\n    /// Returns `true` if egress has been closed.\n    fn is_closed(&self) -> bool;\n\n    /// Queues a serialized bus message for external egress.\n    fn publish(&self, message: BusMessage);","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/common/src/msgbus/backing.rs#L65-L101","documentation":"MessageBusBacking's default take_receiver implementation always fails: the base trait provides no receiver, so attempting to take the external ingress receiver on a backing that does not supply one yields this error. Concrete backings that own a receiver override this method; the default exists so implementations without an external receiver compile.","triggerScenarios":"Calling take_receiver on a MessageBusBacking instance that uses the default implementation (no external ingress configured), typically when wiring external senders to the message bus in live mode.","commonSituations":"Live-node setup code that assumes every bus backing exposes an external receiver, or calling take_receiver twice — the first call consumes the receiver and later calls on a non-refundable implementation effectively become unavailable.","solutions":["Only call take_receiver when the bus was constructed with external ingress backing (live feature, external sender configured).","Call take_receiver exactly once and store the returned receiver; repeated calls fail.","Check which concrete backing type you created; use a backing implementation that owns and yields a receiver if you need external ingress.","Handle the error gracefully: fall back to internal-only message routing when no external receiver is present."],"exampleFix":"// before\nlet rx = backing.take_receiver()?; // bails on default backing\n// after\nmatch backing.take_receiver() {\n    Ok(rx) => { /* wire external sender */ }\n    Err(_) => { /* no external ingress; run internal-only bus */ }\n}","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"match backing.take_receiver() {\n    Ok(rx) => start_external_ingress(rx),\n    Err(e) if e.to_string().contains(\"receiver unavailable\") => run_internal_only_bus(),\n    Err(e) => return Err(e),\n}","preventionTips":["Call take_receiver only when external ingress is configured.","Call it exactly once and cache the receiver.","Design the bus wiring to work with or without an external receiver."],"tags":["messagebus","live","rust","receiver"],"backgroundTag":"resource-not-found","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"}