-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* sync update topic func to 2.2.3 branch (#521) * add topics update * add Channel2ServerUpdateTopics.java * sync update topic func to 2.2.3 branch * update keepalive nodes count log to trace level.
- Loading branch information
Showing
6 changed files
with
111 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v2.2.2 | ||
v2.2.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
src/test/java/org/fisco/bcos/channel/test/amop/Channel2ServerUpdateTopics.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package org.fisco.bcos.channel.test.amop; | ||
|
||
import java.util.HashSet; | ||
import java.util.Set; | ||
import org.fisco.bcos.channel.client.Service; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.springframework.context.ApplicationContext; | ||
import org.springframework.context.support.ClassPathXmlApplicationContext; | ||
|
||
public class Channel2ServerUpdateTopics { | ||
private static final Logger logger = LoggerFactory.getLogger(Channel2Server.class); | ||
|
||
public static void main(String[] args) throws Exception { | ||
if (args.length < 1) { | ||
System.out.println("Param: topic"); | ||
return; | ||
} | ||
String topic = args[0]; | ||
logger.debug("init Server"); | ||
ApplicationContext context = | ||
new ClassPathXmlApplicationContext("classpath:applicationContext.xml"); | ||
Service service = context.getBean(Service.class); | ||
PushCallback cb = new PushCallback(); | ||
service.setPushCallback(cb); | ||
System.out.println("3s..."); | ||
Thread.sleep(1000); | ||
System.out.println("2s..."); | ||
Thread.sleep(1000); | ||
System.out.println("1s..."); | ||
Thread.sleep(1000); | ||
|
||
System.out.println("start test"); | ||
System.out.println("==================================================================="); | ||
service.run(); | ||
|
||
Thread.sleep(10000); | ||
|
||
System.out.println("set topics"); | ||
System.out.println("==================================================================="); | ||
Set<String> topics = new HashSet<String>(); | ||
topics.add(topic); | ||
service.setTopics(topics); | ||
service.updateTopicsToNode(); | ||
} | ||
} |