Commit f5098a5d authored by Nikhil Singh[MicroSoft]'s avatar Nikhil Singh[MicroSoft]
Browse files

Commit 6 Contents:

1-Response code correction and Config addition for wait time
parent 990be890
Pipeline #49634 failed with stages
in 33 seconds
......@@ -55,7 +55,7 @@ public class PubsubEndpoint {
HttpResponse response = notificationHandler.notifySubscriber(notificationId, pubsubMessage, headerAttributes);
if (!response.isSuccessCode()) {
this.log.error(NOT_ACKNOWLEDGE);
return new ResponseEntity<String>(NOT_ACKNOWLEDGE, HttpStatus.INTERNAL_SERVER_ERROR);
return new ResponseEntity<String>(NOT_ACKNOWLEDGE, HttpStatus.valueOf(response.getResponseCode()));
}
this.log.info(ACKNOWLEDGE);
return new ResponseEntity<String>(ACKNOWLEDGE, HttpStatus.OK);
......
......@@ -35,22 +35,18 @@ public class GsaAuth implements SecretAuth {
private GsaSecret gsaSecret;
@Override
public void setSecret(Secret secret) {
this.gsaSecret = (GsaSecret) secret;
}
@Override
public Secret getSecret() {
return this.gsaSecret;
}
@Override
public String getPushUrl(String endpoint) throws Exception {
return endpoint;
}
@Override
public Map<String, String> getRequestHeaders() {
Map<String, String> requestHeader = new HashMap<>();
if (gsaSecret != null) {
......
......@@ -32,17 +32,14 @@ public class HmacAuth implements SecretAuth {
private HmacSecret hmacSecret;
@Override
public void setSecret(Secret secret) {
this.hmacSecret = (HmacSecret) secret;
}
@Override
public Secret getSecret() {
return this.hmacSecret;
}
@Override
public String getPushUrl(String endpoint) throws Exception {
String pushUrl = endpoint;
try {
......@@ -54,7 +51,6 @@ public class HmacAuth implements SecretAuth {
return pushUrl;
}
@Override
public Map<String, String> getRequestHeaders() {
Map<String, String> requestHeader = new HashMap<>();
return requestHeader;
......
......@@ -41,7 +41,7 @@ public class NotificationHandler {
private SubscriptionHandler subscriptionHandler;
@Autowired
private AuthFactory authFactory;
@Value("${app.expireTime:30000}")
@Value("${app.waitingTime:30000}")
private int WAITING_TIME ;
public HttpResponse notifySubscriber(String notificationId, String pubsubMessage, Map<String, String> headerAttributes) throws Exception {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment