Skip to content

AOT Client Url from wrong profile #813

@lgklein

Description

@lgklein

I was testing the new version 4.0 with AOT and it seems that there is a bug with multiple profiles (dev, hom, local, etc) in url resolution via parameter.

I have 3 profiles:

application-local.properties:
url.int=https://des-sts-int

application-dev.properties:
url.int=https://des-sts-int

application-hom.properties:
url.int=https://hom-sts-int

a FeignClient:

@FeignClient(name = "urlIntCliente", url = "${url.int}")
public interface UrlIntCliente {
...}
@SpringBootApplication
@EnableFeignClients(clients = UrlIntCliente.class)
public class App {

        @Autowired
	private UrlIntCliente clientSts;

	public static void main(final String[] args) {
		final SpringApplication app = new SpringApplication(App.class);
		app.run(args);
	}

	@Bean
	ApplicationRunner applicationRunner(@Value("${url.int}") final String url) {
		return args -> { //
			System.out.println("FEIGN URL = " + url);
                        System.out.println(clientSts);
		};
	}
}

I build application with:
mvn spring-boot:build-image -Pnative (with spring_profiles_active=local on env)

Start app using spring_profiles_active=hom on env)

The result on log:

The following 1 profile is active: "hom"

FEIGN URL = https://hom-sts-int
HardCodedTarget(type=UrlIntCliente, name=urlIntCliente, url=https://des-sts-int)

Apparently it keeps what was generated in the build and doesn't update with startup information when a profile is selected...
@OlgaMaciaszek Is this a bug or i'm doing something wrong here?

Same root problem of #807??

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions