mailgun / kafka-pixy

gRPC/REST proxy for Kafka
Apache License 2.0
768 stars 119 forks source link

Add 2 http routes to retrieve list of topics #115

Closed slava-mg closed 7 years ago

slava-mg commented 7 years ago

Two HTTP GET routes to retrieve list of topics are added: /topics, and /cluster/{cluster_id}/topics It returns a list of topics, for instance ["__consumer_offsets", "test.64", "test.1", "test.4"] There are 2 additional parameters: withPartitions, and withConfig. If these parameters are provided to the route, for instance /topics?withPartitions&withConfig, it returns the partitions information and the configuration for every topic, for instance

{  "__consumer_offsets": {
    "topic_config": {
      "version": 1,
      "config": {
        "cleanup.policy": "compact", 
        "compression.type": "producer", 
        "segment.bytes": "104857600"
      }
    },
    "partitions": [
      {
        "partition": 0,
        "leader": 9092,
        "replicas": [
          9091,
          9092,
          9095
        ],
        "isr": [
          9091,
          9092,
          9095
        ]
      }, ... ], ...
}
slava-mg commented 7 years ago

@travis-ci retest this please