I want to register two sample Java web applications with Spring Registry so that both applications can communicate directly. I don't know much about programming.
Here I found the Spring Registry code, where Spring backend application is registering itself when it is deployed on Cloud Foundry, so that any Spring frontend application that is trying to reach the backend can communicate directly.
How can I register a simple Java dynamic web application to make direct communication between them without using the third-party services like RabbitMQ?
I think you are misunderstanding the use cases. The Netflix Eureka registry is for service registry that helps facilitate service to service communication.
Suppose a service -
abc.foo.com
and it needs to call another servicepqr.foo.com
. You don't want the path for thepqr
service hardcoded in theabc
service. Hardcoding like is an anti-pattern for cloud native applications. The approach is to have serviceabc
andpqr
register themselves with a service registry (eureka, consul, etc.). Then at runtime, the service,abc
here, can interrogate registry and get an active instance of thepqr
service and invoke it.For your Java web applications, that need to call each other, I am assuming, all your interactions (service calls) are done on server-side. In which case, using Eureka registry, one microservice an easily find and get instance of another service and invoke it. You don't need RabbitMQ for that.
I would recommend looking at the jHipster project. It is an open source project. They have a Eureka based registry service, a gateway service, microservices and client-side UI (Node.js).
It will be a good starting point and there is a lot of open source help available.
I hope this helps!