package Ġcom . tencent . bk . code cc . code cc job . component Ċ Ċ import Ġcom . fasterxml . jackson . databind . ObjectMapper Ċ import Ġcom . tencent . bk . code cc . code cc job . consumer . Issue System Submit Consumer Ċ import Ġcom . tencent . devops . common . web . mq . EX CHANGE _ ISSUE _ SYSTEM _ SUBMIT Ċ import Ġcom . tencent . devops . common . web . mq . EX CHANGE _ ISSUE _ SYSTEM _ SUBMIT _ AUTO Ċ import Ġcom . tencent . devops . common . web . mq . EX CHANGE _ ISSUE _ SYSTEM _ SUBMIT _ COUNT Ċ import Ġcom . tencent . devops . common . web . mq . EX CHANGE _ ISSUE _ SYSTEM _ SUBMIT _ H IS Ċ import Ġcom . tencent . devops . common . web . mq . QUEUE _ ISSUE _ SYSTEM _ SUBMIT Ċ import Ġcom . tencent . devops . common . web . mq . QUEUE _ ISSUE _ SYSTEM _ SUBMIT _ AUTO Ċ import Ġcom . tencent . devops . common . web . mq . QUEUE _ ISSUE _ SYSTEM _ SUBMIT _ COUNT Ċ import Ġcom . tencent . devops . common . web . mq . QUEUE _ ISSUE _ SYSTEM _ SUBMIT _ H IS Ċ import Ġcom . tencent . devops . common . web . mq . ROUTE _ ISSUE _ SYSTEM _ SUBMIT Ċ import Ġcom . tencent . devops . common . web . mq . ROUTE _ ISSUE _ SYSTEM _ SUBMIT _ AUTO Ċ import Ġcom . tencent . devops . common . web . mq . ROUTE _ ISSUE _ SYSTEM _ SUBMIT _ COUNT Ċ import Ġcom . tencent . devops . common . web . mq . ROUTE _ ISSUE _ SYSTEM _ SUBMIT _ H IS Ċ import Ġorg . springframework . amqp . core . Binding Ċ import Ġorg . springframework . amqp . core . Binding Builder Ċ import Ġorg . springframework . amqp . core . Custom Exchange Ċ import Ġorg . springframework . amqp . core . Queue Ċ import Ġorg . springframework . amqp . rabbit . connection . ConnectionFactory Ċ import Ġorg . springframework . amqp . rabbit . listener . Simple Message Listener Container Ċ import Ġorg . springframework . amqp . rabbit . listener . adapter . Message Listener Adapter Ċ import Ġorg . springframework . amqp . support . converter . Jack son 2 Json Message Converter Ċ import Ġorg . springframework . beans . factory . annotation . Autowired Ċ import Ġorg . springframework . context . annotation . Bean Ċ import Ġorg . springframework . context . annotation . Configuration Ċ Ċ @ Configuration Ċ class ĠTask Issue System MQ Config Ġ{ ĊĊĠĠĠ Ġ// Ġmanual Ġsubmit Ġconfig ĊĊĠĠĠ Ġ@ Bean ĊĠĠĠ Ġfun Ġtask Issue System Exchange (): ĠCustom Exchange Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠCustom Exchange ( EX CHANGE _ ISSUE _ SYSTEM _ SUBMIT , Ġ" x - delayed - message ", Ġtrue , Ġfalse , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmap Of (" x - delayed - type " Ġto Ġ" direct ")) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Bean ĊĠĠĠ Ġfun Ġmessage Converter ( object Mapper : ĠObjectMapper ) Ġ= ĠJack son 2 Json Message Converter ( object Mapper ) ĊĊĠĠĠ Ġ@ Bean ĊĠĠĠ Ġfun Ġtask Issue System Queue () Ġ= ĠQueue ( QUEUE _ ISSUE _ SYSTEM _ SUBMIT ) ĊĊĠĠĠ Ġ@ Bean ĊĠĠĠ Ġfun Ġtask Issue System Queue Bind ( ĊĠĠĠĠĠĠĠ Ġ@ Autowired Ġtask Issue System Queue : ĠQueue , ĊĠĠĠĠĠĠĠ Ġ@ Autowired Ġtask Issue System Exchange : ĠCustom Exchange ĊĠĠĠ Ġ): ĠBinding Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠBinding Builder . bind ( task Issue System Queue ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. to ( task Issue System Exchange ). with ( ROUTE _ ISSUE _ SYSTEM _ SUBMIT ). no args () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Bean ĊĠĠĠ Ġfun Ġtask Issue System Listener Container ( ĊĠĠĠĠĠĠĠ Ġ@ Autowired Ġconnection Factory : ĠConnection Factory , ĊĠĠĠĠĠĠĠ Ġ@ Autowired Ġtask Issue System Queue : ĠQueue , ĊĠĠĠĠĠĠĠ Ġ@ Autowired Ġissue System Submit Consumer : ĠIssue System Submit Consumer , ĊĠĠĠĠĠĠĠ Ġ@ Autowired Ġmessage Converter : ĠJack son 2 Json Message Converter ĊĠĠĠ Ġ): ĠSimple Message Listener Container Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġcontainer Ġ= ĠSimple Message Listener Container ( connection Factory ) ĊĠĠĠĠĠĠĠ Ġcontainer . set Queue Names ( task Issue System Queue . name ) ĊĠĠĠĠĠĠĠ Ġcontainer . set Concurrent Consum ers ( 1 0 ) ĊĠĠĠĠĠĠĠ Ġcontainer . setMax Concurrent Consum ers ( 1 0 ) ĊĠĠĠĠĠĠĠ Ġcontainer . set Start Consumer Min Interval ( 1 0 0 0 0 ) ĊĠĠĠĠĠĠĠ Ġcontainer . set Con secutive Active Trigger ( 1 0 ) ĊĠĠĠĠĠĠĠ Ġval Ġadapter Ġ= ĠMessage Listener Adapter ( issue System Submit Consumer , Ġissue System Submit Consumer :: submit . name ) ĊĠĠĠĠĠĠĠ Ġadapter . setMessage Converter ( message Converter ) ĊĠĠĠĠĠĠĠ Ġcontainer . setMessage Listener ( adapter ) ĊĠĠĠĠĠĠĠ Ġreturn Ġcontainer ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ// Ġauto Ġsubmit Ġconfig ĊĊĠĠĠ Ġ@ Bean ĊĠĠĠ Ġfun Ġtask Issue System Auto Exchange (): ĠCustom Exchange Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠCustom Exchange ( EX CHANGE _ ISSUE _ SYSTEM _ SUBMIT _ AUTO , Ġ" x - delayed - message ", Ġtrue , Ġfalse , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmap Of (" x - delayed - type " Ġto Ġ" direct ")) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Bean ĊĠĠĠ Ġfun Ġtask Issue System Auto Queue () Ġ= ĠQueue ( QUEUE _ ISSUE _ SYSTEM _ SUBMIT _ AUTO ) ĊĊĠĠĠ Ġ@ Bean ĊĠĠĠ Ġfun Ġtask Issue System Queue Auto Bind ( ĊĠĠĠĠĠĠĠ Ġ@ Autowired Ġtask Issue System Auto Queue : ĠQueue , ĊĠĠĠĠĠĠĠ Ġ@ Autowired Ġtask Issue System Auto Exchange : ĠCustom Exchange ĊĠĠĠ Ġ): ĠBinding Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠBinding Builder . bind ( task Issue System Auto Queue ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. to ( task Issue System Auto Exchange ). with ( ROUTE _ ISSUE _ SYSTEM _ SUBMIT _ AUTO ). no args () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Bean ĊĠĠĠ Ġfun Ġtask Issue System Lint Auto Listener Container ( ĊĠĠĠĠĠĠĠ Ġ@ Autowired Ġconnection Factory : ĠConnection Factory , ĊĠĠĠĠĠĠĠ Ġ@ Autowired Ġtask Issue System Auto Queue : ĠQueue , ĊĠĠĠĠĠĠĠ Ġ@ Autowired Ġissue System Submit Consumer : ĠIssue System Submit Consumer , ĊĠĠĠĠĠĠĠ Ġ@ Autowired Ġmessage Converter : ĠJack son 2 Json Message Converter ĊĠĠĠ Ġ): ĠSimple Message Listener Container Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġcontainer Ġ= ĠSimple Message Listener Container ( connection Factory ) ĊĠĠĠĠĠĠĠ Ġcontainer . set Queue Names ( task Issue System Auto Queue . name ) ĊĠĠĠĠĠĠĠ Ġcontainer . set Concurrent Consum ers ( 1 0 ) ĊĠĠĠĠĠĠĠ Ġcontainer . setMax Concurrent Consum ers ( 1 0 ) ĊĠĠĠĠĠĠĠ Ġcontainer . set Start Consumer Min Interval ( 1 0 0 0 0 ) ĊĠĠĠĠĠĠĠ Ġcontainer . set Con secutive Active Trigger ( 1 0 ) ĊĠĠĠĠĠĠĠ Ġval Ġadapter Ġ= ĠMessage Listener Adapter ( issue System Submit Consumer , Ġissue System Submit Consumer :: do Auto Submit . name ) ĊĠĠĠĠĠĠĠ Ġadapter . setMessage Converter ( message Converter ) ĊĠĠĠĠĠĠĠ Ġcontainer . setMessage Listener ( adapter ) ĊĠĠĠĠĠĠĠ Ġreturn Ġcontainer ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ// Ġauto Ġhis Ġsubmit Ġconfig ĊĊĠĠĠ Ġ@ Bean ĊĠĠĠ Ġfun Ġtask Issue System Auto H is Exchange (): ĠCustom Exchange Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠCustom Exchange ( EX CHANGE _ ISSUE _ SYSTEM _ SUBMIT _ H IS , Ġ" x - delayed - message ", Ġtrue , Ġfalse , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmap Of (" x - delayed - type " Ġto Ġ" direct ")) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Bean ĊĠĠĠ Ġfun Ġtask Issue System Auto H is Queue () Ġ= ĠQueue ( QUEUE _ ISSUE _ SYSTEM _ SUBMIT _ H IS ) ĊĊĠĠĠ Ġ@ Bean ĊĠĠĠ Ġfun Ġtask Issue System Queue Auto H is Bind ( ĊĠĠĠĠĠĠĠ Ġ@ Autowired Ġtask Issue System Auto H is Queue : ĠQueue , ĊĠĠĠĠĠĠĠ Ġ@ Autowired Ġtask Issue System Auto H is Exchange : ĠCustom Exchange ĊĠĠĠ Ġ): ĠBinding Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠBinding Builder . bind ( task Issue System Auto H is Queue ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. to ( task Issue System Auto H is Exchange ). with ( ROUTE _ ISSUE _ SYSTEM _ SUBMIT _ H IS ). no args () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Bean ĊĠĠĠ Ġfun Ġtask Issue System Auto H is Listener Container ( ĊĠĠĠĠĠĠĠ Ġ@ Autowired Ġconnection Factory : ĠConnection Factory , ĊĠĠĠĠĠĠĠ Ġ@ Autowired Ġtask Issue System Auto H is Queue : ĠQueue , ĊĠĠĠĠĠĠĠ Ġ@ Autowired Ġissue System Submit Consumer : ĠIssue System Submit Consumer , ĊĠĠĠĠĠĠĠ Ġ@ Autowired Ġmessage Converter : ĠJack son 2 Json Message Converter ĊĠĠĠ Ġ): ĠSimple Message Listener Container Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġcontainer Ġ= ĠSimple Message Listener Container ( connection Factory ) ĊĠĠĠĠĠĠĠ Ġcontainer . set Queue Names ( task Issue System Auto H is Queue . name ) ĊĠĠĠĠĠĠĠ Ġcontainer . set Concurrent Consum ers ( 1 0 ) ĊĠĠĠĠĠĠĠ Ġcontainer . setMax Concurrent Consum ers ( 1 0 ) ĊĠĠĠĠĠĠĠ Ġcontainer . set Start Consumer Min Interval ( 1 0 0 0 0 ) ĊĠĠĠĠĠĠĠ Ġcontainer . set Con secutive Active Trigger ( 1 0 ) ĊĠĠĠĠĠĠĠ Ġval Ġadapter Ġ= ĠMessage Listener Adapter ( issue System Submit Consumer , Ġissue System Submit Consumer :: auto H is Submit . name ) ĊĠĠĠĠĠĠĠ Ġadapter . setMessage Converter ( message Converter ) ĊĠĠĠĠĠĠĠ Ġcontainer . setMessage Listener ( adapter ) ĊĠĠĠĠĠĠĠ Ġreturn Ġcontainer ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ// Ġtask Ġissue Ġcount Ġconfig ĊĊĠĠĠ Ġ@ Bean ĊĠĠĠ Ġfun Ġtask Issue Count Exchange (): ĠCustom Exchange Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠCustom Exchange ( EX CHANGE _ ISSUE _ SYSTEM _ SUBMIT _ COUNT , Ġ" x - delayed - message ", Ġtrue , Ġfalse , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmap Of (" x - delayed - type " Ġto Ġ" direct ")) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Bean ĊĠĠĠ Ġfun Ġtask Issue Count Queue () Ġ= ĠQueue ( QUEUE _ ISSUE _ SYSTEM _ SUBMIT _ COUNT ) ĊĊĠĠĠ Ġ@ Bean ĊĠĠĠ Ġfun Ġtask Issue Queue Count Bind ( ĊĠĠĠĠĠĠĠ Ġ@ Autowired Ġtask Issue Count Queue : ĠQueue , ĊĠĠĠĠĠĠĠ Ġ@ Autowired Ġtask Issue Count Exchange : ĠCustom Exchange ĊĠĠĠ Ġ): ĠBinding Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠBinding Builder . bind ( task Issue Count Queue ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. to ( task Issue Count Exchange ). with ( ROUTE _ ISSUE _ SYSTEM _ SUBMIT _ COUNT ). no args () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Bean ĊĠĠĠ Ġfun Ġtask Issue Count Listener Container ( ĊĠĠĠĠĠĠĠ Ġ@ Autowired Ġconnection Factory : ĠConnection Factory , ĊĠĠĠĠĠĠĠ Ġ@ Autowired Ġtask Issue Count Queue : ĠQueue , ĊĠĠĠĠĠĠĠ Ġ@ Autowired Ġissue System Submit Consumer : ĠIssue System Submit Consumer , ĊĠĠĠĠĠĠĠ Ġ@ Autowired Ġmessage Converter : ĠJack son 2 Json Message Converter ĊĠĠĠ Ġ): ĠSimple Message Listener Container Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġcontainer Ġ= ĠSimple Message Listener Container ( connection Factory ) ĊĠĠĠĠĠĠĠ Ġcontainer . set Queue Names ( task Issue Count Queue . name ) ĊĠĠĠĠĠĠĠ Ġcontainer . set Concurrent Consum ers ( 1 0 ) ĊĠĠĠĠĠĠĠ Ġcontainer . setMax Concurrent Consum ers ( 1 0 ) ĊĠĠĠĠĠĠĠ Ġcontainer . set Start Consumer Min Interval ( 1 0 0 0 0 ) ĊĠĠĠĠĠĠĠ Ġcontainer . set Con secutive Active Trigger ( 1 0 ) ĊĠĠĠĠĠĠĠ Ġval Ġadapter Ġ= ĠMessage Listener Adapter ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġissue System Submit Consumer , Ġissue System Submit Consumer :: update Task Issue Count . name ) ĊĠĠĠĠĠĠĠ Ġadapter . setMessage Converter ( message Converter ) ĊĠĠĠĠĠĠĠ Ġcontainer . setMessage Listener ( adapter ) ĊĠĠĠĠĠĠĠ Ġreturn Ġcontainer ĊĠĠĠ Ġ} Ċ }