Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @SpringBootApplication
- public class So40962780Application {
- public static void main(String[] args) {
- SpringApplication.run(So40962780Application.class, args);
- }
- @InboundChannelAdapter(channel = "in", poller = @Poller(fixedRate = "5000"))
- public String gen() {
- return "foo";
- }
- @ServiceActivator(inputChannel = "in", outputChannel = "out")
- public ListenableFuture<String> foo(String in) {
- SettableListenableFuture<String> future = new SettableListenableFuture<>();
- future.set(in.toUpperCase());
- return future;
- }
- @ServiceActivator(inputChannel = "out")
- public void syso(Object payload) {
- System.out.println(payload);
- }
- @Bean
- public AsyncConfigurer asyncConfigurer() {
- return new AsyncConfigurer();
- }
- public static class AsyncConfigurer {
- @Autowired
- @Qualifier("so40962780Application.foo.serviceActivator.handler")
- private AbstractReplyProducingMessageHandler fooHandler;
- @PostConstruct
- public void configureAsync() {
- this.fooHandler.setAsync(true);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement