-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from YarikRevich/feature/api-server-starter
Feature: implement Kafka starter
- Loading branch information
Showing
42 changed files
with
940 additions
and
277 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
...java/com/resourcetracker/service/client/kafkastarter/KafkaStarterClientServiceFacade.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.resourcetracker.service.client.kafkastarter; | ||
|
||
import com.resourcetracker.service.client.kafkastarter.common.IKafkaStarterClientService; | ||
import java.net.URI; | ||
import org.eclipse.microprofile.rest.client.RestClientBuilder; | ||
|
||
/** Represents Kafka starter service client facade. */ | ||
public class KafkaStarterClientServiceFacade { | ||
private final IKafkaStarterClientService kafkaStarterClientService; | ||
|
||
public KafkaStarterClientServiceFacade(String host, Integer port) { | ||
kafkaStarterClientService = | ||
RestClientBuilder.newBuilder() | ||
.baseUri(URI.create(String.format("http://%s:%d", host, port))) | ||
.build(IKafkaStarterClientService.class); | ||
} | ||
|
||
/** | ||
* Sends query to the Kafka starter client to deploy Kafka with the given external host. | ||
* | ||
* @param host external host to be used as advertised listener. | ||
*/ | ||
public void deploy(String host) { | ||
kafkaStarterClientService.qDeployPost(host); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
...va/com/resourcetracker/service/client/kafkastarter/common/IKafkaStarterClientService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.resourcetracker.service.client.kafkastarter.common; | ||
|
||
import jakarta.ws.rs.POST; | ||
import jakarta.ws.rs.Path; | ||
import jakarta.ws.rs.QueryParam; | ||
import java.io.Closeable; | ||
import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; | ||
|
||
/** Represents client for Kafka starter endpoints. */ | ||
@RegisterRestClient | ||
public interface IKafkaStarterClientService extends Closeable { | ||
@POST | ||
@Path("/deploy") | ||
void qDeployPost(@QueryParam("host") String host); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.