How do I do coordination between multiple application instances?

89
February 13, 2018, at 4:39 PM

Need help in deciding what frameworks I can use in this scenario. I'm exploring Zookeeper, but not completely sure on how to solution this usecase.

background :

  1. Say there is application that connects to a streaming source(Kafka or Activemq etc) and writes messages that were processed from the stream to a file.
  2. This application is deployed as 4 instances.Each instance is processing messages and writing to file that were processed in last 1 hr.
  3. Each instance creates a file that stores messages that it processed last 1 hour. example -filename is servername_8.00 for messages processed from 8-9
  4. Requirement is to transfer all the files that were created last 1 hour if every instance created a file in that window and also send only one consolidated file which lists all the 4 file names and number of records.

what i'm looking for :
1. How do I make sure application instances know if other instances also created files and if every instance created then only they should transmit file 2. whatever instance sending, consolidated file should know what was transmitted.

what frameworks I can use to solve this?

READ ALSO
Apache Curator NPE on serviceProvider.start()

Apache Curator NPE on serviceProvider.start()

I'm using Apache Curator discovery version 40

78
Is A New Object Instantiated Every Time This Loop Runs?

Is A New Object Instantiated Every Time This Loop Runs?

I was taking a Java test today and I got this weird question and I feel like I am right, but some of my classmates are saying another answer is rightThere was a basic class, a default constructor that initialized the instances, and some methods

49
Notification in background

Notification in background

When I open the app and send notification from the FireBase console , the onMessageReceived works fineThe app has its small icon , Notification sound ,etc

82