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/24 20:20:06 UTC
[airavata-mft] branch develop updated: Introducing the http
advertise url for agent
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
The following commit(s) were added to refs/heads/develop by this push:
new 66d2a0a Introducing the http advertise url for agent
66d2a0a is described below
commit 66d2a0a6c153518b883023f6647ab3e0f1e67b82
Author: Dimuthu Wannipurage <di...@gmail.com>
AuthorDate: Sat Jul 24 16:19:52 2021 -0400
Introducing the http advertise url for agent
---
.../java/org/apache/airavata/mft/agent/rpc/RPCParser.java | 13 ++++---------
.../main/resources/distribution/conf/application.properties | 2 +-
2 files changed, 5 insertions(+), 10 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 7cf638b..0fd83cb 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,14 +53,8 @@ public class RPCParser {
@org.springframework.beans.factory.annotation.Value("${secret.service.port}")
private int secretServicePort;
- @org.springframework.beans.factory.annotation.Value("${agent.advertised.host}")
- private String agentAdvertisedHost;
-
- @org.springframework.beans.factory.annotation.Value("${agent.http.port}")
- private Integer agentHttpPort;
-
- @org.springframework.beans.factory.annotation.Value("${agent.https.enabled}")
- private boolean agentHttpsEnabled;
+ @org.springframework.beans.factory.annotation.Value("${agent.advertised.url}")
+ private String agentAdvertisedUrl;
@Autowired
private HttpTransferRequestsStore httpTransferRequestsStore;
@@ -175,7 +169,8 @@ public class RPCParser {
.setOtherConnector(connectorOp.get())
.setAuthToken(mftAuthorizationToken);
String url = httpTransferRequestsStore.addDownloadRequest(transferRequest);
- return (agentHttpsEnabled? "https": "http") + "://" + agentAdvertisedHost + ":" + agentHttpPort + "/" + url;
+
+ return (agentAdvertisedUrl.endsWith("/")? agentAdvertisedUrl : agentAdvertisedUrl + "/") + url;
}
break;
}
diff --git a/agent/src/main/resources/distribution/conf/application.properties b/agent/src/main/resources/distribution/conf/application.properties
index d5949da..1b00a6c 100644
--- a/agent/src/main/resources/distribution/conf/application.properties
+++ b/agent/src/main/resources/distribution/conf/application.properties
@@ -19,7 +19,7 @@ spring.main.web-application-type=NONE
agent.id=agent0
agent.secret=CHANGE_ME
agent.host=localhost
-agent.advertised.host=localhost
+agent.advertised.url=http://localhost
agent.user=dimuthu
agent.http.port=3333
agent.https.enabled=false