Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kafka configuration using configuration profiles doesn't work #5300

Closed
jamesfalkner opened this issue Nov 7, 2019 · 5 comments
Closed

Kafka configuration using configuration profiles doesn't work #5300

jamesfalkner opened this issue Nov 7, 2019 · 5 comments
Labels
area/config area/kafka area/reactive-messaging kind/bug Something isn't working triage/out-of-date This issue/PR is no longer valid or relevant

Comments

@jamesfalkner
Copy link

jamesfalkner commented Nov 7, 2019

Describe the bug
When I use configuration profile prefixes in my application.properties like %prod to prefix Kafka settings it doesn't seem to pick it up when run as a fat JAR in a container, even though Quarkus claims at starting that it's running with the prod profile. Depending on which Kafka settings I prefix with %prod my application never initializes mediators during startup with Impossible to bind mediators, some mediators are not connected or tries to use localhost when my non-localhost bootstrap-servers settings are prefixed with %prod.

This happens even with the code from the guide at https://quarkus.io/guides/kafka-guide

Expected behavior
Kafka mediators and connections are properly established. When running in prod profile, config values prefixed with %prod. should be in effect and used to configure extensions like Kafka.

Actual behavior
Quarkus appears to ignore settings prefixed with %prod. even when in prod mode (i.e. fat JAR or native build).

To Reproduce
Steps to reproduce the behavior:

  1. Follow the guide at https://quarkus.io/guides/kafka
  2. Prefix all the Kafka settings from application.properties with %prod.
  3. Run the app under prod mode instead of dev mode: either build a FAT jar and run with java -jar, or build a native image and run that (I have not tried dev mode with -Dquarkus.profile=prod).
  4. Try to access app (names.html)
  5. Observe failures in console.

Configuration

# Add your application.properties here, if applicable.
%prod.mp.messaging.outgoing.generated-name.bootstrap.servers=names-cluster-kafka-bootstrap:9092
%prod.mp.messaging.outgoing.generated-name.connector=smallrye-kafka
%prod.mp.messaging.outgoing.generated-name.topic=names
%prod.mp.messaging.outgoing.generated-name.value.serializer=org.apache.kafka.common.serialization.StringSerializer

# Configure the Kafka source (we read from it)
%prod.mp.messaging.incoming.names.bootstrap.servers=names-cluster-kafka-bootstrap:9092
%prod.mp.messaging.incoming.names.connector=smallrye-kafka
%prod.mp.messaging.incoming.names.value.deserializer=org.apache.kafka.common.serialization.StringDeserializer

Screenshots

Environment (please complete the following information):

  • Output of uname -a or ver:
    Linux workspacendi6xxlz93n3i2we.dockerimage-5b6f9497f4-x4zkg 4.18.0-80.4.2.el8_0.x86_64 #1 SMP Fri Jun 14 13:20:24 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

  • Output of java -version:

openjdk version "1.8.0_212"
OpenJDK Runtime Environment (build 1.8.0_212-b04)
OpenJDK 64-Bit Server VM (build 25.212-b04, mixed mode)
  • GraalVM version (if different from Java):
    19.2.1 CE

  • Quarkus version or git rev:
    1.0.0.CR1

Additional context

@jamesfalkner jamesfalkner added the kind/bug Something isn't working label Nov 7, 2019
@edeandrea
Copy link
Contributor

We should fix this sooner than later.

@gsmet
Copy link
Member

gsmet commented Nov 18, 2019

@cescoffier have you seen this one? I wonder if we use the API taking into account the profiles in SmallRye Reactive Messaging?

@cescoffier
Copy link
Member

There is a draft pr about config that would address this.

Note that smallrye reactive messaging cannot used a quarkus specific API.

@machi1990
Copy link
Member

#5387 which has just been merged fixed config related issues including this one.

@jamesfalkner do you mind trying the upstream master to see if this is indeed fixed? Thanks

@cescoffier
Copy link
Member

It has been fixed.

@gsmet gsmet added the triage/out-of-date This issue/PR is no longer valid or relevant label May 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/config area/kafka area/reactive-messaging kind/bug Something isn't working triage/out-of-date This issue/PR is no longer valid or relevant
Projects
None yet
Development

No branches or pull requests

5 participants