Reputation: 2761
I'm tryng to run an SCS app locally using GCP's Pub Sum as binder.
K
m
mmkkkk. Mmm org.sm.Mpringframework.cloudkki
spring-cloud-gcp-starter-pubsub
M
Here is the configl
@Configu@Configukration
@EnableBindingkklk(Source.class)
public class TimerSourcek {
@Bean
@InboundChannelAdapter(channel = "channel", poller = @Poller(fixedDelay = "1000", maxMessagesPerPoll = "1"))
public MessageSource<String> timerMessageSource() {
return () -> new GenericMessage<>(new SimpleDateFormat("HH:mm:ss").format(new Date()));
}
}
Here is the error message when starting the main app:
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-02-13 15:42:48.627 ERROR 22276 --- [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.context.ApplicationContextException: Failed to start bean 'outputBindingLifecycle'; nested exception is java.lang.IllegalArgumentException: A default binder has been requested, but there is no binder available
I'd like to run this code either locally or against my GCP project. How can that be done?
Upvotes: 1
Views: 2190
Reputation: 121507
The spring-cloud-gcp-starter-pubsub
doesn't bring for you a binder dependency.
You need to use a spring-cloud-gcp-pubsub-stream-binder
also:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-gcp-starter-pubsub</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-gcp-pubsub-stream-binder</artifactId>
</dependency>
See samples in the project for more info: https://github.com/spring-cloud/spring-cloud-gcp/tree/master/spring-cloud-gcp-samples
Upvotes: 3