Skip to main content

Posts

Showing posts with the label Spring Cloud

Eureka-Server with spring cloud netflix

In this write-up we will focus on Service Registry – Eureka Server Rest service (auth-service application, eureka client) which register itself to registry. Web application which consumes Rest service using service registry. Service discovery  allows services to find and communicate with each other without hardcoding hostname and port. Eureka Server In spring-boot application enable the Eureka-Server by adding @EnableEurekaServer annotation to spring boot application. We have put all the configuration on GIT and this is accessed using config-server. To now more about centralized configuration (config-server) click  here eurekaserver.yml Place below bootstrap.yml in application, it basically connects to config-server and gets it required configuration. Start the spring-boot application and access eureka server using http://localhost:8760/ you will get below screen. Right now there is no application which...

Spring Cloud Stream Using Kafka

Recently I've been digging in event-driven architectures for service communication. For demo followed broker approach instead of Feed approach, as broker approach has dedicated broker responsible for distributing the events to n number of subscribers. For demo we will use most popular open-source Kafka broker (https://kafka.apache.org). As spring (http://spring.io)  always makes life easy 😎, Spring-Cloud-Stream project by spring makes Kafka integration in your application very easy 👍 with few annotations. Spring Cloud Stream provides Binder implementations for  Kafka ,  Rabbit MQ ,  Redis , and  Gemfire . Note: Before we proceed make sure you have installed ZooKeeper and Kafka & both are running. Dependencies Add following dependencies to your POM for using KAFKA. Use Case: We will have One producer (demo-producer application) & two consumers (demo-consumer application & demo-consume1 application). Produc...