According to the docs here the currently supported binders (Rabbit and Kafka) rely on RetryTemplate. And for the GCP?
Detail of my project
Spring Boot Version 2.1.3.RELEASE
Dependency pom.xml
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-gcp-starter-pubsub</artifactId>
<version>1.1.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-gcp-pubsub-stream-binder</artifactId>
<version>1.1.0.RELEASE</version>
</dependency>
application.properties
spring.cloud.stream.bindings.input.destination=inputtopic
spring.cloud.stream.bindings.output.destination=outputtopic
spring.cloud.gcp.project-id=testinggcp
spring.cloud.gcp.credentials.location=file:C:/Users/my_gcp_credentials.json
RestController
@EnableBinding({Source.class,Sink.class})
@RestController
public class SourceExample {
@Autowired
private Source source;
@GetMapping("/newMessage")
public UserMessage sendMessage(@RequestParam("messageBody") String messageBody,
@RequestParam("username") String username) {
UserMessage userMessage = new UserMessage(messageBody, username, LocalDateTime.now());
this.source.output().send(new GenericMessage<>(userMessage));
return userMessage;
}
@StreamListener(target = Sink.INPUT)
public void handle(UserMessage userMessage) throws IOException {
System.out.println(userMessage);
}
}