Monday 26 November 2018

Zuul/Eureka configurations

<?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">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.mrm.inttris.api</groupId>
    <artifactId>ApiRouter</artifactId>
    <packaging>jar</packaging>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.version>1.8</java.version>
        <jackson.version>2.8.4</jackson.version>
        <commons-lang3.version>3.5</commons-lang3.version>
        <zuul.route.health.version>1.1.0</zuul.route.health.version>
    </properties>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.4.1.RELEASE</version>
    </parent>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>Camden.SR1</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-zuul</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-ribbon</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-eureka</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-validation</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-validation</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <version>${jackson.version}</version>
        </dependency>

        <dependency>
            <groupId>io.jmnarloch</groupId>
            <artifactId>zuul-route-health-spring-cloud-starter</artifactId>
            <version>${zuul.route.health.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>${commons-lang3.version}</version>
        </dependency>
        <dependency>
            <groupId>org.json</groupId>
            <artifactId>json</artifactId>
            <version>20140107</version>
        </dependency>

    </dependencies>

    <build>
        <finalName>${project.artifactId}</finalName>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <executable>true</executable>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.19.1</version>
                <configuration>
                    <skipTests>true</skipTests>
                </configuration>
            </plugin>
            <plugin>
                <groupId>pl.project13.maven</groupId>
                <artifactId>git-commit-id-plugin</artifactId>
                <configuration>
                    <generateGitPropertiesFile>true</generateGitPropertiesFile>
                    <failOnNoGitDirectory>false</failOnNoGitDirectory>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>




server:
  port: 8080

management:
    contextPath: /devops
    port : 8280
    info:
        git:
          mode: full

spring:
  application:
    name: ApiRouter

zuul:
  routes:
    APIAUTHSERVICE:
      path: /**/token
      serviceId: APIAUTHSERVICE
      stripPrefix: false

    APIADMINSERVICE:
      path: /**/admin/**
      serviceId: APIADMINSERVICE
      stripPrefix: false

    APIBEHAVIOURSERVICE:
      path: /**/behaviour/**
      serviceId: APIBEHAVIOURSERVICE
      stripPrefix: false

    APIMEALSSERVICE:
      path: /**/meals/**
      serviceId: APIMEALSSERVICE
      stripPrefix: false

  trace-request-body: true
  sensitive-headers: Cookie,Set-Cookie

ribbon:
  ReadTimeout: 60000
  ConnectTimeout: 60000

hystrix:
  command:
    default:
      execution:
        isolation:
          thread:
            timeoutInMilliseconds: 60000

eureka:
  health:
    enable: true
  instance:
    instance-id: ${spring.application.name}:${random.value}
    statusPageUrlPath: ${management.contextPath}/info
    healthCheckUrlPath: ${management.contextPath}/health
    preferIpAddress: true
    leaseRenewalIntervalInSeconds: 3
  client:
    registerWithEureka: true
    fetchRegistry: true
    registryFetchIntervalSeconds: 5
    instanceInfoReplicationIntervalSeconds: 5
    initialInstanceInfoReplicationIntervalSeconds: 5
    serviceUrl:
      defaultZone: http://localhost:8010/eureka

endpoints:
  health:
    sensitive: false

auth:
  hmac:
    validity:
      plusSeconds: 180
      minusSeconds: 120

services:
  apiAuthService:
    id: APIAUTHSERVICE
    URI_TOKEN: /v1/token

info:
   app:
      name: ${spring.application.name}
      encoding: @project.build.sourceEncoding@
      java-version: @java.version@

accessLogValve:
  directory: D:/Logging/${spring.application.name}
  pattern: date time c-ip s-ip s-dns cs-method cs-uri-stem cs-uri-query sc-status bytes time-taken cs(User-Agent) cs(Referer) cs(HOST)
  suffix: .log
  prefix: ex
  rotatable: true
  fileDateFormat: yyMMdd.HH
 
 
  <?xml version="1.0" encoding="UTF-8"?>
<configuration>

    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>
                %d{yyyy-MM-dd HH:mm:ss.SSS} %highlight([%level]) [%X{CONSUMER_KEY}] [%class{0}:%line] %msg %ex{3} %n
            </pattern>
        </encoder>
    </appender>

    <logger name="com.rm.integris.api" level="INFO"/>

    <logger name="com.netflix" level="INFO"/>

    <root level="INFO">
        <appender-ref ref="STDOUT"/>
    </root>

</configuration>


No comments:

Post a Comment