Support user destinations without leading slash

Before this commit the DefaultUserDestinationResolver did not support
well broker destinations that use dot as separator with a built in
assumptions that the destinations it resolves must start with slash.

This change adds PathMatcher property that is used to determine if
an alternative path separator is in use and if so the leading slash is
left out.

Issue: SPR-14044
This commit is contained in:
Rossen Stoyanchev
2016-03-15 17:46:47 -04:00
parent e904ce4ead
commit 183594207f
5 changed files with 78 additions and 7 deletions

View File

@@ -573,6 +573,10 @@ class MessageBrokerBeanDefinitionParser implements BeanDefinitionParser {
if (brokerElem.hasAttribute("user-destination-prefix")) {
beanDef.getPropertyValues().add("userDestinationPrefix", brokerElem.getAttribute("user-destination-prefix"));
}
if (brokerElem.hasAttribute("path-matcher")) {
String pathMatcherRef = brokerElem.getAttribute("path-matcher");
beanDef.getPropertyValues().add("pathMatcher", new RuntimeBeanReference(pathMatcherRef));
}
return new RuntimeBeanReference(registerBeanDef(beanDef, context, source));
}