Commit 844a9c03 authored by Ali Saeed's avatar Ali Saeed

Added Service Discovery Application (Eureks Server)

parent 04b1b432
...@@ -8,12 +8,14 @@ ...@@ -8,12 +8,14 @@
<outputRelativeToContentRoot value="true" /> <outputRelativeToContentRoot value="true" />
<module name="users-service" /> <module name="users-service" />
<module name="invoicing-service" /> <module name="invoicing-service" />
<module name="service-discovery" />
</profile> </profile>
</annotationProcessing> </annotationProcessing>
</component> </component>
<component name="JavacSettings"> <component name="JavacSettings">
<option name="ADDITIONAL_OPTIONS_OVERRIDE"> <option name="ADDITIONAL_OPTIONS_OVERRIDE">
<module name="invoicing-service" options="-parameters" /> <module name="invoicing-service" options="-parameters" />
<module name="service-discovery" options="-parameters" />
<module name="users-service" options="-parameters" /> <module name="users-service" options="-parameters" />
</option> </option>
</component> </component>
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
<component name="Encoding"> <component name="Encoding">
<file url="file://$PROJECT_DIR$/invoicing-service/src/main/java" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/invoicing-service/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/invoicing-service/src/main/resources" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/invoicing-service/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/service-discovery/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/service-discovery/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/users-service/src/main/java" charset="UTF-8" /> <file url="file://$PROJECT_DIR$/users-service/src/main/java" charset="UTF-8" />
......
...@@ -16,5 +16,10 @@ ...@@ -16,5 +16,10 @@
<option name="name" value="JBoss Community repository" /> <option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" /> <option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository> </remote-repository>
<remote-repository>
<option name="id" value="netflix-candidates" />
<option name="name" value="Netflix Candidates" />
<option name="url" value="https://artifactory-oss.prod.netflix.net/artifactory/maven-oss-candidates" />
</remote-repository>
</component> </component>
</project> </project>
\ No newline at end of file
...@@ -9,9 +9,7 @@ ...@@ -9,9 +9,7 @@
<relativePath/> <!-- lookup parent from repository --> <relativePath/> <!-- lookup parent from repository -->
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>invoicing-service</artifactId> <artifactId>invoicing-service</artifactId>
<properties> <properties>
<maven.compiler.source>17</maven.compiler.source> <maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target> <maven.compiler.target>17</maven.compiler.target>
...@@ -42,5 +40,4 @@ ...@@ -42,5 +40,4 @@
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
</project> </project>
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
<modules> <modules>
<module>users-service</module> <module>users-service</module>
<module>invoicing-service</module> <module>invoicing-service</module>
<module>service-discovery</module>
</modules> </modules>
<properties> <properties>
......
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.0.1</version>
<relativePath/>
</parent>
<artifactId>service-discovery</artifactId>
<name>service-discovery</name>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring-cloud.version>2020.0.4</spring-cloud.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>2.5.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>2.0.9</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.4.11</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>1.4.11</version>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>netflix-candidates</id>
<name>Netflix Candidates</name>
<url>https://artifactory-oss.prod.netflix.net/artifactory/maven-oss-candidates</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
</project>
package org.example;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
@SpringBootApplication
@EnableEurekaServer
public class ServiceDiscoveryApplication {
public static void main(String[] args) {
SpringApplication.run(ServiceDiscoveryApplication.class, args);
}
}
server.port = 8761
eureka.client.registerWithEureka=false
eureka.client.fetchRegistry=false
\ No newline at end of file
<configuration>
<appender name="FILE" class="ch.qos.logback.core.FileAppender">
<file>./service-discovery/logs/application.log</file>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<!-- Console appender -->
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<logger name="com.example" level="DEBUG" additivity="false">
<appender-ref ref="FILE"/>
<appender-ref ref="CONSOLE"/> <!-- Add the console appender reference -->
</logger>
<root level="error">
<appender-ref ref="FILE"/>
<appender-ref ref="CONSOLE"/> <!-- Add the console appender reference -->
</root>
</configuration>
\ No newline at end of file
server.port = 8761
eureka.client.registerWithEureka=false
eureka.client.fetchRegistry=false
\ No newline at end of file
<configuration>
<appender name="FILE" class="ch.qos.logback.core.FileAppender">
<file>./service-discovery/logs/application.log</file>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<!-- Console appender -->
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<logger name="com.example" level="DEBUG" additivity="false">
<appender-ref ref="FILE"/>
<appender-ref ref="CONSOLE"/> <!-- Add the console appender reference -->
</logger>
<root level="error">
<appender-ref ref="FILE"/>
<appender-ref ref="CONSOLE"/> <!-- Add the console appender reference -->
</root>
</configuration>
\ No newline at end of file
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties> </properties>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId> <artifactId>spring-boot-starter-web</artifactId>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment