@@ -72,25 +72,42 @@ message FetchMetadataResponse {
72
72
repeated StreamMetadata metadata = 2 ; // Information for all streams
73
73
}
74
74
75
- // PublishRequest is sent to publish a new message.
75
+ // PublishRequest is sent to publish a new message to a stream .
76
76
message PublishRequest {
77
- bytes key = 1 ; // Message key
78
- bytes value = 2 ; // Message payload
79
- string stream = 3 ; // Stream name to publish to
80
- int32 partition = 4 ; // Stream partition to publish to
81
- string subject = 5 ; // NATS subject to publish to
82
- string replySubject = 6 ; // NATS reply subject
83
- map <string , bytes > headers = 7 ; // Message headers
84
- string ackInbox = 8 ; // NATS subject to publish acks to
85
- string correlationId = 9 ; // User-supplied value to correlate acks to publishes
86
- AckPolicy ackPolicy = 10 ; // Controls the behavior of acks
87
- }
88
-
89
- // PublishResponse is sent by the server after publishing a message.
77
+ bytes key = 1 ; // Message key
78
+ bytes value = 2 ; // Message payload
79
+ string stream = 3 ; // Stream name to publish to
80
+ int32 partition = 4 ; // Stream partition to publish to
81
+ map <string , bytes > headers = 5 ; // Message headers
82
+ string ackInbox = 6 ; // NATS subject to publish acks to
83
+ string correlationId = 7 ; // User-supplied value to correlate acks to publishes
84
+ AckPolicy ackPolicy = 8 ; // Controls the behavior of acks
85
+ }
86
+
87
+ // PublishResponse is sent by the server after publishing a message to a
88
+ // stream.
90
89
message PublishResponse {
91
90
Ack ack = 1 ; // The ack for the published message if AckPolicy was not NONE
92
91
}
93
92
93
+ // PublishToSubjectRequest is sent to publish a Liftbridge message to a NATS
94
+ // subject.
95
+ message PublishToSubjectRequest {
96
+ bytes key = 1 ; // Message key
97
+ bytes value = 2 ; // Message payload
98
+ string subject = 3 ; // NATS subject to publish to
99
+ map <string , bytes > headers = 4 ; // Message headers
100
+ string ackInbox = 5 ; // NATS subject to publish acks to
101
+ string correlationId = 6 ; // User-supplied value to correlate acks to publishes
102
+ AckPolicy ackPolicy = 7 ; // Controls the behavior of acks
103
+ }
104
+
105
+ // PublishToSubjectResponse is sent by the server after publishing a message to
106
+ // a NATS subject.
107
+ message PublishToSubjectResponse {
108
+ Ack ack = 1 ; // The ack for the published message if AckPolicy was not NONE
109
+ }
110
+
94
111
// Broker contains information for a Liftbridge broker.
95
112
message Broker {
96
113
string id = 1 ; // Broker id
@@ -220,9 +237,15 @@ service API {
220
237
// broker information.
221
238
rpc FetchMetadata (FetchMetadataRequest ) returns (FetchMetadataResponse ) {}
222
239
223
- // Publish a new message to a subject . If the AckPolicy is not NONE and a
240
+ // Publish a new message to a stream . If the AckPolicy is not NONE and a
224
241
// deadline is provided, this will synchronously block until the ack is
225
242
// received. If the ack is not received in time, a DeadlineExceeded status
226
243
// code is returned.
227
244
rpc Publish (PublishRequest ) returns (PublishResponse ) {}
245
+
246
+ // Publish a Liftbridge message to a NATS subject. If the AckPolicy is not NONE and a
247
+ // deadline is provided, this will synchronously block until the first ack
248
+ // is received. If an ack is not received in time, a DeadlineExceeded
249
+ // status code is returned.
250
+ rpc PublishToSubject (PublishToSubjectRequest ) returns (PublishToSubjectResponse ) {}
228
251
}
0 commit comments