List of usage examples for org.springframework.integration.channel FixedSubscriberChannel FixedSubscriberChannel
public FixedSubscriberChannel(MessageHandler handler)
From source file:org.springframework.integration.channel.DirectChannelTests.java
@Test public void testSendPerfFixedSubscriberChannel() { /*/*from w ww .jav a 2s . co m*/ * INT-3308 - 96 million/sec * NOTE: in order to get a measurable time, I had to add some code to the handler - * presumably the JIT compiler short circuited the call becaues it's a final field * and he knows the method does nothing. * Added the same code to the other tests for comparison. */ final AtomicInteger count = new AtomicInteger(); FixedSubscriberChannel channel = new FixedSubscriberChannel(message -> count.incrementAndGet()); GenericMessage<String> message = new GenericMessage<String>("test"); assertTrue(channel.send(message)); for (int i = 0; i < 100000000; i++) { channel.send(message, 0); } }