Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

test spring cloud stream

@SpringBootApplication
@EnableBinding(Sink.class)
public class JdbcSink {

  @Bean
  @ServiceActivator(inputChannel = Sink.INPUT)
  public MessageHandler logHandler(DataSource dataSource) {
     return new JdbcMessageHandler(dataSource,
                                 "INSERT INTO foobar (value) VALUES (:payload)");
  }
}Copy
Source by spring.io #
 
PREVIOUS NEXT
Tagged: #test #spring #cloud #stream
ADD COMMENT
Topic
Name
8+8 =