Cold Publisher Creating publisher which emits update every second: Flux.interval(Duration.ofSeconds(1L)) .map(element->{ return new Update(element.toString(),UUID.randomUUID().toString()); }).doOnNext(onNext->{ print("Publishing new element with key "+onNext.getKey()); }); Note: complete code is availeble at following git repository git-repo Above flux will only start emitting elements post subscription only, and for multiple subscriptions it will replay the elements from start. Hot Publisher Creating published which doesn't wait for subscribers to subscribe, instead keeps on emitting elements and subscribers will be able catch elements which are emitted post subscription as below: hotUpdate=DirectProcessor.create(); new Thread(() -> { int state=0; do { print("generator with state "+state); hotUpdate.onNext(new Update(Integer.toString(state),UUID.randomUUID().toString())); hotUpdate.delaySequence(Duratio...
Below are good articles to read on communication among micro-services. 1. docs@microsoft.com 2. https://dzone.com/articles/microservices-why-asynchronous-communications 3. microservice-design-patterns 4. https://vertx.io/docs/vertx-amqp-bridge/java/ 5. developers.redhat.com/blog