Skip to content

Commit

Permalink
include key in LogEntry
Browse files Browse the repository at this point in the history
  • Loading branch information
chrislusf committed Mar 7, 2024
1 parent 34f2b60 commit 28f8f33
Show file tree
Hide file tree
Showing 5 changed files with 275 additions and 264 deletions.
1 change: 1 addition & 0 deletions other/java/client/src/main/proto/filer.proto
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ message LogEntry {
int64 ts_ns = 1;
int32 partition_key_hash = 2;
bytes data = 3;
bytes key = 4;
}

message KeepConnectedRequest {
Expand Down
5 changes: 2 additions & 3 deletions weed/mq/broker/broker_grpc_sub.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,10 @@ func (b *MessageQueueBroker) SubscribeMessage(req *mq_pb.SubscribeMessageRequest
// reset the sleep interval count
sleepIntervalCount = 0

value := logEntry.GetData()
if err := stream.Send(&mq_pb.SubscribeMessageResponse{Message: &mq_pb.SubscribeMessageResponse_Data{
Data: &mq_pb.DataMessage{
Key: []byte(fmt.Sprintf("key-%d", logEntry.PartitionKeyHash)),
Value: value,
Key: logEntry.Key,
Value: logEntry.Data,
TsNs: logEntry.TsNs,
},
}}); err != nil {
Expand Down
1 change: 1 addition & 0 deletions weed/pb/filer.proto
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ message LogEntry {
int64 ts_ns = 1;
int32 partition_key_hash = 2;
bytes data = 3;
bytes key = 4;
}

message KeepConnectedRequest {
Expand Down
Loading

0 comments on commit 28f8f33

Please sign in to comment.