use of org.springframework.messaging.rsocket.annotation.ConnectMapping in project spring-framework by spring-projects.
the class RSocketMessageHandler method getCondition.
@Override
@Nullable
protected CompositeMessageCondition getCondition(AnnotatedElement element) {
MessageMapping ann1 = AnnotatedElementUtils.findMergedAnnotation(element, MessageMapping.class);
if (ann1 != null && ann1.value().length > 0) {
return new CompositeMessageCondition(RSocketFrameTypeMessageCondition.EMPTY_CONDITION, new DestinationPatternsMessageCondition(processDestinations(ann1.value()), obtainRouteMatcher()));
}
ConnectMapping ann2 = AnnotatedElementUtils.findMergedAnnotation(element, ConnectMapping.class);
if (ann2 != null) {
String[] patterns = processDestinations(ann2.value());
return new CompositeMessageCondition(RSocketFrameTypeMessageCondition.CONNECT_CONDITION, new DestinationPatternsMessageCondition(patterns, obtainRouteMatcher()));
}
return null;
}
Aggregations