fixed 'apply-sequence' for DefaultRouterParser and now comma-delimited strings are converted to arrays
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2009 the original author or authors.
|
||||
* Copyright 2002-2010 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -54,6 +54,8 @@ public class DefaultRouterParser extends AbstractDelegatingConsumerEndpointParse
|
||||
IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "timeout");
|
||||
IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "resolution-required");
|
||||
IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "ignore-channel-name-resolution-failures");
|
||||
IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "apply-sequence");
|
||||
IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "ignore-send-failures");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ import org.springframework.integration.core.Message;
|
||||
import org.springframework.integration.core.MessageChannel;
|
||||
import org.springframework.integration.core.MessagingException;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* A base class for router implementations that return only the channel name(s)
|
||||
@@ -135,6 +136,12 @@ public abstract class AbstractChannelNameResolvingMessageRouter extends Abstract
|
||||
}
|
||||
|
||||
protected void addChannelFromString(Collection<MessageChannel> channels, String channelName, Message<?> message) {
|
||||
if (channelName.indexOf(',') != -1) {
|
||||
for (String name : StringUtils.commaDelimitedListToStringArray(channelName)) {
|
||||
addChannelFromString(channels, name, message);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (this.prefix != null) {
|
||||
channelName = this.prefix + channelName;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user