This commit is contained in:
Marcel 2021-12-19 20:51:31 +01:00
parent a616bd2aad
commit 0ae267ac1d
4 changed files with 9 additions and 2 deletions

View File

@ -69,6 +69,7 @@ services:
mqtt.broker.uri: tcp://broker.hivemq.com:1883
discovery.endpoint.uri: https://tapas-auction-house.86-119-34-242.nip.io
auction.house.uri: https://tapas-auction-house.86-119-35-40.nip.io
tasks.list.uri: http://tapas-tasks.86-119-35-40.nip.io
labels:
- "traefik.enable=true"
- "traefik.http.routers.tapas-auction-house.rule=Host(`tapas-auction-house.${PUB_IP}.nip.io`)"

View File

@ -101,6 +101,9 @@ public class WebSubSubscriber {
return;
}
System.out.println("HUB: " + hub);
System.out.println("TOPIC: " + topic);
HttpRequest request = HttpRequest.newBuilder()
.uri(hubURI)
.header("Content-Type", "application/x-www-form-urlencoded")

View File

@ -27,9 +27,11 @@ public class WinningBidWebController {
@PostMapping(path = "/taskwinner", consumes = TaskJsonRepresentation.MEDIA_TYPE)
public ResponseEntity<String> winningBid(@RequestBody TaskJsonRepresentation payload){
LOGGER.info("New Task Winner");
try {
var body = payload.serialize();
LOGGER.info(body);
LOGGER.info("Task Winner body: " + body);
LOGGER.info("Task Winner taskListURI: " + taskListURI);
var postURI = URI.create(taskListURI + "/tasks/");
HttpRequest postRequest = HttpRequest.newBuilder()
.uri(postURI)
@ -40,7 +42,7 @@ public class WinningBidWebController {
HttpClient client = HttpClient.newHttpClient();
var postResponse = client.send(postRequest, HttpResponse.BodyHandlers.ofString());
LOGGER.info(postResponse.statusCode());
LOGGER.info("Create task internally with status code: " + postResponse.statusCode());
HttpHeaders responseHeaders = new HttpHeaders();

View File

@ -32,6 +32,7 @@ public class PublishAuctionStartedEventWebSubAdapter implements AuctionStartedEv
@Override
public void publishAuctionStartedEvent(AuctionStartedEvent event) {
logger.info("AuctionHouse | Publish auction started over WebSub!");
logger.info("AuctionHouse | AuctionHouseURI: " + auctionHouseUri + " WebSubHubUri: " + webSubHubUri);
HttpClient client = HttpClient.newHttpClient();