How a connector's result actually reaches Zetect — the publisher contract, what happens under the hood, and exactly which exchange/routing key/headers each result type uses.
Call publish(ProvisioningResult) exactly once, always — provisioning results are never chunked.
What happens when you call publish()
Your handle()/handleProvisioning() runs on an AMQP consumer thread inside cyiam-agent.
publisher.publish(result) is a plain lambda — it calls the agent's internal publish method directly and synchronously, on the same thread your connector is running on.
The agent serializes your ConnectorResult/ProvisioningResult to JSON. Null fields are omitted from the wire format, so unused/inapplicable fields never appear.
The message is published to a single shared exchange with a routing key and headers that depend on the action (table below).
If your plugin throws instead of publishing, the agent catches it and publishes a generic failure result on your behalf — so a crash never leaves Zetect waiting forever. Publish explicitly on every path anyway; don't rely on this as your error handling.