From e3768280ac8b4cd047c736519c15a70f56ca5093 Mon Sep 17 00:00:00 2001 From: reynisson Date: Sat, 20 Nov 2021 22:09:07 +0100 Subject: [PATCH 1/3] using https for auction house link --- .../main/java/ch/unisg/tapas/TapasAuctionHouseApplication.java | 2 +- .../tapas/auctionhouse/adapter/in/web/AddBidWebController.java | 2 +- tapas-auction-house/src/main/resources/application.properties | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tapas-auction-house/src/main/java/ch/unisg/tapas/TapasAuctionHouseApplication.java b/tapas-auction-house/src/main/java/ch/unisg/tapas/TapasAuctionHouseApplication.java index 9fe963e..476c7d0 100644 --- a/tapas-auction-house/src/main/java/ch/unisg/tapas/TapasAuctionHouseApplication.java +++ b/tapas-auction-house/src/main/java/ch/unisg/tapas/TapasAuctionHouseApplication.java @@ -58,7 +58,7 @@ public class TapasAuctionHouseApplication { private static void bootstrapMarketplaceWithMqtt() { try { String broker = ENVIRONMENT.getProperty("mqtt.broker.uri"); - + LOGGER.info("Bootstrapping Mqtt"); if (broker == null) { broker = DEFAULT_MQTT_BROKER; LOGGER.info("No MQTT broker was set in application.propreties, going with default: " diff --git a/tapas-auction-house/src/main/java/ch/unisg/tapas/auctionhouse/adapter/in/web/AddBidWebController.java b/tapas-auction-house/src/main/java/ch/unisg/tapas/auctionhouse/adapter/in/web/AddBidWebController.java index 41e65ff..e95419e 100644 --- a/tapas-auction-house/src/main/java/ch/unisg/tapas/auctionhouse/adapter/in/web/AddBidWebController.java +++ b/tapas-auction-house/src/main/java/ch/unisg/tapas/auctionhouse/adapter/in/web/AddBidWebController.java @@ -32,7 +32,7 @@ public class AddBidWebController { new Bid.BidderTaskListUri(URI.create(payload.getBidderTaskListUri())) )); - LOGGER.info("Bid received", payload); + LOGGER.info("Bid received:" + payload); BidReceivedHandler bidReceivedHandler = new BidReceivedHandler(); bidReceivedHandler.handleNewBidReceivedEvent(bidReceivedEvent); diff --git a/tapas-auction-house/src/main/resources/application.properties b/tapas-auction-house/src/main/resources/application.properties index 7f8ca02..78bda13 100644 --- a/tapas-auction-house/src/main/resources/application.properties +++ b/tapas-auction-house/src/main/resources/application.properties @@ -4,7 +4,7 @@ websub.hub=https://websub.appspot.com/ websub.hub.publish=https://websub.appspot.com/ group=tapas-group-tutors -auction.house.uri=http://tapas-auction-house.86-119-35-40.nip.io +auction.house.uri=https://tapas-auction-house.86-119-35-40.nip.io tasks.list.uri=http://localhost:8081 application.environment=development -- 2.45.1 From 3b205d80a5b51319e43bdbf59d93bce2ed2ccf22 Mon Sep 17 00:00:00 2001 From: reynisson Date: Sat, 20 Nov 2021 22:39:20 +0100 Subject: [PATCH 2/3] using the bidders auction house uri --- .../adapter/out/web/AuctionWonEventHttpAdapter.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tapas-auction-house/src/main/java/ch/unisg/tapas/auctionhouse/adapter/out/web/AuctionWonEventHttpAdapter.java b/tapas-auction-house/src/main/java/ch/unisg/tapas/auctionhouse/adapter/out/web/AuctionWonEventHttpAdapter.java index 4583892..2178fb4 100644 --- a/tapas-auction-house/src/main/java/ch/unisg/tapas/auctionhouse/adapter/out/web/AuctionWonEventHttpAdapter.java +++ b/tapas-auction-house/src/main/java/ch/unisg/tapas/auctionhouse/adapter/out/web/AuctionWonEventHttpAdapter.java @@ -57,9 +57,10 @@ public class AuctionWonEventHttpAdapter implements AuctionWonEventPort { new Task.ServiceProvider("TODO") ); + var bidderAuctionHouseUri = event.getWinningBid().getBidderAuctionHouseUri().getValue().toString(); String body = TaskJsonRepresentation.serialize(task); LOGGER.info(body); - var postURI = URI.create(auction.get().getAuctionHouseUri().getValue().toString() + "/taskwinner"); + var postURI = URI.create(bidderAuctionHouseUri + "/taskwinner"); HttpRequest postRequest = HttpRequest.newBuilder() .uri(postURI) .header("Content-Type", TaskJsonRepresentation.MEDIA_TYPE) -- 2.45.1 From 332f035622ec0d445eec1193cc06738f2e2be50f Mon Sep 17 00:00:00 2001 From: reynisson Date: Sat, 20 Nov 2021 22:53:52 +0100 Subject: [PATCH 3/3] small fixes --- .../mqtt/ExternalAuctionStartedEventListenerMqttAdapter.java | 4 ++-- .../adapter/out/web/AuctionWonEventHttpAdapter.java | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tapas-auction-house/src/main/java/ch/unisg/tapas/auctionhouse/adapter/in/messaging/mqtt/ExternalAuctionStartedEventListenerMqttAdapter.java b/tapas-auction-house/src/main/java/ch/unisg/tapas/auctionhouse/adapter/in/messaging/mqtt/ExternalAuctionStartedEventListenerMqttAdapter.java index c47acad..746d0ba 100644 --- a/tapas-auction-house/src/main/java/ch/unisg/tapas/auctionhouse/adapter/in/messaging/mqtt/ExternalAuctionStartedEventListenerMqttAdapter.java +++ b/tapas-auction-house/src/main/java/ch/unisg/tapas/auctionhouse/adapter/in/messaging/mqtt/ExternalAuctionStartedEventListenerMqttAdapter.java @@ -25,9 +25,9 @@ import java.sql.Timestamp; public class ExternalAuctionStartedEventListenerMqttAdapter extends AuctionEventMqttListener{ private static final Logger LOGGER = LogManager.getLogger(ExternalAuctionStartedEventListenerMqttAdapter.class); - String auctionHouseURI = "http://tapas-auction-house.86-119-35-40.nip.io/"; + String auctionHouseURI = "https://tapas-auction-house.86-119-35-40.nip.io/"; - String taskListURI = "http://tapas-tasks.86-119-35-40.nip.io"; + String taskListURI = "https://tapas-tasks.86-119-35-40.nip.io"; @Override public boolean handleEvent(MqttMessage message){ diff --git a/tapas-auction-house/src/main/java/ch/unisg/tapas/auctionhouse/adapter/out/web/AuctionWonEventHttpAdapter.java b/tapas-auction-house/src/main/java/ch/unisg/tapas/auctionhouse/adapter/out/web/AuctionWonEventHttpAdapter.java index 2178fb4..9dc1508 100644 --- a/tapas-auction-house/src/main/java/ch/unisg/tapas/auctionhouse/adapter/out/web/AuctionWonEventHttpAdapter.java +++ b/tapas-auction-house/src/main/java/ch/unisg/tapas/auctionhouse/adapter/out/web/AuctionWonEventHttpAdapter.java @@ -61,6 +61,7 @@ public class AuctionWonEventHttpAdapter implements AuctionWonEventPort { String body = TaskJsonRepresentation.serialize(task); LOGGER.info(body); var postURI = URI.create(bidderAuctionHouseUri + "/taskwinner"); + LOGGER.info(postURI); HttpRequest postRequest = HttpRequest.newBuilder() .uri(postURI) .header("Content-Type", TaskJsonRepresentation.MEDIA_TYPE) -- 2.45.1