@@ -14,7 +14,6 @@ import (
14
14
15
15
xpclient "github.com/caraml-dev/xp/clients/management"
16
16
"github.com/caraml-dev/xp/common/api/schema"
17
- common_mq_config "github.com/caraml-dev/xp/common/messagequeue"
18
17
_config "github.com/caraml-dev/xp/plugins/turing/config"
19
18
"github.com/caraml-dev/xp/treatment-service/config"
20
19
"github.com/go-playground/validator/v10"
@@ -142,37 +141,20 @@ func (em *experimentManager) MakeTreatmentServicePluginConfig(
142
141
projectID int ,
143
142
) (* config.Config , error ) {
144
143
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 ,
174
157
}
175
-
176
158
return pluginConfig , nil
177
159
}
178
160
0 commit comments