Skip to content

Commit

Permalink
grpc: Update proto file.
Browse files Browse the repository at this point in the history
  • Loading branch information
paambaati committed Sep 11, 2019
1 parent dd64cf1 commit 758a926
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
10 changes: 5 additions & 5 deletions grpc/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ message SubscribeRequest {
string stream = 1; // Stream name to subscribe to
int32 partition = 2; // Stream partition to subscribe to
StartPosition startPosition = 3; // Where to begin consuming from
int64 startOffset = 4; // Offset to begin consuming from
int64 startTimestamp = 5; // Timestamp to begin consuming from
int64 startOffset = 4 [jstype=JS_STRING]; // Offset to begin consuming from
int64 startTimestamp = 5 [jstype=JS_STRING]; // Timestamp to begin consuming from
}

// FetchMetadataRequest is sent to retrieve the latest cluster metadata.
Expand Down Expand Up @@ -91,10 +91,10 @@ enum AckPolicy {

// Message represents a message from a stream.
message Message {
int64 offset = 1; // Monotonic message offset in the stream
int64 offset = 1 [jstype=JS_STRING]; // Monotonic message offset in the stream
bytes key = 2; // Message key
bytes value = 3; // Message payload
int64 timestamp = 4; // When the message was received by the broker
int64 timestamp = 4 [jstype=JS_STRING]; // When the message was received by the broker
string subject = 5; // NATS subject message was received on
string reply = 6; // NATS reply subject
map<string, bytes> headers = 7; // Message headers
Expand All @@ -109,7 +109,7 @@ message Ack {
string stream = 1; // Name of the stream
string partitionSubject = 2; // NATS subject partition is attached to
string msgSubject = 3; // NATS subject the message was received on
int64 offset = 4; // Stream offset the message was committed to
int64 offset = 4 [jstype=JS_STRING]; // Stream offset the message was committed to
string ackInbox = 5; // NATS subject to publish acks to
string correlationId = 6; // User-supplied value from the message
AckPolicy ackPolicy = 7; // The AckPolicy sent on the message
Expand Down
5 changes: 3 additions & 2 deletions scripts/generate_grpc_code.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ cleanup () {
trap cleanup EXIT

# Fetch Liftbridge gRPC Proto definition.
wget -nv https://raw.githubusercontent.com/liftbridge-io/liftbridge-grpc/0877a0cacb7a721e2e19280cff126dc2ed51912d/api.proto -O ../grpc/api.proto
wget -nv https://raw.githubusercontent.com/liftbridge-io/liftbridge-grpc/5694b15f251d2ff16d7d4c3e8d944aab327d3ef0/api.proto -O ../grpc/api.proto

# Fetch & extract protoc.
OS=$(uname)
Expand All @@ -43,7 +43,8 @@ PROTOC_GEN_TS_PATH="${NODE_MODULES_BIN_DIR}/protoc-gen-ts"
PROTOC_GEN_GRPC_PATH="${NODE_MODULES_BIN_DIR}/grpc_tools_node_protoc_plugin"

# Directory to write generated code to (.js and .d.ts files)
OUT_DIR="../grpc/generated"
OUT_DIR="../grpc/generated_test"
mkdir -p ${OUT_DIR}

# Generate gRPC bindings.
./bin/protoc \
Expand Down

0 comments on commit 758a926

Please sign in to comment.