Skip to content

Commit

Permalink
parametrized connection strings
Browse files Browse the repository at this point in the history
  • Loading branch information
kubealex committed Jul 11, 2023
1 parent 752637d commit 37fea39
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class Producer {
AlertService alertService;

@GET
@Path("/kafka/greeting")
@Path("/kafka/")
@Produces(MediaType.APPLICATION_JSON)
public String sendKafkaEvent() throws JsonProcessingException {
Event testEvent = new Event("greeting", "Hello from Quarkus");
Expand All @@ -45,15 +45,15 @@ public String sendKafkaEvent() throws JsonProcessingException {
}

@GET
@Path("/webhook/greeting")
@Path("/webhook/")
@Produces(MediaType.APPLICATION_JSON)
public void sendWebhookEvent() {
WebhookEvent testEvent = new WebhookEvent("greeting", "Hello from Quarkus", null);
webhookService.sendEvent(testEvent);
}

@GET
@Path("/alertmanager/greeting")
@Path("/alertmanager/")
@Produces(MediaType.APPLICATION_JSON)
public void sendAlert() throws JsonProcessingException {
List<Alert> alertList = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
quarkus.kafka.devservices.enabled=false
mp.messaging.connector.smallrye-kafka.bootstrap.servers=kafka:9092
org.acme.webhook.service.WebhookService/mp-rest/url=http://ansible:5000
org.acme.alertmanager.service.AlertService/mp-rest/url=http://alertmanager:9093

kafka.connection='kafka:9092'
webhook.connection='http://ansible:5000'
alertmanager.connection='http://alertmanager:9093'
mp.messaging.connector.smallrye-kafka.bootstrap.servers=${KAFKA_CONNECTION:${kafka.connection}}
org.acme.webhook.service.WebhookService/mp-rest/url=${WEBHOOK_CONNECTION:${webhook.connection}}
org.acme.alertmanager.service.AlertService/mp-rest/url=${ALERTMANAGER_CONNECTION:${alertmanager.connection}}

0 comments on commit 37fea39

Please sign in to comment.