System.out.println(MessageFormat.format("\n\n========================================\nPUBSUB TEST {0}\n========================================\n\n", service.toString()));
service.startSynchronously();
final Map<String, String> announcementsA = new ConcurrentHashMap<String, String>();
FanoutClient clientA = new FanoutClient("localhost", fanoutPort);
clientA.addListener(new FanoutAdapter() {
@Override
public void announcement(String channel, String message) {
announcementsA.put(channel, message);
}
});
clientA.startSynchronously();
final Map<String, String> announcementsB = new ConcurrentHashMap<String, String>();
FanoutClient clientB = new FanoutClient("localhost", fanoutPort);
clientB.addListener(new FanoutAdapter() {
@Override
public void announcement(String channel, String message) {
announcementsB.put(channel, message);
}
});