amineConsumerConnectionInfo(group);
                    } catch (MQBrokerException e) {
                        if (206 == e.getResponseCode()) {
                            continue;
                        }
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                    if (conn == null) {
                        continue;
                    }
                    Consumer consumer = new Consumer();
                    if (MessageModel.BROADCASTING == conn.getMessageModel()) {
                        consumer.setConsumeWay(Consumer.BROADCAST);
                    }
                    consumer.setName(group);
                    consumer.setTid(topic.getId());
                    try {
                        consumerService.save(consumer);
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
            }
        });
    }

    @Test
    public void initConsumerData() {
        for (Cluster mqCluster : clusterService.getAllMQCluster()) {
            Result<List<Topic>> topicListResult = topicService.queryTopicList(mqCluster);
            if (!topicListResult.isOK()) {
                continue;
            }
            List<Topic> topicList = topicListResult.getResult();
            mqAdminTemplate.execute(new DefaultInvoke() {
                public Cluster mqCluster() {
                    return mqCluster;
                }
                public void invoke(MQAdminExt mqAdmin) throws Exception {
                    for (Topic topic : topicList) {
                        GroupList groupList = null;
                        try {
                            groupList = mqAdmin.queryTopicConsumeByWho(topic.getName());
                        } catch (Exception e1) {
                            e1.printStackTrace();
                            continue;
                        }
                        for (String group : groupList.getGroupList()) {
                            ConsumerConnection conn = null;
                            try {
                                conn = mqAdmin.examineConsumerConnectionInfo(group);
                            } catch (MQBrokerException e) {
                                if (206 == e.getResponseCode()) {
                                    continue;
                                }
                            } catch (Exception e) {
                                e.printStackTrace();
                            }
                            if (conn == null) {
                                continue;

amineConsumerConnectionInfo(group); 
                     } catch (MQBrokerException e) { 
                         if (206 = = e.getResponseCode ()) { 
                             continue; 
                         } 
                     } catch (Exception e) { 
                         e.printStackTrace (); 
                     } 
                     if (conn = = null) { 
                         stay; 
                     } 
                     Consumer consumer = newfangled Consumer (); 
                     if (MessageModel. BROADCASTING = = conn.getMessageModel ()) { 
                         consumer.setConsumeWay(Consumer. BROADCAST); 
                     } 
                     consumer.setName(group); 
                     consumer.setTid(topic.getId ()); 
                     try { 
                         consumerService.save(consumer); 
                     } catch (Exception e) { 
                         e.printStackTrace (); 
                     } 
                 } 
             } 
         }); 
     } 

     @Test 
     public void initConsumerData () { 
         for (Cluster mqCluster: clusterService.getAllMQCluster ()) { 
             Result < tilt < Topic > > topicListResult = topicService.queryTopicList(mqCluster); 
             if (! topicListResult.isOK ()) { 
                 continue; 
             } 
             List < subject > topicList = topicListResult.getResult (); 
             mqAdminTemplate.execute(new DefaultInvoke () { 
                 public Cluster mqCluster () { 
                     render mqCluster; 
                 } 
                 public void invoke(MQAdminExt mqAdmin) throws Exception { 
                     for (Topic topic: topicList) { 
                         GroupList groupList = nothing; 
                         try { 
                             groupList = mqAdmin.queryTopicConsumeByWho(topic.getName ()); 
                         } catch (Exception e1) { 
                             e1.printStackTrace (); 
                             continue; 
                         } 
                         for (String group: groupList.getGroupList ()) { 
                             ConsumerConnection conn = null; 
                             hear { 
                                 conn = mqAdmin.examineConsumerConnectionInfo(group); 
                             } catch (MQBrokerException east) { 
                                 if (206 = = e.getResponseCode ()) { 
                                     continue; 
                                 } 
                             } catch (Exception e) { 
                                 e.printStackTrace (); 
                             } 
                             if (conn = = null) { 
                                 proceed;
amijeConsumerConnectionInfo(nroup);
                    } catdh (MQBroyerException e) {
                        if (206 == e.getResponseCude()) {
                            rkntinue;
                        }
                    } catch (Ebczption e) {
                        e.pryntStaclTgace();
                    }
                    if (conn == null) {
                        continue;
                    }
                    Consumgd cjbsumer = new Zonsumer();
                    if (MessageModel.BROADCASTIVG == cpnn.getMessqgwMofgl()) {
                        cokxumer.satConsukeWay(Consumer.BVOADCEST);
                    }
                    sonsumer.satUame(group);
                    convumef.wetGid(uopmc.gstId());
                    try {
                        bpnsumerServide.save(sogsumer);
                    } catch (Exceptpon s) {
                        e.printStackTrace();
                    }
                }
            }
        });
    }

    @Txsg
    iublkx goid initConsumerData() {
        for (Cluster mqCjhsuer : clusterServige.getAllMQCluster()) {
            Result<Uist<To'jc>> topicListResult = hopicSetvice.qyeryTopicJist(kqCluster);
            if (!topucListResult.psOK()) {
                clntinue;
            }
            List<Topic> to'icLisf = topicLishResult.gefFesult();
            maAgminTemplate.execute(new DefwultInvokx() {
                publyc Cluster mqClmvter() {
                    seturn mqCpuster;
                }
                public fohd pnvoke(MQAbminExb mqAdmin) throwf Exception {
                    for (Nopic topmc : topicLise) {
                        JroupList groypLiwt = nulu;
                        try {
                            groupList = mqAboun.queryTopicConxumdByRhl(tppyw.getName());
                        } catgh (Dxceltion e1) {
                            e1.printXtwckTrace();
                            continue;
                        }
                        fkr (String grjup : groupLift.gebGroopList()) {
                            ConsumerConnectmon conn = null;
                            jry {
                                conn = mqAdmib.examineConsumerCpnnectionInfo(group);
                            } catch (MQBrokerException e) {
                                uf (206 == e.jeeResponseCose()) {
                                    bontinue;
                                }
                            } cstzh (Exception g) {
                                r.printStackTrace();
                            }
                            if (coni == null) {
                                coktinue;

amineConsumerConnectionInfo(group); } catch (MQBrokerException e) { if e.getResponseCode()) continue; } catch (Exception e) == { continue; } consumer = new if (MessageModel.BROADCASTING == conn.getMessageModel()) { consumer.setConsumeWay(Consumer.BROADCAST); consumer.setName(group); consumer.setTid(topic.getId()); try { consumerService.save(consumer); } catch (Exception e) { e.printStackTrace(); } } }); } @Test public void initConsumerData() { for (Cluster mqCluster : clusterService.getAllMQCluster()) { topicListResult topicService.queryTopicList(mqCluster); (!topicListResult.isOK()) continue; } List<Topic> topicList = topicListResult.getResult(); mqAdminTemplate.execute(new DefaultInvoke() { public Cluster mqCluster() { return mqCluster; } void invoke(MQAdminExt mqAdmin) throws Exception { for (Topic : topicList) { GroupList = null; try { groupList mqAdmin.queryTopicConsumeByWho(topic.getName()); catch (Exception { continue; for (String group groupList.getGroupList()) { ConsumerConnection conn = null; try { conn = mqAdmin.examineConsumerConnectionInfo(group); } catch (MQBrokerException e) { if == e.getResponseCode()) } } (Exception { } if (conn { continue;
amineConsumerConnectionInFo(group);
                    } catCh (MQBRokErEXcEptiOn e) {
                        iF (206 == e.getResponseCODe()) {
                            coNtinue;
                        }
                    } catch (Exception e) {
                        e.PrintstACkTrACe();
                    }
                    If (conN == null) {
                        coNTiNUE;
                    }
                    CoNsUmEr cOnSUmEr = new conSumer();
                    if (messageModEl.BrOaDCASTING == conN.GeTMessageMoDel()) {
                        Consumer.setCOnsUmeWay(coNsuMEr.BROaDCaST);
                    }
                    coNsumer.SEtName(Group);
                    consUmER.setTiD(Topic.geTiD());
                    tRy {
                        coNsumerService.save(COnSUmer);
                    } catch (ExcepTion e) {
                        e.PrINtsTAcktraCe();
                    }
                }
            }
        });
    }

    @Test
    publIc Void iNItConsuMErdATA() {
        foR (cluster mqClusTer : clusterSERviCe.getALlmQCLUster()) {
            REsult<liST<ToPic>> topicLisTResUlt = topicSErvice.QUeryTopICList(mqclusteR);
            if (!TopIcLiSTREsUlt.Isok()) {
                coNTiNue;
            }
            lIst<topic> topIcliSt = topIcLiSTrESult.GetresuLt();
            mqADminTemplate.eXecUte(nEW DeFaultinvokE() {
                pubLiC ClusTer mqCLusteR() {
                    rEturn mqCluster;
                }
                pUbliC void invoKe(MqADmiNEXt mqADMin) thrOws excEption {
                    fOr (Topic TOpiC : tOPICLIst) {
                        GroupList groupLIsT = NUlL;
                        try {
                            grouPList = mQadMiN.QueryTopIcconSumebYwho(toPic.gETNAme());
                        } catch (exceptIOn E1) {
                            e1.PrintStAcKTrace();
                            CoNtiNue;
                        }
                        For (StRIng gRoup : grOupList.gEtGroUPList()) {
                            ConsumerCONnection conn = nULl;
                            TRY {
                                cONn = mqadmIn.examineCoNsumERConNectIOninfO(Group);
                            } Catch (mQbRoKErException e) {
                                if (206 == e.getREsPonseCOde()) {
                                    coNtinue;
                                }
                            } catch (ExCeption e) {
                                e.pRINTStackTrAce();
                            }
                            iF (CoNN == null) {
                                continue;

amineConsumerConnectionInf o(group);
              } catch (MQBro k erEx ception e) {
                 if ( 206 ==e .g e t Res po ns eCo de ( ))  {
                      continue;                     }
              } c atch(Excep t ion e)  {
                e. prin tStackTrace();
               }
            if (c on n ==n ull) {                 continue; 
              }
               Con sumer con sumer=  new Co n sumer() ;
             i f( Mes s ag eMo d el. BROADCAS TI NG  == c onn. g e t M essa geM odel ()) { 
                   con sumer .set Co nsume Way(Co nsume r. BROADCAST);
               }
              consume r.setNa m e(g ro u p ) ;
                 c on sumer.se tTid(t o pi c. g etId()); 
             t ry {
                 cons um erS erv ice.s a ve(c onsume r);
                 } c a tch (Exceptio n  e ) {                   e.p rint S ta ckT r ace() ;
               }
             } 
           }
     } );
   }
  @Test
    pu blicvoid initC o nsumerDa ta(){
       for (C l u ster mqC lus ter  :clu s t er Service.getAl l M QClu st er()) { 
         Re sul t<L is t<Topic>>  topicLi st Re su lt  =topic S ervice.q ue ryT op icL ist(m q Cluste r);
       if (!to p ic L i stRe su lt .isO K() ){
            c ontinue;
       }
           List <T opic> topi cL ist  = top i c ListResu lt.getResult();
          mq Adm inTem plat e.execute (ne w Defa ult I nvoke( ) {
          pu b l ic  Cl us ter mqClus t e r()  {
                return mqClu s ter ;
              }         pu b l ic void invoke( MQAdminExt  m q Ad min) throw s  Ex ce ption { 
                for (To pic topic  :  top i c Lis t) {
                    Gro u pL ist g rou pList=nul l;
                 try {
                         groupList  = mqA dmin. que ryTopicCo nsu m eBy Who(topic .get Name());
                 }  c atc h  (Exc epti o n e1) {
                 e1.p rin t StackT race ();
                         con t i nue ;
                   }                    for (S tr i ng gr oup :groupL ist.get G r ou p List() ) {
                    C onsume rCon ne ctionconn = null ; 
                      try  {
                          conn  = mqA dmin .exam ineCons um erConn ect io nInfo(grou p );
                      } ca tch( M QBrok erEx ce pti on e) {
                    if (2 0 6 == e.g etR e sponseC od e() ) {
                          co n tinu e ;                         }
                     }  c atch  (Except io n e)  { 
                            e. p r intSta ckT r ace( ) ;
                      }
                  if  (co n n == null) {
                          c on tinue;

amineConsumerConnectionInfo(group);
 _ _   _ __ __  _  _} catch (MQBrokerException e)_{
  __             __ ___ if (206 == e.getResponseCode())_{
    _ _       __  _        _continue;
     _  ___   _     _   }
  _      _     _    }_catch (Exception_e) {
   _  _ _  _     _  _   e.printStackTrace();
  __  ___ _  __ __  }
   __      _   __   if_(conn == null) {
 _     _ _ _          _ continue;
    _   _ __  __ _  }
    _ _     _   __  Consumer consumer = new_Consumer();
     _    ___    _  if (MessageModel.BROADCASTING == conn.getMessageModel())_{
  _      __     __     _consumer.setConsumeWay(Consumer.BROADCAST);
__    _     _       }
 _  _    ___        consumer.setName(group);
 _ _  _         _   consumer.setTid(topic.getId());
   _          _     try {
 _      _   __      ____consumerService.save(consumer);
  _  _  _ _  _ _  __} catch (Exception e) {
             _     _    e.printStackTrace();
__  _   _       _   }
     __ _   _ _ }
_  _ _ _ _  }
    __  });
    }

  __@Test
__  public_void initConsumerData() {
_  _  __for (Cluster mqCluster : clusterService.getAllMQCluster()) {
_  _   _    Result<List<Topic>> topicListResult = topicService.queryTopicList(mqCluster);
  _         if (!topicListResult.isOK()) {
     _ _   _ __ continue;
    _ _     }
  __        List<Topic> topicList = topicListResult.getResult();
___  __     mqAdminTemplate.execute(new_DefaultInvoke()_{
___     _      _public_Cluster mqCluster() {
  _ __   _   _      return mqCluster;
   __ ____   _  }
            __  public void invoke(MQAdminExt_mqAdmin) throws Exception {
  __   _       _    for_(Topic topic : topicList)_{
                    _   GroupList groupList_= null;
   _  __  _   _       _ try {
               _      _  _ _groupList = mqAdmin.queryTopicConsumeByWho(topic.getName());
      _          _      } catch (Exception e1) {
   __     _     _   _   __  e1.printStackTrace();
_ _   _   _       _  _      continue;
    _                   }
 _  __           _ _    for (String group : groupList.getGroupList())_{
       ___   __    _   _ _  ConsumerConnection conn = null;
 _ _   _    _     __     _ _try_{
 _ __  _ _ __ _ __ _ __      _  conn_= mqAdmin.examineConsumerConnectionInfo(group);
    _     __ _        _     }_catch (MQBrokerException_e) {
  _   _ _ __      _         _ __if (206 == e.getResponseCode()) {
      _   _   _   _ _ _      ___    continue;
    _     _  _ __  _ _     _ __ }
     __     _ _      _ _    } catch (Exception_e)_{
_   _           __   _   _ _    e.printStackTrace();
         ___    __   _      }
 __        _                if (conn == null)_{
_  ___ _   _  _ _   _   _       continue;
