Skip to content

Commit

Permalink
feat: add message details on proto message
Browse files Browse the repository at this point in the history
feat: add service to retrieve messages

Signed-off-by: Nick Aguilar <nickaguilarh@gmail.com>
  • Loading branch information
nickaguilarh committed May 16, 2024
1 parent 6ff34c0 commit cb6a9c6
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
6 changes: 3 additions & 3 deletions buf.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ deps:
- remote: buf.build
owner: envoyproxy
repository: protoc-gen-validate
commit: ea113bc841fa448ab34bf3f9fa6cef0f
commit: 89818263b32b46d39c9ecb5984bd2850
digest: shake256:8f3653779e824957a4fe3d18cdb73531f7f7ed1393848082dfe1f90026fd187da9534e759b5833f4e5487be0d34cfa7d4ff149af9a2694863773387d61d09fce
- remote: buf.build
owner: googleapis
repository: googleapis
commit: 14bdc09318b24694992b8c84f63e3681
digest: shake256:7149cf5e9955c692d381e557830555d4e93f205a0f1b8e2dfdae46d029369aa3fc1980e35df0d310f7cc3b622f93e19ad276769a283a967dd3065ddfd3a40e13
commit: 522d453992234d9babc812c05f43717f
digest: shake256:de26a277fc28b8b411ecf58729d78d32fcf15090ffd998a4469225b17889bfb51442eaab04bb7a8d88d203ecdf0a9febd4ffd52c18ed1c2229160c7bd353ca95
4 changes: 4 additions & 0 deletions queuer/entities/v1/message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import "google/protobuf/timestamp.proto";
import "validate/validate.proto";

import "queuer/entities/v1/owner.proto";
import "queuer/entities/v1/stream.proto";

// Defines the import path that should be used to import the generated package,
// and the package name.
Expand All @@ -22,6 +23,9 @@ message Message {
string id = 1 [(validate.rules).string.uuid = true];
bytes payload = 2;
Priority priority = 3;
optional entities.v1.Stream stream = 4;
optional google.protobuf.Timestamp acknowledged_at = 5;
optional google.protobuf.Timestamp created_at = 6;
}

enum Priority {
Expand Down
12 changes: 12 additions & 0 deletions queuer/messages/v1/messages.proto
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@ option go_package = "github.com/gsols/goproto/queuer/messages/v1;v1";
option php_namespace = "GSols\\PHPProto\\Queuer\\Messages\\v1";
option php_metadata_namespace = "GSols\\PHPProto\\Queuer\\Messages\\v1\\Metadata";

message GetMessagesRequest {
string stream_id = 1 [(validate.rules).string = {uuid: true, ignore_empty: true}];
string owner_id = 2 [(validate.rules).string = {uuid: true, ignore_empty: true}];
optional string search = 3 [(validate.rules).string = {ignore_empty: true}];
optional string page_token = 4 ;
optional int32 page_size = 5 [(validate.rules).int32 = {gte: 1, lte: 100}];
}

message GetMessagesResponse {
repeated entities.v1.Message messages = 1;
string next_page_token = 2 [(validate.rules).string.uuid = true];
}

message AcknowledgeRequest {
string stream_id = 1 [(validate.rules).string.uuid = true];
Expand Down
5 changes: 5 additions & 0 deletions queuer/messages/v1/service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ option php_namespace = "GSols\\PHPProto\\Queuer\\Messages\\v1";
option php_metadata_namespace = "GSols\\PHPProto\\Queuer\\Messages\\v1\\Metadata";

service MessageService {
rpc GetMessages(GetMessagesRequest) returns (GetMessagesResponse) {
option (google.api.http) = {
get: "/v1/messages"
};
}
rpc Acknowledge(AcknowledgeRequest) returns (AcknowledgeResponse) {
option (google.api.http) = {
post: "/v1/messages/{message_id}/confirm"
Expand Down

0 comments on commit cb6a9c6

Please sign in to comment.