@@ -235,6 +235,11 @@ func filterWorkerHandler(cfg *serviceConfig, flagParam *flagParameter) (wording
235
235
options = append (options , fmt .Sprintf ("%d) AMQ (STOMP) Consumer (plugin)" , len (options )+ 1 ))
236
236
handlers [strconv .Itoa (len (options ))] = pluginSTOMPWorker
237
237
}
238
+ if flagParam .addModule || flagParam .initService || (flagParam .addHandler &&
239
+ validateDir (flagParam .getFullModuleChildDir ("delivery" , "workerhandler" , strings .ToLower (pluginMQTTWorker )+ "_handler.go" )) != nil ) {
240
+ options = append (options , fmt .Sprintf ("%d) MQTT Subscriber (plugin)" , len (options )+ 1 ))
241
+ handlers [strconv .Itoa (len (options ))] = pluginMQTTWorker
242
+ }
238
243
239
244
wording = strings .Join (options , "\n " )
240
245
return
@@ -366,18 +371,16 @@ func getNeedFileUpdates(srvConfig *serviceConfig) (fileUpdates []fileUpdate) {
366
371
})
367
372
}
368
373
for _ , module := range srvConfig .Modules {
369
- if module .Skip {
374
+ if module .Skip && ! srvConfig . flag . addHandler {
370
375
continue
371
376
}
372
377
moduleName := cleanSpecialChar .Replace (module .ModuleName )
373
378
deliveryPackageDir := fmt .Sprintf (`"%s/internal/modules/%s/delivery` , module .PackagePrefix , moduleName )
374
- if ! module .IsWorkerActive {
375
- fileUpdates = append (fileUpdates , fileUpdate {
376
- filepath : rootDir + "internal/modules/" + moduleName + "/module.go" ,
377
- oldContent : "// " + deliveryPackageDir + "/workerhandler" ,
378
- newContent : deliveryPackageDir + "/workerhandler" ,
379
- })
380
- }
379
+ fileUpdates = append (fileUpdates , fileUpdate {
380
+ filepath : rootDir + "internal/modules/" + moduleName + "/module.go" ,
381
+ oldContent : "// " + deliveryPackageDir + "/workerhandler" ,
382
+ newContent : deliveryPackageDir + "/workerhandler" ,
383
+ })
381
384
for before , after := range pl .editModule {
382
385
fileUpdates = append (fileUpdates , fileUpdate {
383
386
filepath : rootDir + "internal/modules/" + moduleName + "/module.go" ,
@@ -505,11 +508,15 @@ func getAllModuleHandler(path string) (wording string, handlers map[string]strin
505
508
}
506
509
if validateDir (path + "/workerhandler/" + strings .ToLower (pluginGCPPubSubWorker )+ "_handler.go" ) == nil {
507
510
options = append (options , fmt .Sprintf ("%d) GCP PubSub Subscriber (plugin)" , len (options )+ 1 ))
508
- handlers [strconv .Itoa (len (options ))] = RabbitmqHandler
511
+ handlers [strconv .Itoa (len (options ))] = pluginGCPPubSubWorker
509
512
}
510
513
if validateDir (path + "/workerhandler/" + strings .ToLower (pluginSTOMPWorker )+ "_handler.go" ) == nil {
511
514
options = append (options , fmt .Sprintf ("%d) AMQ (STOMP) Consumer (plugin)" , len (options )+ 1 ))
512
- handlers [strconv .Itoa (len (options ))] = RabbitmqHandler
515
+ handlers [strconv .Itoa (len (options ))] = pluginSTOMPWorker
516
+ }
517
+ if validateDir (path + "/workerhandler/" + strings .ToLower (pluginMQTTWorker )+ "_handler.go" ) == nil {
518
+ options = append (options , fmt .Sprintf ("%d) MQTT Subscriber (plugin)" , len (options )+ 1 ))
519
+ handlers [strconv .Itoa (len (options ))] = pluginMQTTWorker
513
520
}
514
521
515
522
wording = strings .Join (options , "\n " )
0 commit comments