@@ -235,6 +235,11 @@ func filterWorkerHandler(cfg *serviceConfig, flagParam *flagParameter) (wording
235235 options = append (options , fmt .Sprintf ("%d) AMQ (STOMP) Consumer (plugin)" , len (options )+ 1 ))
236236 handlers [strconv .Itoa (len (options ))] = pluginSTOMPWorker
237237 }
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+ }
238243
239244 wording = strings .Join (options , "\n " )
240245 return
@@ -366,18 +371,16 @@ func getNeedFileUpdates(srvConfig *serviceConfig) (fileUpdates []fileUpdate) {
366371 })
367372 }
368373 for _ , module := range srvConfig .Modules {
369- if module .Skip {
374+ if module .Skip && ! srvConfig . flag . addHandler {
370375 continue
371376 }
372377 moduleName := cleanSpecialChar .Replace (module .ModuleName )
373378 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+ })
381384 for before , after := range pl .editModule {
382385 fileUpdates = append (fileUpdates , fileUpdate {
383386 filepath : rootDir + "internal/modules/" + moduleName + "/module.go" ,
@@ -505,11 +508,15 @@ func getAllModuleHandler(path string) (wording string, handlers map[string]strin
505508 }
506509 if validateDir (path + "/workerhandler/" + strings .ToLower (pluginGCPPubSubWorker )+ "_handler.go" ) == nil {
507510 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
509512 }
510513 if validateDir (path + "/workerhandler/" + strings .ToLower (pluginSTOMPWorker )+ "_handler.go" ) == nil {
511514 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
513520 }
514521
515522 wording = strings .Join (options , "\n " )
0 commit comments