diff --git a/cli/agent/agent.go b/cli/agent/agent.go index 8867e40..9cdeab0 100644 --- a/cli/agent/agent.go +++ b/cli/agent/agent.go @@ -14,6 +14,7 @@ import ( "github.com/rs/zerolog" "github.com/spf13/cobra" "google.golang.org/grpc" + _ "google.golang.org/grpc/encoding/gzip" "github.com/h0n9/msg-lake/lake" pb "github.com/h0n9/msg-lake/proto" diff --git a/client/client.go b/client/client.go index 11825d0..368dd03 100644 --- a/client/client.go +++ b/client/client.go @@ -9,6 +9,7 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/credentials" "google.golang.org/grpc/credentials/insecure" + "google.golang.org/grpc/encoding/gzip" pb "github.com/h0n9/msg-lake/proto" "github.com/postie-labs/go-postie-lib/crypto" @@ -139,16 +140,20 @@ func (c *Client) Publish(ctx context.Context, topicID, message string) error { } // publish the message - pubRes, err := c.msgLakeClient.Publish(ctx, &pb.PublishReq{ - TopicId: topicID, - MsgCapsule: &pb.MsgCapsule{ - Data: data, - Signature: &pb.Signature{ - PubKey: c.privKey.PubKey().Bytes(), - Data: sigDataBytes, + pubRes, err := c.msgLakeClient.Publish( + ctx, + &pb.PublishReq{ + TopicId: topicID, + MsgCapsule: &pb.MsgCapsule{ + Data: data, + Signature: &pb.Signature{ + PubKey: c.privKey.PubKey().Bytes(), + Data: sigDataBytes, + }, }, }, - }) + grpc.UseCompressor(gzip.Name), + ) if err != nil { return err }