The Policy serves messages on the route of the entity it’s attached to.
For an AI Model, send a POST request to the model’s chat/completions path.
For an AI Agent or AI MCP Server, send a GET request to the entity’s path.
In http-get mode, the Policy returns the records available for every topic in config.topics, keyed by topic name and then by partition:
{
"ai-events": {
"partitions": {
"0": {
"high_watermark": 3,
"last_stable_offset": 3,
"errcode": 0,
"records": [
{
"value": {"event": "prompt_received", "n": 1},
"offset": 0,
"timestamp": 1794215129672
}
],
"aborted_transactions": {}
}
}
}
}
When config.message_deserializer is json, value is a parsed object.
When it’s noop (default), value is the raw message as a string.
The Confluent Consume Policy reads topics as a Kafka consumer group.
By default, the Policy commits offsets after each read, so a repeated request returns only new messages.
When no new messages exist, records is an empty object.
Where a new consumer group starts reading depends on config.auto_offset_reset:
earliest (default) reads from the beginning of the topic.
latest reads only messages produced after the Policy starts consuming.
Also set config.enforce_latest_offset_reset to true.
Without it, the first read still returns the messages already on the topic.