class ProduceResponse

Header File: <libkafka_asio/produce_response.h>

Namespace: libkafka_asio

Implementation of the Kafka ProduceResponse as described on the Kafka wiki. An object of this type will be given as response object to the handler function when invoking a produce request and the request expected the server to send a response (which is not always the case for a ProduceRequest).

Member Functions


const Topics& topics() const

Returns a reference to the list of topics, for which messages have been produced for. See the description of Topic type below.



struct Topic {
    Partitions partitions;
  • partitions: Map of Partition objects, for which messages have been produced.


struct Partition {
    Int16   error_code;
    Int64   offset;
  • error_code: Kafka error code for this partition, if any.
  • offset: Offset assigned to the first message in the set of messages produced for this partition.


typedef std::map<String, Topic> Topics

Map that associates the offset response part of topics to their topic names.


typedef std::map<Int32, Partition> Partitions

Map that associates a Partition object to the partition id.


typedef boost::optional<ProduceResponse> OptionalType

A produce response object wrapped using Boost optional. Such an object will be used for produce request handler functions.