Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not generate retry details or receiverQueueSize in the command by default #184

Merged
merged 2 commits into from
Jun 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/v1alpha1/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ type ConsumerConfig struct {
IsRegexPattern bool `json:"isRegexPattern,omitempty"`
SchemaProperties map[string]string `json:"schemaProperties,omitempty"`
ConsumerProperties map[string]string `json:"consumerProperties,omitempty"`
ReceiverQueueSize int32 `json:"receiverQueueSize,omitempty"`
ReceiverQueueSize *int32 `json:"receiverQueueSize,omitempty"`
CryptoConfig *CryptoConfig `json:"cryptoConfig,omitempty"`
}

Expand Down
5 changes: 5 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions controllers/spec/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,9 @@ func convertSubPosition(pos v1alpha1.SubscribePosition) proto.SubscriptionPositi
}

func generateRetryDetails(maxMessageRetry int32, deadLetterTopic string) *proto.RetryDetails {
if maxMessageRetry <= 0 && deadLetterTopic == "" {
return nil
}
return &proto.RetryDetails{
MaxMessageRetries: maxMessageRetry,
DeadLetterTopic: deadLetterTopic,
Expand Down
8 changes: 7 additions & 1 deletion controllers/spec/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,17 @@ func generateInputSpec(sourceConf v1alpha1.InputConf) map[string]*proto.Consumer

if sourceConf.SourceSpecs != nil && len(sourceConf.SourceSpecs) > 0 {
for topicName, conf := range sourceConf.SourceSpecs {
var receiverQueueSize *proto.ConsumerSpec_ReceiverQueueSize
if conf.ReceiverQueueSize != nil {
receiverQueueSize = &proto.ConsumerSpec_ReceiverQueueSize{Value: *conf.ReceiverQueueSize}
} else {
receiverQueueSize = nil
}
inputSpecs[topicName] = &proto.ConsumerSpec{
SchemaType: conf.SchemaType,
SerdeClassName: conf.SerdeClassName,
IsRegexPattern: conf.IsRegexPattern,
ReceiverQueueSize: &proto.ConsumerSpec_ReceiverQueueSize{Value: conf.ReceiverQueueSize},
ReceiverQueueSize: receiverQueueSize,
SchemaProperties: conf.SchemaProperties,
ConsumerProperties: conf.ConsumerProperties,
CryptoSpec: generateCryptoSpec(conf.CryptoConfig),
Expand Down
2 changes: 1 addition & 1 deletion tools/migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func main() {
SchemaType: functionConfig.InputSpecs[s].SchemaType,
SerdeClassName: functionConfig.InputSpecs[s].SerdeClassName,
IsRegexPattern: functionConfig.InputSpecs[s].IsRegexPattern,
ReceiverQueueSize: receiveQueueSize,
ReceiverQueueSize: &receiveQueueSize,
}
}
timeoutMs := int32(0)
Expand Down