Add Java DSL sample for Kafka 0.9
Make `PromiseTest` more fast decreasing `sleep()` in the `MathService` Kafka-0.10.0 Compatibility Upgrade to Spring Boot 1.4.0.RELEASE Regenerate poms according to upgrades
This commit is contained in:
@@ -23,9 +23,9 @@ import java.util.Random;
|
||||
*/
|
||||
public class MathService {
|
||||
private final Random random = new Random();
|
||||
|
||||
|
||||
public int multiplyByTwo(int i) throws Exception{
|
||||
long sleep = random.nextInt(10) * 500;
|
||||
long sleep = random.nextInt(10) * 100;
|
||||
Thread.sleep(sleep);
|
||||
return i*2;
|
||||
}
|
||||
|
||||
@@ -47,7 +47,6 @@ import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
import reactor.rx.Promise;
|
||||
import reactor.spring.context.config.EnableReactor;
|
||||
|
||||
/**
|
||||
* @author Oleg Zhurakousky
|
||||
@@ -97,29 +96,16 @@ public class PromiseTest {
|
||||
|
||||
@Configuration
|
||||
@EnableIntegration
|
||||
@EnableReactor
|
||||
@ComponentScan
|
||||
@IntegrationComponentScan
|
||||
public static class TestConfig {
|
||||
|
||||
@Bean
|
||||
public MessageChannel gatewayChannel() {
|
||||
return new DirectChannel();
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ServiceActivator(inputChannel = "mathServiceChannel")
|
||||
public MathService mathService() {
|
||||
return new MathService();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public AsyncTaskExecutor exec() {
|
||||
SimpleAsyncTaskExecutor simpleAsyncTaskExecutor = new SimpleAsyncTaskExecutor();
|
||||
simpleAsyncTaskExecutor.setThreadNamePrefix("exec-");
|
||||
return simpleAsyncTaskExecutor;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@MessagingGateway(defaultReplyTimeout = "0", reactorEnvironment = "reactorEnv")
|
||||
|
||||
Reference in New Issue
Block a user