Skip to content

Commit

Permalink
Refactor GooglePubSubConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
assadriaz committed Oct 22, 2024
1 parent 8cc0812 commit de3b627
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

package org.rutebanken.tiamat.changelog;

import org.rutebanken.tiamat.config.GooglePubSubConfig;
import org.rutebanken.tiamat.config.PubsubOutboundGateway;
import org.rutebanken.tiamat.model.EntityInVersionStructure;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
Expand All @@ -29,7 +29,7 @@
public class EntityChangedEventPubSubPublisher extends EntityChangedEventPublisher implements EntityChangedListener {

@Autowired
private GooglePubSubConfig.PubsubOutboundGateway pubsubOutboundGateway;
private PubsubOutboundGateway pubsubOutboundGateway;

@Value("${changelog.gcp.publish.enabled:true}")
private boolean pubSubPublish;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.integration.annotation.MessagingGateway;
import org.springframework.integration.annotation.ServiceActivator;
import org.springframework.messaging.MessageHandler;

Expand All @@ -21,9 +20,4 @@ public class GooglePubSubConfig {
public MessageHandler messageSender(PubSubTemplate pubsubTemplate) {
return new PubSubMessageHandler(pubsubTemplate, pubSubTopic);
}

@MessagingGateway(defaultRequestChannel = "pubsubOutputChannel")
public interface PubsubOutboundGateway {
void sendToPubsub(String text);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package org.rutebanken.tiamat.config;

import org.springframework.context.annotation.Profile;
import org.springframework.integration.annotation.MessagingGateway;

@Profile("google-pubsub")
@MessagingGateway(defaultRequestChannel = "pubsubOutputChannel")
public interface PubsubOutboundGateway {
void sendToPubsub(String text);
}

0 comments on commit de3b627

Please sign in to comment.