You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

95 lines
2.7 KiB

3 weeks ago
3 weeks ago
3 weeks ago
  1. syntax = "proto3";
  2. package messaging_pb;
  3. import "mq_schema.proto";
  4. option go_package = "github.com/seaweedfs/seaweedfs/weed/pb/mq_agent_pb";
  5. option java_package = "seaweedfs.mq_agent";
  6. option java_outer_classname = "MessageQueueAgentProto";
  7. //////////////////////////////////////////////////
  8. service SeaweedMessagingAgent {
  9. // Publishing
  10. rpc StartPublishSession (StartPublishSessionRequest) returns (StartPublishSessionResponse) {
  11. }
  12. rpc ClosePublishSession (ClosePublishSessionRequest) returns (ClosePublishSessionResponse) {
  13. }
  14. rpc PublishRecord (stream PublishRecordRequest) returns (stream PublishRecordResponse) {
  15. }
  16. // Subscribing
  17. rpc StartSubscribeSession (StartSubscribeSessionRequest) returns (StartSubscribeSessionResponse) {
  18. }
  19. rpc CloseSubscribeSession (CloseSubscribeSessionRequest) returns (CloseSubscribeSessionResponse) {
  20. }
  21. rpc SubscribeRecord (stream SubscribeRecordRequest) returns (stream SubscribeRecordResponse) {
  22. }
  23. }
  24. //////////////////////////////////////////////////
  25. message StartPublishSessionRequest {
  26. schema_pb.Topic topic = 1;
  27. int32 partition_count = 2;
  28. schema_pb.RecordType record_type = 3;
  29. string publisher_name = 4;
  30. }
  31. message StartPublishSessionResponse {
  32. string error = 1;
  33. int64 session_id = 2;
  34. }
  35. message ClosePublishSessionRequest {
  36. int64 session_id = 1;
  37. }
  38. message ClosePublishSessionResponse {
  39. string error = 1;
  40. }
  41. //////////////////////////////////////////////////
  42. message PublishRecordRequest {
  43. int64 session_id = 1; // session_id is required for the first record
  44. bytes key = 2;
  45. schema_pb.RecordValue value = 3;
  46. }
  47. message PublishRecordResponse {
  48. int64 ack_sequence = 1;
  49. string error = 2;
  50. }
  51. //////////////////////////////////////////////////
  52. message StartSubscribeSessionRequest {
  53. string consumer_group = 1;
  54. string consumer_group_instance_id = 2;
  55. schema_pb.Topic topic = 4;
  56. repeated schema_pb.PartitionOffset partition_offsets = 5;
  57. string filter = 6;
  58. int32 max_subscribed_partitions = 8;
  59. int32 sliding_window_size = 9;
  60. }
  61. message StartSubscribeSessionResponse {
  62. string error = 1;
  63. int64 session_id = 2;
  64. }
  65. message CloseSubscribeSessionRequest {
  66. int64 session_id = 1;
  67. }
  68. message CloseSubscribeSessionResponse {
  69. string error = 1;
  70. }
  71. //////////////////////////////////////////////////
  72. message SubscribeRecordRequest {
  73. int64 session_id = 1; // session_id is required for the first record
  74. int64 ack_sequence = 2;
  75. bytes ack_key = 3;
  76. }
  77. message SubscribeRecordResponse {
  78. bytes key = 2;
  79. schema_pb.RecordValue value = 3;
  80. int64 ts_ns = 4;
  81. string error = 5;
  82. bool is_end_of_stream = 6;
  83. bool is_end_of_topic = 7;
  84. }
  85. //////////////////////////////////////////////////