NatsBroker supports all regular publishing usecases. You can use them without any changes.
However, if you wish to further customize the publishing logic, you should take a deeper look at specific
NatsBroker also uses the unified
publish method (from a
publisher object) to send messages.
publish method accepts the following arguments:
message = ""- message to send.
subject: str- subject where the message will be sent.
headers: dict[str, str] | None = None- headers of the message being sent (used by consumers).
correlation_id: str | None = None- message id, which helps to match the original message with the reply to it (generated automatically).
stream: str | None = None- validate that the subject is in the stream.
timeout: float | None = None- wait for the NATS server response.