You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by di...@apache.org on 2021/07/15 03:04:28 UTC

[airavata-mft] 02/02: Adding advertised host name for Agent Http transport

This is an automated email from the ASF dual-hosted git repository.

dimuthuupe pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/airavata-mft.git

commit 2c702e25ca8f669d56a07f86e33946c357f3acdd
Author: Dimuthu Wannipurage <di...@gmail.com>
AuthorDate: Wed Jul 14 23:04:11 2021 -0400

    Adding advertised host name for Agent Http transport
---
 .../src/main/java/org/apache/airavata/mft/agent/rpc/RPCParser.java  | 6 +++---
 agent/src/main/resources/application.properties                     | 3 ++-
 agent/src/main/resources/distribution/conf/application.properties   | 1 +
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/agent/src/main/java/org/apache/airavata/mft/agent/rpc/RPCParser.java b/agent/src/main/java/org/apache/airavata/mft/agent/rpc/RPCParser.java
index 669d30f..7cf638b 100644
--- a/agent/src/main/java/org/apache/airavata/mft/agent/rpc/RPCParser.java
+++ b/agent/src/main/java/org/apache/airavata/mft/agent/rpc/RPCParser.java
@@ -53,8 +53,8 @@ public class RPCParser {
     @org.springframework.beans.factory.annotation.Value("${secret.service.port}")
     private int secretServicePort;
 
-    @org.springframework.beans.factory.annotation.Value("${agent.host}")
-    private String agentHost;
+    @org.springframework.beans.factory.annotation.Value("${agent.advertised.host}")
+    private String agentAdvertisedHost;
 
     @org.springframework.beans.factory.annotation.Value("${agent.http.port}")
     private Integer agentHttpPort;
@@ -175,7 +175,7 @@ public class RPCParser {
                             .setOtherConnector(connectorOp.get())
                             .setAuthToken(mftAuthorizationToken);
                     String url = httpTransferRequestsStore.addDownloadRequest(transferRequest);
-                    return (agentHttpsEnabled? "https": "http") + "://" + agentHost + ":" + agentHttpPort + "/" + url;
+                    return (agentHttpsEnabled? "https": "http") + "://" + agentAdvertisedHost + ":" + agentHttpPort + "/" + url;
                 }
                 break;
         }
diff --git a/agent/src/main/resources/application.properties b/agent/src/main/resources/application.properties
index e7cbcef..d5949da 100644
--- a/agent/src/main/resources/application.properties
+++ b/agent/src/main/resources/application.properties
@@ -16,9 +16,10 @@
 #
 
 spring.main.web-application-type=NONE
-agent.id=mft-agent-c
+agent.id=agent0
 agent.secret=CHANGE_ME
 agent.host=localhost
+agent.advertised.host=localhost
 agent.user=dimuthu
 agent.http.port=3333
 agent.https.enabled=false
diff --git a/agent/src/main/resources/distribution/conf/application.properties b/agent/src/main/resources/distribution/conf/application.properties
index 36900d4..d5949da 100644
--- a/agent/src/main/resources/distribution/conf/application.properties
+++ b/agent/src/main/resources/distribution/conf/application.properties
@@ -19,6 +19,7 @@ spring.main.web-application-type=NONE
 agent.id=agent0
 agent.secret=CHANGE_ME
 agent.host=localhost
+agent.advertised.host=localhost
 agent.user=dimuthu
 agent.http.port=3333
 agent.https.enabled=false