Browse Source

Merge pull request #345 from catcherwong/grpc-retrylimit

support RetryLimit for saga grpc
pull/346/head
yedf2 4 years ago
committed by GitHub
parent
commit
83b7771ac5
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      client/dtmgrpc/dtmgimp/utils.go
  2. 18
      client/dtmgrpc/dtmgpb/dtmgimp.pb.go
  3. 1
      client/dtmgrpc/dtmgpb/dtmgimp.proto
  4. 1
      dtmsvr/trans_class.go

1
client/dtmgrpc/dtmgimp/utils.go

@ -41,6 +41,7 @@ func GetDtmRequest(s *dtmimp.TransBase) *dtmgpb.DtmRequest {
RetryInterval: s.RetryInterval,
BranchHeaders: s.BranchHeaders,
RequestTimeout: s.RequestTimeout,
RetryLimit: s.RetryLimit,
},
QueryPrepared: s.QueryPrepared,
CustomedData: s.CustomData,

18
client/dtmgrpc/dtmgpb/dtmgimp.pb.go

@ -1,7 +1,7 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.0
// protoc v3.17.3
// protoc-gen-go v1.28.1
// protoc v3.21.5
// source: client/dtmgrpc/dtmgpb/dtmgimp.proto
package dtmgpb
@ -32,6 +32,7 @@ type DtmTransOptions struct {
// repeated string PassthroughHeaders = 4; // depreceated
BranchHeaders map[string]string `protobuf:"bytes,5,rep,name=BranchHeaders,proto3" json:"BranchHeaders,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
RequestTimeout int64 `protobuf:"varint,6,opt,name=RequestTimeout,proto3" json:"RequestTimeout,omitempty"`
RetryLimit int64 `protobuf:"varint,7,opt,name=RetryLimit,proto3" json:"RetryLimit,omitempty"`
}
func (x *DtmTransOptions) Reset() {
@ -101,6 +102,13 @@ func (x *DtmTransOptions) GetRequestTimeout() int64 {
return 0
}
func (x *DtmTransOptions) GetRetryLimit() int64 {
if x != nil {
return x.RetryLimit
}
return 0
}
// DtmRequest request sent to dtm server
type DtmRequest struct {
state protoimpl.MessageState
@ -551,7 +559,7 @@ var file_client_dtmgrpc_dtmgpb_dtmgimp_proto_rawDesc = []byte{
0x2f, 0x64, 0x74, 0x6d, 0x67, 0x70, 0x62, 0x2f, 0x64, 0x74, 0x6d, 0x67, 0x69, 0x6d, 0x70, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x64, 0x74, 0x6d, 0x67, 0x69, 0x6d, 0x70, 0x1a, 0x1b,
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f,
0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xba, 0x02, 0x0a, 0x0f,
0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xda, 0x02, 0x0a, 0x0f,
0x44, 0x74, 0x6d, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12,
0x1e, 0x0a, 0x0a, 0x57, 0x61, 0x69, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20,
0x01, 0x28, 0x08, 0x52, 0x0a, 0x57, 0x61, 0x69, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12,
@ -567,7 +575,9 @@ var file_client_dtmgrpc_dtmgpb_dtmgimp_proto_rawDesc = []byte{
0x0d, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x26,
0x0a, 0x0e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74,
0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x54,
0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x1a, 0x40, 0x0a, 0x12, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68,
0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x52, 0x65, 0x74, 0x72, 0x79, 0x4c,
0x69, 0x6d, 0x69, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x52, 0x65, 0x74, 0x72,
0x79, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x1a, 0x40, 0x0a, 0x12, 0x42, 0x72, 0x61, 0x6e, 0x63, 0x68,
0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03,
0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14,
0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76,

1
client/dtmgrpc/dtmgpb/dtmgimp.proto

@ -22,6 +22,7 @@ message DtmTransOptions {
// repeated string PassthroughHeaders = 4; // depreceated
map<string, string> BranchHeaders = 5;
int64 RequestTimeout = 6;
int64 RetryLimit = 7;
}
// DtmRequest request sent to dtm server

1
dtmsvr/trans_class.go

@ -99,6 +99,7 @@ func TransFromDtmRequest(ctx context.Context, c *dtmgpb.DtmRequest) *TransGlobal
RetryInterval: o.RetryInterval,
BranchHeaders: o.BranchHeaders,
RequestTimeout: o.RequestTimeout,
RetryLimit: o.RetryLimit,
},
}}
r.ReqExtra = c.ReqExtra

Loading…
Cancel
Save