Closed sdack-cloud closed 1 year ago
spring version: 2.7.2 rsocket: 1.1.2
@ConnectMapping("conn") fun connect(requester: RSocketRequester, @Payload client: String?) {}
val tokenMetadata = BearerTokenMetadata(token) val uri = URI.create("ws://localhost:7002") rSocketRequester = RSocketRequester.builder() .setupMetadata(tokenMetadata, SIMPLE_AUTH) .setupRoute("conn") .setupData("4,333") .rsocketStrategies { it.encoder(ProtobufEncoder()) .decoder( ProtobufDecoder()) } .websocket(uri)
val metadata = ByteBufAllocator.DEFAULT.compositeBuffer() val routingMetadata = TaggingMetadataCodec.createRoutingMetadata(ByteBufAllocator.DEFAULT, listOf("conn")) CompositeMetadataCodec.encodeAndAddMetadata( metadata, ByteBufAllocator.DEFAULT, WellKnownMimeType.MESSAGE_RSOCKET_ROUTING, routingMetadata.content ) val bearerMetadata = AuthMetadataCodec.encodeMetadata(ByteBufAllocator.DEFAULT, WellKnownAuthType.BEARER, Unpooled.copiedBuffer(token, CharsetUtil.UTF_8)) CompositeMetadataCodec.encodeAndAddMetadata( metadata, ByteBufAllocator.DEFAULT, WellKnownMimeType.MESSAGE_RSOCKET_AUTHENTICATION, bearerMetadata ) rSocket = RSocketConnector.create() .metadataMimeType(WellKnownMimeType.MESSAGE_RSOCKET_AUTHENTICATION.string) .dataMimeType(WellKnownMimeType.APPLICATION_CBOR.string) .setupPayload(DefaultPayload.create("4,333".toByteArray(),ByteBufUtil.getBytes(metadata))) .connect(transport)
rsocket client. Cannot map to @ConnectMapping("conn")
spring version: 2.7.2 rsocket: 1.1.2
spring Server
spring client. RESULT : OK
rsocket client RESULT: Error
rsocket client. Cannot map to @ConnectMapping("conn")