@@ -282,15 +282,15 @@ func run() error {
282282 // Each factory is constructed once and threaded through every consumer of
283283 // it, so a real (stateful) backend introduced later is shared rather than
284284 // silently duplicated across controllers.
285- scf := fakeSourceControlFactory {}
285+ sourceControl := fakeSourceControlFactory {}
286286 brf := fakeBuildRunnerFactory {}
287287
288288 storageFty := storageFactory {backend : store }
289- primaryCount , err := registerPrimaryControllers (primaryConsumer , logger .Sugar (), scope , storageFty , registry , scf , brf )
289+ primaryCount , err := registerPrimaryControllers (primaryConsumer , logger .Sugar (), scope , storageFty , registry , sourceControl , brf )
290290 if err != nil {
291291 return err
292292 }
293- dlqCount , err := registerDLQControllers (dlqConsumer , logger .Sugar (), scope , storageFty , registry )
293+ dlqCount , err := registerDLQControllers (dlqConsumer , logger .Sugar (), scope , storageFty , registry , sourceControl )
294294 if err != nil {
295295 return err
296296 }
@@ -318,7 +318,7 @@ func run() error {
318318 logger .Sugar (),
319319 scope ,
320320 newInMemoryCounterFactory (),
321- scf ,
321+ sourceControl ,
322322 storageFty ,
323323 registry ,
324324 )
@@ -398,7 +398,7 @@ func registerPrimaryControllers(
398398 scope tally.Scope ,
399399 store storage.Factory ,
400400 registry consumer.TopicRegistry ,
401- scf sourcecontrol.Factory ,
401+ sourceControl sourcecontrol.Factory ,
402402 brf buildrunner.Factory ,
403403) (int , error ) {
404404 var count int
@@ -408,7 +408,7 @@ func registerPrimaryControllers(
408408 scope ,
409409 store ,
410410 queueconfigdefault .NewStore (),
411- scf ,
411+ sourceControl ,
412412 registry ,
413413 stovepipemq .TopicKeyProcess ,
414414 "stovepipe-process" ,
@@ -430,7 +430,7 @@ func registerPrimaryControllers(
430430 }
431431 count ++
432432
433- recordController := record .NewController (logger , scope , store , scf , stovepipemq .TopicKeyRecord , "stovepipe-record" )
433+ recordController := record .NewController (logger , scope , store , sourceControl , stovepipemq .TopicKeyRecord , "stovepipe-record" )
434434 if err := c .Register (recordController ); err != nil {
435435 return count , fmt .Errorf ("failed to register record controller: %w" , err )
436436 }
@@ -447,21 +447,34 @@ func registerDLQControllers(
447447 scope tally.Scope ,
448448 store storage.Factory ,
449449 registry consumer.TopicRegistry ,
450+ sourceControl sourcecontrol.Factory ,
450451) (int , error ) {
451452 var count int
452453
453- processDLQController := dlq .NewController (logger , scope , store , dlq .TopicKey (stovepipemq .TopicKeyProcess ), "stovepipe-process-dlq" )
454+ processDLQController := dlq .NewDLQRequestController (logger , scope , store , dlq .TopicKey (stovepipemq .TopicKeyProcess ), "stovepipe-process-dlq" )
454455 if err := c .Register (processDLQController ); err != nil {
455456 return count , fmt .Errorf ("failed to register process dlq controller: %w" , err )
456457 }
457458 count ++
458459
459- buildSignalDLQController := dlq .NewBuildSignalController (logger , scope , store , dlq .TopicKey (stovepipemq .TopicKeyBuildSignal ), "stovepipe-buildsignal-dlq" )
460+ buildDLQController := dlq .NewDLQBuildController (logger , scope , store , dlq .TopicKey (stovepipemq .TopicKeyBuild ), "stovepipe-build-dlq" )
461+ if err := c .Register (buildDLQController ); err != nil {
462+ return count , fmt .Errorf ("failed to register build dlq controller: %w" , err )
463+ }
464+ count ++
465+
466+ buildSignalDLQController := dlq .NewDLQBuildSignalController (logger , scope , store , dlq .TopicKey (stovepipemq .TopicKeyBuildSignal ), "stovepipe-buildsignal-dlq" )
460467 if err := c .Register (buildSignalDLQController ); err != nil {
461468 return count , fmt .Errorf ("failed to register buildsignal dlq controller: %w" , err )
462469 }
463470 count ++
464471
472+ recordDLQController := record .NewController (logger , scope , store , sourceControl , dlq .TopicKey (stovepipemq .TopicKeyRecord ), "stovepipe-record-dlq" )
473+ if err := c .Register (recordDLQController ); err != nil {
474+ return count , fmt .Errorf ("failed to register record dlq controller: %w" , err )
475+ }
476+ count ++
477+
465478 return count , nil
466479}
467480
@@ -511,12 +524,24 @@ func newTopicRegistry(q extqueue.Queue, subscriberName string) (consumer.TopicRe
511524 Queue : q ,
512525 Subscription : extqueue .DLQSubscriptionConfig (subscriberName , "stovepipe-process-dlq" ),
513526 },
527+ {
528+ Key : dlq .TopicKey (stovepipemq .TopicKeyBuild ),
529+ Name : "build_dlq" ,
530+ Queue : q ,
531+ Subscription : extqueue .DLQSubscriptionConfig (subscriberName , "stovepipe-build-dlq" ),
532+ },
514533 {
515534 Key : dlq .TopicKey (stovepipemq .TopicKeyBuildSignal ),
516535 Name : "buildsignal_dlq" ,
517536 Queue : q ,
518537 Subscription : extqueue .DLQSubscriptionConfig (subscriberName , "stovepipe-buildsignal-dlq" ),
519538 },
539+ {
540+ Key : dlq .TopicKey (stovepipemq .TopicKeyRecord ),
541+ Name : "record_dlq" ,
542+ Queue : q ,
543+ Subscription : extqueue .DLQSubscriptionConfig (subscriberName , "stovepipe-record-dlq" ),
544+ },
520545 })
521546}
522547
0 commit comments