[GET | POST] /fetch
:
Fetches the message(s) starting with a given offset inside the partition. This
API doesn’t use consumer groups. A FetchRequest
should be sent via request
body as JSON. Structure of the FetchRequest
is:
<topic, partition, offset>
or a set of them using topicPartitionOffsets
.
timeout
field defines the time to wait at most for the fetch request in
milliseconds. It’s optional and its default value 1000.
<topic, partition, offset>
:<topic, partition, offset>
triples:GET /consume/$CONSUMER_GROUP/$INSTANCE_ID/$TOPIC?timeout=$TIMEOUT
[GET | POST] /consume/$CONSUMER_GROUP/$INSTANCE_ID
$CONSUMER_GROUP
is the name of the consumer group which is used as
Kafka consumer group id.
$INSTANCE_ID
is used identify Kafka consumer instances in the same consumer
group. It’s used as
Kafka consumer instance id.
Each consumer instance is handled by a separate consumer client.
In the second variant, a ConsumeRequest
should be sent via request body as
JSON. Structure of the ConsumeRequest
is:
topic
or multiple
topics
. timeout
field defines the time to wait at most for the consume
request in milliseconds. It’s optional and its default value is 1000
.
Consumer group instances will be closed after some idle time. So consume
requests should be sent periodically to keep them alive.
Kafka-Enable-Auto-Commit
: If true, the consumer’s offset will be
periodically committed in the background. Valid values are <true, false>
.
Default is true
.Kafka-Auto-Commit-Interval
: The frequency in milliseconds that the consumer
offsets are auto-committed to Kafka if auto commit is enabled. Default is
5000
.Kafka-Auto-Offset-Reset
: What to do when there is no initial offset in Kafka
or if the current offset does not exist any more on the server. Default value
is latest
.
earliest
: Automatically reset the offset to the earliest offsetlatest
: Automatically reset the offset to the latest offsetnone
: Throw exception to the consumer if no previous offset is found for
the consumer’s group.[GET | POST] /commit/$CONSUMER_GROUP/$INSTANCE_ID
Commits the fetched message offsets. Commit API should be used alongside
Consume API, especially when auto commit is disabled. Request body should be
a single TopicPartitionOffset
object or an array of TopicPartitionOffset
s as
JSON.
[POST|DELETE] /delete-consumer/$CONSUMER_GROUP/$INSTANCE_ID
Stops and removes a previously created consumer group instance.
Response:
When deletion is completed, a success JSON result will be returned: