IN PROGRESS - issue INT-567: Add round-robin dispatching strategy

http://jira.springframework.org/browse/INT-567

- Renamed LoadBalancingDispatcher to more explicit RoundRobinDispatcher
- Removed round-robin option from xsd (not specifying a dispatcher yields the same)
This commit is contained in:
Iwein Fuld
2009-03-09 21:36:10 +00:00
parent 01fe7a0baf
commit 8f122cf58c
8 changed files with 24 additions and 13 deletions

View File

@@ -38,7 +38,7 @@ import org.springframework.integration.core.Message;
import org.springframework.integration.core.MessageChannel;
import org.springframework.integration.core.MessagePriority;
import org.springframework.integration.dispatcher.FailOverDispatcher;
import org.springframework.integration.dispatcher.LoadBalancingDispatcher;
import org.springframework.integration.dispatcher.RoundRobinDispatcher;
import org.springframework.integration.message.GenericMessage;
import org.springframework.integration.message.MessageBuilder;
import org.springframework.integration.message.MessageDeliveryException;
@@ -75,7 +75,7 @@ public class ChannelParserTests {
MessageChannel channel = (MessageChannel) context.getBean("defaultChannel");
assertEquals(DirectChannel.class, channel.getClass());
DirectFieldAccessor accessor = new DirectFieldAccessor(channel);
assertThat(accessor.getPropertyValue("dispatcher"), is(LoadBalancingDispatcher.class));
assertThat(accessor.getPropertyValue("dispatcher"), is(RoundRobinDispatcher.class));
}
@Test

View File

@@ -12,7 +12,7 @@
<channel id="defaultChannel" />
<channel id="failOverChannel" dispatcher="fail-over"/>
<channel id="failOverChannel" dispatcher="failover"/>
<publish-subscribe-channel id="publishSubscribeChannel" />

View File

@@ -16,11 +16,11 @@ import org.springframework.integration.message.MessageHandler;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
@RunWith(MockitoJUnit44Runner.class)
public class LoadBalancingDispatcherConcurrentTests {
public class RoundRobinDispatcherConcurrentTests {
private static final int TOTAL_EXECUTIONS = 40;
private AbstractWinningHandlerDispatcher dispatcher = new LoadBalancingDispatcher();
private AbstractWinningHandlerDispatcher dispatcher = new RoundRobinDispatcher();
private ThreadPoolTaskExecutor scheduler = new ThreadPoolTaskExecutor();

View File

@@ -33,9 +33,9 @@ import org.springframework.integration.message.MessageHandler;
*
*/
@RunWith(MockitoJUnit44Runner.class)
public class LoadBalancingDispatcherTests {
public class RoundRobinDispatcherTests {
private AbstractWinningHandlerDispatcher dispatcher = new LoadBalancingDispatcher();
private AbstractWinningHandlerDispatcher dispatcher = new RoundRobinDispatcher();
@Mock
private MessageHandler handler;