You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "jiangpengcheng (via GitHub)" <gi...@apache.org> on 2024/03/26 01:57:05 UTC

[I] Golang instance of functions missing many fields of the `FunctionDetails` [pulsar]

jiangpengcheng opened a new issue, #22349:
URL: https://github.com/apache/pulsar/issues/22349

   ### Search before asking
   
   - [X] I searched in the [issues](https://github.com/apache/pulsar/issues) and found nothing similar.
   
   
   ### Motivation
   
   the Go instance is assembling the `FunctionDetails` manullay:
   
   ```go
   		funcDetails: pb.FunctionDetails{
   			Tenant:               cfg.Tenant,
   			Namespace:            cfg.NameSpace,
   			Name:                 cfg.Name,
   			LogTopic:             cfg.LogTopic,
   			ProcessingGuarantees: pb.ProcessingGuarantees(cfg.ProcessingGuarantees),
   			SecretsMap:           cfg.SecretsMap,
   			Runtime:              pb.FunctionDetails_Runtime(cfg.Runtime),
   			AutoAck:              cfg.AutoACK,
   			Parallelism:          cfg.Parallelism,
   			Source: &pb.SourceSpec{
   				SubscriptionType:     pb.SubscriptionType(cfg.SubscriptionType),
   				InputSpecs:           inputSpecs,
   				TimeoutMs:            cfg.TimeoutMs,
   				SubscriptionName:     cfg.SubscriptionName,
   				CleanupSubscription:  cfg.CleanupSubscription,
   				SubscriptionPosition: pb.SubscriptionPosition(cfg.SubscriptionPosition),
   			},
   			Sink: &pb.SinkSpec{
   				Topic:      cfg.SinkSpecTopic,
   				SchemaType: cfg.SinkSchemaType,
   			},
   			Resources: &pb.Resources{
   				Cpu:  cfg.Cpu,
   				Ram:  cfg.Ram,
   				Disk: cfg.Disk,
   			},
   			RetryDetails: &pb.RetryDetails{
   				MaxMessageRetries: cfg.MaxMessageRetries,
   				DeadLetterTopic:   cfg.DeadLetterTopic,
   			},
   			UserConfig: cfg.UserConfig,
   		},
   ```
   
   Which makes it missed many fields of the `FunctionDetails`, such as the `sink.ProducerSpec`, `runtimeFlags`, and so on, and if the `FunctionDetails` struct has some updates of fields, we have to modify this code to adapt the change, which is quite inflexible
   
   ### Solution
   
   We can pass the `FunctionDetails` string to Go instance directly, and "unmarshal" it to the `FunctionDetails` struct directly instead of create it manually
   
   ### Alternatives
   
   _No response_
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [X] I'm willing to submit a PR!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Golang instance of functions missing many fields of the `FunctionDetails` [pulsar]

Posted by "Technoboy- (via GitHub)" <gi...@apache.org>.
Technoboy- closed issue #22349: Golang instance of functions missing many fields of the `FunctionDetails`
URL: https://github.com/apache/pulsar/issues/22349


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org