use of com.netflix.spinnaker.kork.pubsub.model.PubsubPublisher in project kork by spinnaker.
the class SNSPublisherProvider method start.
@PostConstruct
public void start() {
if (properties == null) {
return;
}
List<PubsubPublisher> publishers = new ArrayList<>();
properties.getSubscriptions().forEach((AmazonPubsubProperties.AmazonPubsubSubscription subscription) -> {
ARN topicARN = new ARN(subscription.getTopicARN());
log.info("Bootstrapping SNS topic: {}", topicARN);
AmazonSNS amazonSNS = AmazonSNSClientBuilder.standard().withCredentials(awsCredentialsProvider).withClientConfiguration(new ClientConfiguration()).withRegion(topicARN.getRegion()).build();
Supplier<Boolean> isEnabled = PubSubUtils.getEnabledSupplier(dynamicConfig, subscription, discoveryStatus);
SNSPublisher publisher = new SNSPublisher(subscription, amazonSNS, isEnabled, registry, retrySupport);
publishers.add(publisher);
});
pubsubPublishers.putAll(publishers);
}
Aggregations