Skip to main content

republish_external_message

Function republish_external_message 

Source
pub fn republish_external_message(message: &BusMessage) -> Result<()>
Expand description

Decodes an externally-received BusMessage and republishes it onto the internal bus.

The message payload_type header selects the concrete type and the message encoding selects the wire codec, so the message is decoded with the producer’s encoding rather than the local configuration. Republishing runs under a SuppressExternalGuard so the message is not forwarded straight back out through external egress, which would create an echo loop on a node that has both external ingress and egress.

External data-client registrations in the cache enable built-in market-data processing when the DataEngine registers its message bus handlers. Engine processing applies only when the inbound topic exactly matches the topic the engine publishes for that payload. Custom data, DeFi data, other topics, and buses without a registered data endpoint retain direct publication.

Account states are sent to Portfolio’s account endpoint for application before Portfolio publishes them on events.account.{account_id}. Portfolio must be registered to process them.

§Errors

Returns an error if the topic is invalid or a supported payload cannot be decoded. Unsupported encodings for native data requests and responses also return an error. Other unsupported type/encoding pairs are skipped with a warning.