mq.proto 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. syntax = "proto3";
  2. package messaging_pb;
  3. option go_package = "github.com/seaweedfs/seaweedfs/weed/pb/mq_pb";
  4. option java_package = "seaweedfs.mq";
  5. option java_outer_classname = "MessagQueueProto";
  6. //////////////////////////////////////////////////
  7. service SeaweedMessaging {
  8. // control plane
  9. rpc FindBrokerLeader (FindBrokerLeaderRequest) returns (FindBrokerLeaderResponse) {
  10. }
  11. rpc AssignSegmentBrokers (AssignSegmentBrokersRequest) returns (AssignSegmentBrokersResponse) {
  12. }
  13. rpc CheckSegmentStatus (CheckSegmentStatusRequest) returns (CheckSegmentStatusResponse) {
  14. }
  15. rpc CheckBrokerLoad (CheckBrokerLoadRequest) returns (CheckBrokerLoadResponse) {
  16. }
  17. // data plane
  18. rpc PublishMessage (stream PublishRequest) returns (stream PublishResponse) {
  19. }
  20. }
  21. //////////////////////////////////////////////////
  22. message SegmentInfos {
  23. repeated SegmentInfo segment_infos = 1;
  24. }
  25. message Topic {
  26. string namespace = 1;
  27. string topic = 2;
  28. }
  29. message SegmentInfo {
  30. Segment segment = 1;
  31. int64 start_ts_ns = 2;
  32. repeated string brokers = 3;
  33. int64 stop_ts_ns = 4;
  34. }
  35. message Segment {
  36. int32 id = 1;
  37. int32 ring_size = 2;
  38. int32 range_start = 3;
  39. int32 range_stop = 4;
  40. }
  41. //////////////////////////////////////////////////
  42. message FindBrokerLeaderRequest {
  43. string filer_group = 1;
  44. }
  45. message FindBrokerLeaderResponse {
  46. string broker = 1;
  47. }
  48. message AssignSegmentBrokersRequest {
  49. Topic topic = 1;
  50. Segment segment = 2;
  51. }
  52. message AssignSegmentBrokersResponse {
  53. repeated string brokers = 1;
  54. }
  55. message CheckSegmentStatusRequest {
  56. Topic topic = 1;
  57. Segment segment = 2;
  58. }
  59. message CheckSegmentStatusResponse {
  60. bool is_active = 1;
  61. }
  62. message CheckBrokerLoadRequest {
  63. }
  64. message CheckBrokerLoadResponse {
  65. int64 message_count = 1;
  66. int64 bytes_count = 2;
  67. }
  68. //////////////////////////////////////////////////
  69. message PublishRequest {
  70. message DataMessage {
  71. bytes message = 1;
  72. }
  73. DataMessage data = 1;
  74. message ControlMessage {
  75. Segment segment = 1;
  76. }
  77. ControlMessage control = 2;
  78. }
  79. message PublishResponse {
  80. int64 ack_sequence = 1;
  81. bool is_closed = 2;
  82. }