-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1920 from HubSpot/sns_webhooks
Add ability to do sns-based updates instead of webhooks
- Loading branch information
Showing
26 changed files
with
668 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
121 changes: 121 additions & 0 deletions
121
...larityService/src/main/java/com/hubspot/singularity/config/WebhookQueueConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
package com.hubspot.singularity.config; | ||
|
||
import java.util.Map; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.google.common.base.Optional; | ||
import com.google.common.collect.ImmutableMap; | ||
import com.hubspot.singularity.WebhookType; | ||
import com.hubspot.singularity.hooks.WebhookQueueType; | ||
|
||
public class WebhookQueueConfiguration { | ||
@JsonProperty | ||
private WebhookQueueType queueType = WebhookQueueType.ZOOKEEPER; | ||
|
||
@JsonProperty | ||
private Map<WebhookType, String> snsTopics = ImmutableMap.of( | ||
WebhookType.TASK, "singularity-task-updates", | ||
WebhookType.DEPLOY, "singularity-deploy-updates", | ||
WebhookType.REQUEST, "singularity-request-updates" | ||
); | ||
|
||
@JsonProperty | ||
private Optional<String> awsAccessKey = Optional.absent(); | ||
|
||
@JsonProperty | ||
private Optional<String> awsSecretKey = Optional.absent(); | ||
|
||
@JsonProperty | ||
private Optional<String> awsRegion = Optional.absent(); | ||
|
||
private int snsRequestTimeout = 3000; | ||
|
||
private int snsSocketTimeout = 3000; | ||
|
||
private int snsConnectTimeout = 2000; | ||
|
||
private int snsTotalTimeout = 5000; | ||
|
||
// Protection for zookeeper so large list children calls will not take it down | ||
private int maxZkQueuedWebhooksPerParentNode = 3000; | ||
|
||
public WebhookQueueType getQueueType() { | ||
return queueType; | ||
} | ||
|
||
public void setQueueType(WebhookQueueType queueType) { | ||
this.queueType = queueType; | ||
} | ||
|
||
public Map<WebhookType, String> getSnsTopics() { | ||
return snsTopics; | ||
} | ||
|
||
public void setSnsTopics(Map<WebhookType, String> snsTopics) { | ||
this.snsTopics = snsTopics; | ||
} | ||
|
||
public Optional<String> getAwsAccessKey() { | ||
return awsAccessKey; | ||
} | ||
|
||
public void setAwsAccessKey(Optional<String> awsAccessKey) { | ||
this.awsAccessKey = awsAccessKey; | ||
} | ||
|
||
public Optional<String> getAwsSecretKey() { | ||
return awsSecretKey; | ||
} | ||
|
||
public void setAwsSecretKey(Optional<String> awsSecretKey) { | ||
this.awsSecretKey = awsSecretKey; | ||
} | ||
|
||
public Optional<String> getAwsRegion() { | ||
return awsRegion; | ||
} | ||
|
||
public void setAwsRegion(Optional<String> awsRegion) { | ||
this.awsRegion = awsRegion; | ||
} | ||
|
||
public int getSnsRequestTimeout() { | ||
return snsRequestTimeout; | ||
} | ||
|
||
public void setSnsRequestTimeout(int snsRequestTimeout) { | ||
this.snsRequestTimeout = snsRequestTimeout; | ||
} | ||
|
||
public int getSnsSocketTimeout() { | ||
return snsSocketTimeout; | ||
} | ||
|
||
public void setSnsSocketTimeout(int snsSocketTimeout) { | ||
this.snsSocketTimeout = snsSocketTimeout; | ||
} | ||
|
||
public int getSnsConnectTimeout() { | ||
return snsConnectTimeout; | ||
} | ||
|
||
public void setSnsConnectTimeout(int snsConnectTimeout) { | ||
this.snsConnectTimeout = snsConnectTimeout; | ||
} | ||
|
||
public int getSnsTotalTimeout() { | ||
return snsTotalTimeout; | ||
} | ||
|
||
public void setSnsTotalTimeout(int snsTotalTimeout) { | ||
this.snsTotalTimeout = snsTotalTimeout; | ||
} | ||
|
||
public int getMaxZkQueuedWebhooksPerParentNode() { | ||
return maxZkQueuedWebhooksPerParentNode; | ||
} | ||
|
||
public void setMaxZkQueuedWebhooksPerParentNode(int maxZkQueuedWebhooksPerParentNode) { | ||
this.maxZkQueuedWebhooksPerParentNode = maxZkQueuedWebhooksPerParentNode; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.