amosproj / amos2023ss01-apache-pulsar-ui

MIT License
5 stars 2 forks source link

#114: Add Schema to Topic Details Endpoint #138

Closed jnsrnhld closed 1 year ago

jnsrnhld commented 1 year ago

TopicDetail now looks like this:

{
  "name": "persistent://neuron-demo/customer/command.create-customer.v1",
  "localName": "command.create-customer.v1",
  "namespace": "customer",
  "tenant": "neuron-demo",
  "ownerBroker": "pulsar://localhost:6650",
  "topicStatsDto": {
    "subscriptions": [
      "tech-rbi-neuron-demo-create-customer"
    ],
    "producers": [
      "tech-rbi-neuron-demo-create-customer"
    ],
    "numberSubscriptions": 1,
    "numberProducers": 1,
    "producedMesages": 1,
    "consumedMessages": 0,
    "averageMessageSize": 0,
    "storageSize": 77103
  },
  "schemaInfos": [
    {
      "name": "command.create-customer.v1",
      "version": 0,
      "type": "AVRO",
      "properties": {},
      "schemaDefinition": "{\n \"type\": \"record\",\n \"name\": \"CreateCustomer\",\n \"fields\": [\n  {\n   \"name\": \"numberOfPartitions\",\n   \"type\": [\n    \"null\",\n    \"int\"\n   ]\n  },\n  {\n   \"name\": \"customerBaseMin\",\n   \"type\": \"int\"\n  },\n  {\n   \"name\": \"customerBaseMax\",\n   \"type\": \"int\"\n  },\n  {\n   \"name\": \"publishIntervalSeconds\",\n   \"type\": \"int\"\n  },\n  {\n   \"name\": \"maxPublishCountPerRun\",\n   \"type\": \"int\"\n  },\n  {\n   \"name\": \"publishRandomizeMin\",\n   \"type\": [\n    \"null\",\n    \"float\"\n   ]\n  },\n  {\n   \"name\": \"publishRandomizeMax\",\n   \"type\": [\n    \"null\",\n    \"float\"\n   ]\n  }\n ]\n}",
      "timestamp": "2023-06-06T07:07:40.032+00:00"
    }
  ],
  "persistent": true
}

It will show ALL schema version for a topic, so it should meet the latest requirements.