Amanuel Nega
Amanuel Nega

Reputation: 1977

Spring boot applications with realtime communication

I have a core application and a provider application.

The provider application is added dynamically. It needs to register itself to the core. Originally I assumed the providers will have a public IP and would register there IP to the core and the core would call them when it needs some service. (Or connect to a VPN and the IP would be accessible)

This approach became hard to manage and there was overhead when checking the status of the provider.

I thought of some alternatives and don't know which one to use

  1. Websockets. The providers would subscribe to some topics. I haven't figured out how to publish to a single one yet, but I'm thinking the providers will register their uuid when subscribing and we publish to just one uuid which only one provider will subscribe to.
  2. Use Apache MQ or Kafka or something similar.
  3. Implement a TCP communication (Spring integration might help, but I'm not sure )

Those are the ideas I have and I'm not sure on how to structure them for best performance and cleaner code.

What other option do I have?

Edit

@cool suggested that I use a discovery server and it makes more sense. The providers themselves contain a list of devices. Does it make sense to publish them separately? They all would have the same IP but device Id will be associated with the metadata (perhaps the id would be part of the url).

Upvotes: 0

Views: 749

Answers (1)

cool
cool

Reputation: 1786

It sounds like what you need is a discovery service like eureka. What it does basically discovering/providing services as you need in your case. You can check out the details from spring-eureka

Upvotes: 1

Related Questions