@@ -230,6 +230,22 @@ public void subscribe(String host, int port, String tableName, String actionName
230
230
}
231
231
}
232
232
233
+ public void subscribe (String host , int port , String tableName , String actionName , MessageHandler handler , long offset , boolean reconnect , Vector filter , StreamDeserializer deserializer , boolean allowExistTopic , int batchSize , int throttle , String userName , String password , List <String > backupSites ) throws IOException {
234
+ if (batchSize <=0 )
235
+ throw new IllegalArgumentException ("BatchSize must be greater than zero" );
236
+ if (throttle <0 )
237
+ throw new IllegalArgumentException ("Throttle must be greater than or equal to zero" );
238
+ BlockingQueue <List <IMessage >> queue = subscribeInternal (host , port , tableName , actionName , handler , offset , reconnect , filter , deserializer , allowExistTopic , userName , password , false , backupSites , 100 , false );
239
+ HandlerLopper handlerLopper = new HandlerLopper (queue , handler , batchSize , throttle == 0 ? -1 : throttle );
240
+ handlerLopper .start ();
241
+ String topicStr = host + ":" + port + "/" + tableName + "/" + actionName ;
242
+ List <String > usr = Arrays .asList (userName , password );
243
+ synchronized (handlerLoppers ) {
244
+ handlerLoppers .put (topicStr , handlerLopper );
245
+ // users.put(topicStr, usr);
246
+ }
247
+ }
248
+
233
249
public void subscribe (String host , int port , String tableName , String actionName , MessageHandler handler , long offset , boolean reconnect , Vector filter , StreamDeserializer deserializer , boolean allowExistTopic , int batchSize , float throttle , String userName , String password ) throws IOException {
234
250
if (batchSize <=0 )
235
251
throw new IllegalArgumentException ("BatchSize must be greater than zero" );
0 commit comments