Skip to content

Listens on a ZeroMQ endpoint and sends events.

serve_zmq endpoint:string, encoding=string, [prefix=string, monitor=bool]

Binds a ZeroMQ PUB socket to the specified endpoint and publishes one message per input event.

The operator serializes each event with the selected encoding and optionally prepends a prefix to the serialized bytes before publishing the message. This lets subscribers use ZeroMQ’s native prefix filtering while keeping the event payload available to a read_* operator on the receiving side.

Use serve_zmq when Tenzir should own the listening endpoint. This mirrors the transport-oriented naming used by operators such as serve_tcp.

The endpoint to listen on, for example tcp://0.0.0.0:5555, ipc://path, or inproc://name.

The encoding to use when serializing input events into ZeroMQ message payloads.

Use the same format names that you would otherwise select with a write_* operator, for example json, ndjson, csv, or yaml.

An expression that evaluates to the prefix to prepend to each published message.

This expression may depend on event fields. The operator evaluates it for every input event.

Waits for the first peer connection before publishing messages on TCP transports.

export
serve_zmq "tcp://0.0.0.0:5555", encoding="json"
export
serve_zmq "tcp://0.0.0.0:5555", encoding="json", prefix=kind + "/"

Last updated: