@@ -14,7 +14,6 @@ import (
1414
1515 xpclient "github.com/caraml-dev/xp/clients/management"
1616 "github.com/caraml-dev/xp/common/api/schema"
17- common_mq_config "github.com/caraml-dev/xp/common/messagequeue"
1817 _config "github.com/caraml-dev/xp/plugins/turing/config"
1918 "github.com/caraml-dev/xp/treatment-service/config"
2019 "github.com/go-playground/validator/v10"
@@ -142,37 +141,20 @@ func (em *experimentManager) MakeTreatmentServicePluginConfig(
142141 projectID int ,
143142) (* config.Config , error ) {
144143 pluginConfig := & config.Config {
145- Port : em .TreatmentServicePluginConfig .Port ,
146- ProjectIds : []string {strconv .Itoa (projectID )},
147- AssignedTreatmentLogger : em .TreatmentServicePluginConfig .AssignedTreatmentLogger ,
148- DebugConfig : em .TreatmentServicePluginConfig .DebugConfig ,
149- DeploymentConfig : em .TreatmentServicePluginConfig .DeploymentConfig ,
150- ManagementService : em .TreatmentServicePluginConfig .ManagementService ,
151- MonitoringConfig : em .TreatmentServicePluginConfig .MonitoringConfig ,
152- SwaggerConfig : em .TreatmentServicePluginConfig .SwaggerConfig ,
153- NewRelicConfig : em .TreatmentServicePluginConfig .NewRelicConfig ,
154- SentryConfig : em .TreatmentServicePluginConfig .SentryConfig ,
155- SegmenterConfig : * treatmentServiceConfig .SegmenterConfig ,
156- }
157- messageQueueKind := * treatmentServiceConfig .MessageQueueConfig .Kind
158- switch messageQueueKind {
159- case schema .MessageQueueKindPubsub :
160- pluginConfig .MessageQueueConfig = common_mq_config.MessageQueueConfig {
161- Kind : "pubsub" ,
162- PubSubConfig : & common_mq_config.PubSubConfig {
163- Project : * treatmentServiceConfig .MessageQueueConfig .PubSub .Project ,
164- TopicName : * treatmentServiceConfig .MessageQueueConfig .PubSub .TopicName ,
165- PubSubTimeoutSeconds : em .TreatmentServicePluginConfig .PubSubTimeoutSeconds ,
166- },
167- }
168- case schema .MessageQueueKindNoop :
169- pluginConfig .MessageQueueConfig = common_mq_config.MessageQueueConfig {
170- Kind : "" ,
171- }
172- default :
173- return nil , fmt .Errorf ("invalid message queue kind (%s) was provided" , messageQueueKind )
144+ Port : em .TreatmentServicePluginConfig .Port ,
145+ ProjectIds : []string {strconv .Itoa (projectID )},
146+ AssignedTreatmentLogger : em .TreatmentServicePluginConfig .AssignedTreatmentLogger ,
147+ DebugConfig : em .TreatmentServicePluginConfig .DebugConfig ,
148+ DeploymentConfig : em .TreatmentServicePluginConfig .DeploymentConfig ,
149+ MessageQueueConfig : em .TreatmentServicePluginConfig .MessageQueueConfig ,
150+ ManagementService : em .TreatmentServicePluginConfig .ManagementService ,
151+ MonitoringConfig : em .TreatmentServicePluginConfig .MonitoringConfig ,
152+ SwaggerConfig : em .TreatmentServicePluginConfig .SwaggerConfig ,
153+ NewRelicConfig : em .TreatmentServicePluginConfig .NewRelicConfig ,
154+ SentryConfig : em .TreatmentServicePluginConfig .SentryConfig ,
155+ SegmenterConfig : * treatmentServiceConfig .SegmenterConfig ,
156+ ManagementServicePollerConfig : em .TreatmentServicePluginConfig .ManagementServicePollerConfig ,
174157 }
175-
176158 return pluginConfig , nil
177159}
178160
0 commit comments