Skip to content

Commit

Permalink
Fix dataMimeType and metadataMimeType mixup in precondition check
Browse files Browse the repository at this point in the history
Closes gh-23292
  • Loading branch information
sbrannen committed Jul 16, 2019
1 parent c788be3 commit 60a7092
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ protected List<? extends HandlerMethodReturnValueHandler> initReturnValueHandler
}


@Override
@Nullable
protected CompositeMessageCondition getCondition(AnnotatedElement element) {
MessageMapping annot1 = AnnotatedElementUtils.findMergedAnnotation(element, MessageMapping.class);
Expand Down Expand Up @@ -305,16 +306,16 @@ private MessagingRSocket createResponder(ConnectionSetupPayload setupPayload, RS
Assert.notNull(dataMimeType, "No `dataMimeType` in ConnectionSetupPayload and no default value");

s = setupPayload.metadataMimeType();
MimeType metaMimeType = StringUtils.hasText(s) ? MimeTypeUtils.parseMimeType(s) : this.defaultMetadataMimeType;
Assert.notNull(dataMimeType, "No `metadataMimeType` in ConnectionSetupPayload and no default value");
MimeType metadataMimeType = StringUtils.hasText(s) ? MimeTypeUtils.parseMimeType(s) : this.defaultMetadataMimeType;
Assert.notNull(metadataMimeType, "No `metadataMimeType` in ConnectionSetupPayload and no default value");

RSocketStrategies strategies = this.rsocketStrategies;
Assert.notNull(strategies, "No RSocketStrategies. Was afterPropertiesSet not called?");
RSocketRequester requester = RSocketRequester.wrap(rsocket, dataMimeType, metaMimeType, strategies);
RSocketRequester requester = RSocketRequester.wrap(rsocket, dataMimeType, metadataMimeType, strategies);

Assert.notNull(this.metadataExtractor, () -> "No MetadataExtractor. Was afterPropertiesSet not called?");

return new MessagingRSocket(dataMimeType, metaMimeType, this.metadataExtractor, requester,
return new MessagingRSocket(dataMimeType, metadataMimeType, this.metadataExtractor, requester,
this, getRouteMatcher(), strategies.dataBufferFactory());
}

Expand Down

0 comments on commit 60a7092

Please sign in to comment.