|
31 | 31 | import org.springframework.messaging.handler.invocation.reactive.HandlerMethodArgumentResolver;
|
32 | 32 | import org.springframework.messaging.handler.invocation.reactive.SyncHandlerMethodArgumentResolver;
|
33 | 33 | import org.springframework.messaging.rsocket.RSocketRequester;
|
| 34 | +import org.springframework.messaging.rsocket.RSocketStrategies; |
34 | 35 | import org.springframework.messaging.rsocket.annotation.support.RSocketMessageHandler;
|
35 | 36 | import org.springframework.util.Assert;
|
36 | 37 | import org.springframework.util.MimeType;
|
@@ -123,18 +124,23 @@ protected List<? extends HandlerMethodArgumentResolver> initArgumentResolvers()
|
123 | 124 | }
|
124 | 125 |
|
125 | 126 | protected IntegrationRSocket createRSocket(ConnectionSetupPayload setupPayload, RSocket rsocket) {
|
126 |
| - String s = setupPayload.dataMimeType(); |
127 |
| - MimeType dataMimeType = StringUtils.hasText(s) ? MimeTypeUtils.parseMimeType(s) : this.defaultDataMimeType; |
| 127 | + String mimeType = setupPayload.dataMimeType(); |
| 128 | + MimeType dataMimeType = |
| 129 | + StringUtils.hasText(mimeType) |
| 130 | + ? MimeTypeUtils.parseMimeType(mimeType) |
| 131 | + : this.defaultDataMimeType; |
128 | 132 | Assert.notNull(dataMimeType, "No `dataMimeType` in ConnectionSetupPayload and no default value");
|
129 |
| - |
130 |
| - s = setupPayload.metadataMimeType(); |
131 |
| - MimeType metaMimeType = StringUtils.hasText(s) ? MimeTypeUtils.parseMimeType(s) : this.defaultMetadataMimeType; |
| 133 | + mimeType = setupPayload.metadataMimeType(); |
| 134 | + MimeType metaMimeType = |
| 135 | + StringUtils.hasText(mimeType) |
| 136 | + ? MimeTypeUtils.parseMimeType(mimeType) |
| 137 | + : this.defaultMetadataMimeType; |
132 | 138 | Assert.notNull(dataMimeType, "No `metadataMimeType` in ConnectionSetupPayload and no default value");
|
133 |
| - |
134 |
| - RSocketRequester requester = RSocketRequester.wrap(rsocket, dataMimeType, metaMimeType, getRSocketStrategies()); |
135 |
| - |
| 139 | + RSocketStrategies rSocketStrategies = getRSocketStrategies(); |
| 140 | + Assert.notNull(rSocketStrategies, "No `rSocketStrategies` provided"); |
| 141 | + RSocketRequester requester = RSocketRequester.wrap(rsocket, dataMimeType, metaMimeType, rSocketStrategies); |
136 | 142 | return new IntegrationRSocket(this, getRouteMatcher(), requester, dataMimeType, metaMimeType,
|
137 |
| - getRSocketStrategies().dataBufferFactory()); |
| 143 | + rSocketStrategies.dataBufferFactory()); |
138 | 144 | }
|
139 | 145 |
|
140 | 146 | private static final class MessageHandlerMethodArgumentResolver implements SyncHandlerMethodArgumentResolver {
|
|
0 commit comments