public void forInterest(Interest<InstanceInfo> interest) { if (mode == Mode.Write) { System.err.println("ERROR: registration-only session"); return; } String id = sessionId + "#" + streamIds.incrementAndGet(); InterestSubscriber subscriber = new InterestSubscriber(interest, id); subscriptions.put(id, subscriber); interestClient.forInterest(interest).subscribe(subscriber); System.out.println("Stream_" + id + ": Subscribing to Interest: " + interest); }
private Observable<ChangeNotification<InstanceInfo>> buildEurekaFullRegistryObservable() { return interestClient.forInterest(Interests.forFullRegistry()); }
@PostConstruct public void start() { eurekaClient = eureka2InterestClientProvider.get(); eurekaClient.forInterest(Interests.forFullRegistry()).retry().subscribe(new Action1<ChangeNotification<InstanceInfo>>() { @Override public void call(ChangeNotification<InstanceInfo> changeNotification) { final ChangeNotification.Kind notificationKind = changeNotification.getKind(); final InstanceInfo instInfo = changeNotification.getData(); if (notificationKind == ChangeNotification.Kind.Add || notificationKind == ChangeNotification.Kind.Modify) { registryCache.put(instInfo.getId(), instInfo); } else if (notificationKind == ChangeNotification.Kind.Delete) { registryCache.remove(instInfo.getId()); } } }); } }
interestClient.forInterest(Interests.forFullRegistry());
.forInterest(interest) .subscribe(new Subscriber<ChangeNotification<InstanceInfo>>() { @Override
.build(); interestClient.forInterest(forApplications("WriteServer", "ReadServer", "ServiceA")).subscribe( new Subscriber<ChangeNotification<InstanceInfo>>() { @Override