Skip to content

Commit

Permalink
fix(sqs): worker startup conditional on enabled (#236)
Browse files Browse the repository at this point in the history
  • Loading branch information
emjburns committed Feb 16, 2018
1 parent c519bfc commit e1574c9
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
Expand All @@ -44,6 +46,7 @@
* Starts the individual SQS workers (one for each subscription)
*/
@Component
@ConditionalOnProperty("pubsub.amazon.enabled")
public class SQSSubscriberProvider implements DiscoveryActivated {
private static final Logger log = LoggerFactory.getLogger(SQSSubscriberProvider.class);

Expand All @@ -57,13 +60,13 @@ public class SQSSubscriberProvider implements DiscoveryActivated {
@Autowired
SQSSubscriberProvider(ObjectMapper objectMapper,
AWSCredentialsProvider awsCredentialsProvider,
Optional<AmazonPubsubProperties> properties,
AmazonPubsubProperties properties,
PubsubSubscribers pubsubSubscribers,
PubsubMessageHandler pubsubMessageHandler,
Registry registry) {
this.objectMapper = objectMapper;
this.awsCredentialsProvider = awsCredentialsProvider;
this.properties = properties.orElse(null);
this.properties = properties;
this.pubsubSubscribers = pubsubSubscribers;
this.pubsubMessageHandler = pubsubMessageHandler;
this.registry = registry;
Expand Down

0 comments on commit e1574c9

Please sign in to comment.