These are chat archives for spring-cloud/spring-cloud

21st
Sep 2018
Knut Schleßelmann
@kschlesselmann
Sep 21 2018 07:11

@spencergibb Yes, I am.

plugins {
    id "org.jetbrains.kotlin.jvm" version "1.2.70"
    id "org.jetbrains.kotlin.kapt" version "1.2.70"
    id "org.jetbrains.kotlin.plugin.spring" version "1.2.70"

    id "org.springframework.boot" version "2.0.5.RELEASE"
    id "io.spring.dependency-management" version "1.0.6.RELEASE"

    id "com.gorylenko.gradle-git-properties" version "1.5.2"

    id "org.sonarqube" version "2.6.2"

    id "org.owasp.dependencycheck" version "3.3.2"
    id "com.github.ben-manes.versions" version "0.20.0"
}

group = 'x'
version = '0.0.1'
sourceCompatibility = 1.8

compileKotlin {
    kotlinOptions {
        freeCompilerArgs = ["-Xjsr305=strict"]
        jvmTarget = "1.8"
    }
}

compileTestKotlin {
    kotlinOptions {
        freeCompilerArgs = ["-Xjsr305=strict"]
        jvmTarget = "1.8"
    }
}

springBoot {
    buildInfo()
}

bootJar {
    launchScript()
}

test {
    useJUnitPlatform()

    environment "SPRING_PROFILES_ACTIVE", "test"
}

repositories {
    mavenCentral()
}

dependencyManagement {
    imports {
        mavenBom 'org.springframework.cloud:spring-cloud-aws:2.0.0.RELEASE'
    }
}

dependencies {
    compile('com.fasterxml.jackson.module:jackson-module-kotlin')
    compile("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
    compile("org.jetbrains.kotlin:kotlin-reflect")

    compile('org.springframework.boot:spring-boot-starter-actuator')
    compile('org.springframework.boot:spring-boot-starter-webflux')

    compile('org.springframework.cloud:spring-cloud-starter-aws') {
        exclude module: 'aws-java-sdk-cloudformation'
    }
    compile('org.springframework.cloud:spring-cloud-aws-actuator')

    compile("org.apache.commons:commons-compress:1.18")
    compile("io.github.microutils:kotlin-logging:1.6.10")

    runtime('org.springframework.boot:spring-boot-devtools')

    kapt('org.springframework.boot:spring-boot-configuration-processor')

    testCompile('org.springframework.boot:spring-boot-starter-test') {
        exclude module: 'junit'
    }
    testCompile('io.projectreactor:reactor-test')
    testImplementation('org.junit.jupiter:junit-jupiter-api')
    testRuntimeOnly('org.junit.jupiter:junit-jupiter-engine')
}

This is my build.gradle

CH4:D
@chad_d_stud_twitter
Sep 21 2018 13:39
is there a change in 2.1.0.M3 in Feign Client bean names? I’m getting the following error:

***************************
APPLICATION FAILED TO START
***************************

Description:

The bean ‘myFeign.FeignClientSpecification', defined in null, could not be registered. A bean with that name has already been defined in null and overriding is disabled.

Action:

Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true
I deliberately made separate feign client beans pointing to the same service but they contain different sets of endpoint calls. this is so i have separate logically categorized sets of Rest calls
i.e.
@FeignClient(name = “myFeign", fallbackFactory = Feign1Fallback.class)
public interface Feign1 {

    @PostMapping(“/endpoint1/doSomething")
    Optional<Object> endpoint1Something(@RequestBody Object request);
}
@FeignClient(name = “myFeign", fallbackFactory = Feign2Fallback.class)
public interface Feign2 {

    @PostMapping(“/endpoint2/doSomething")
    Optional<Object> endpoint2Something(@RequestBody Object request);
}
@FeignClient(name = “myFeign", fallbackFactory = Feign3Fallback.class)
public interface Feign3 {

    @PostMapping(“/endpoint3/doSomething")
    Optional<Object> endpoint3Something(@RequestBody Object request);
}
CH4:D
@chad_d_stud_twitter
Sep 21 2018 13:45
let’s just say for example feign1 goes to an /items/... path and feign2 goes to a /categories/... path
Spencer Gibb
@spencergibb
Sep 21 2018 15:44
@kschlesselmann use mavenBom 'org.springframework.cloud:spring-cloud-Dependencies:Finchley.SR1' instead
@chad_d_stud_twitter you mean boot 2.1.0.M3? There hasn't been a Greenwich release yet (though probably today)
Eric Deandrea
@edeandrea
Sep 21 2018 15:49
Can a Spring boot EnvironmentPostProcessor read values that are provided from a config server by spring-cloud-config-client? When debugging I don’t see the configService property source in the ConfigurableEnvironment.getPropertySources() within EnvironmentPostProcessor.postProcessEnvironment.