@@ -65,26 +65,26 @@ public void notifyConsumerManager(String consumerGroup, ConsumerGroupConf latest
6565
6666 if (latestConsumerGroupConfig == null ) {
6767 ConsumerGroupStateEvent notification = new ConsumerGroupStateEvent ();
68- notification .action = ConsumerGroupStateEvent .ConsumerGroupStateAction .DELETE ;
69- notification .consumerGroup = consumerGroup ;
68+ notification .setAction ( ConsumerGroupStateEvent .ConsumerGroupStateAction .DELETE ) ;
69+ notification .setConsumerGroup ( consumerGroup ) ;
7070 eventMeshHTTPServer .getEventBus ().post (notification );
7171 return ;
7272 }
7373
7474 if (cgm == null ) {
7575 ConsumerGroupStateEvent notification = new ConsumerGroupStateEvent ();
76- notification .action = ConsumerGroupStateEvent .ConsumerGroupStateAction .NEW ;
77- notification .consumerGroup = consumerGroup ;
78- notification .consumerGroupConfig = EventMeshUtil .cloneObject (latestConsumerGroupConfig );
76+ notification .setAction ( ConsumerGroupStateEvent .ConsumerGroupStateAction .NEW ) ;
77+ notification .setConsumerGroup ( consumerGroup ) ;
78+ notification .setConsumerGroupConfig ( EventMeshUtil .cloneObject (latestConsumerGroupConfig ) );
7979 eventMeshHTTPServer .getEventBus ().post (notification );
8080 return ;
8181 }
8282
8383 if (!latestConsumerGroupConfig .equals (cgm .getConsumerGroupConfig ())) {
8484 ConsumerGroupStateEvent notification = new ConsumerGroupStateEvent ();
85- notification .action = ConsumerGroupStateEvent .ConsumerGroupStateAction .CHANGE ;
86- notification .consumerGroup = consumerGroup ;
87- notification .consumerGroupConfig = EventMeshUtil .cloneObject (latestConsumerGroupConfig );
85+ notification .setAction ( ConsumerGroupStateEvent .ConsumerGroupStateAction .CHANGE ) ;
86+ notification .setConsumerGroup ( consumerGroup ) ;
87+ notification .setConsumerGroupConfig ( EventMeshUtil .cloneObject (latestConsumerGroupConfig ) );
8888 eventMeshHTTPServer .getEventBus ().post (notification );
8989 return ;
9090 }
@@ -123,9 +123,7 @@ public synchronized void addConsumer(String consumerGroup, ConsumerGroupConf con
123123 /**
124124 * restart consumer
125125 */
126- public synchronized void restartConsumer (String consumerGroup ,
127- ConsumerGroupConf consumerGroupConfig )
128- throws Exception {
126+ public synchronized void restartConsumer (String consumerGroup , ConsumerGroupConf consumerGroupConfig ) throws Exception {
129127 if (consumerTable .containsKey (consumerGroup )) {
130128 ConsumerGroupManager cgm = consumerTable .get (consumerGroup );
131129 cgm .refresh (consumerGroupConfig );
@@ -159,29 +157,29 @@ public synchronized void delConsumer(String consumerGroup) throws Exception {
159157 public void handleConsumerGroupTopicConfChangeEvent (ConsumerGroupTopicConfChangeEvent event ) {
160158 try {
161159 log .info ("onChange event:{}" , event );
162- switch (event .action ) {
160+ switch (event .getAction () ) {
163161 case NEW : {
164- ConsumerGroupManager manager = getConsumer (event .consumerGroup );
162+ ConsumerGroupManager manager = getConsumer (event .getConsumerGroup () );
165163 if (Objects .isNull (manager )) {
166164 return ;
167165 }
168- manager .getConsumerGroupConfig ().getConsumerGroupTopicConf ().put (event .topic , event .newTopicConf );
166+ manager .getConsumerGroupConfig ().getConsumerGroupTopicConf ().put (event .getTopic () , event .getNewTopicConf () );
169167 break ;
170168 }
171169 case CHANGE : {
172- ConsumerGroupManager manager = getConsumer (event .consumerGroup );
170+ ConsumerGroupManager manager = getConsumer (event .getConsumerGroup () );
173171 if (Objects .isNull (manager )) {
174172 return ;
175173 }
176- manager .getConsumerGroupConfig ().getConsumerGroupTopicConf ().replace (event .topic , event .newTopicConf );
174+ manager .getConsumerGroupConfig ().getConsumerGroupTopicConf ().replace (event .getTopic () , event .getNewTopicConf () );
177175 break ;
178176 }
179177 case DELETE : {
180- ConsumerGroupManager manager = getConsumer (event .consumerGroup );
178+ ConsumerGroupManager manager = getConsumer (event .getConsumerGroup () );
181179 if (Objects .isNull (manager )) {
182180 return ;
183181 }
184- manager .getConsumerGroupConfig ().getConsumerGroupTopicConf ().remove (event .topic );
182+ manager .getConsumerGroupConfig ().getConsumerGroupTopicConf ().remove (event .getTopic () );
185183 break ;
186184 }
187185 default :
@@ -197,15 +195,15 @@ public void handleConsumerGroupStateEvent(ConsumerGroupStateEvent event) {
197195 try {
198196 log .info ("onChange event:{}" , event );
199197
200- switch (event .action ) {
198+ switch (event .getAction () ) {
201199 case NEW :
202- addConsumer (event .consumerGroup , event .consumerGroupConfig );
200+ addConsumer (event .getConsumerGroup () , event .getConsumerGroupConfig () );
203201 break ;
204202 case CHANGE :
205- restartConsumer (event .consumerGroup , event .consumerGroupConfig );
203+ restartConsumer (event .getConsumerGroup () , event .getConsumerGroupConfig () );
206204 break ;
207205 case DELETE :
208- delConsumer (event .consumerGroup );
206+ delConsumer (event .getConsumerGroup () );
209207 break ;
210208 default :
211209 //do nothing
0 commit comments