Skip to content

resume not supported #1058

Open
Open
@sdack-cloud

Description

@sdack-cloud

2022-08-08 21:58:55.982 27203-27265/com.example.rsocket E/AndroidRuntime: FATAL EXCEPTION: DefaultDispatcher-worker-2
Process: com.example.rsocket, PID: 27203
UnsupportedSetupException (0x2): resume not supported
at io.rsocket.exceptions.Exceptions.from(Exceptions.java:60)
at io.rsocket.core.RSocketRequester.lambda$tryTerminateOnZeroError$4(RSocketRequester.java:313)
at io.rsocket.core.-$$Lambda$RSocketRequester$rwbq8EQ-eZ8va-mvaHgd0inROSU.get(Unknown Source:2)
at io.rsocket.core.RSocketRequester.tryTerminate(RSocketRequester.java:318)
at io.rsocket.core.RSocketRequester.tryTerminateOnZeroError(RSocketRequester.java:313)
at io.rsocket.core.RSocketRequester.handleStreamZero(RSocketRequester.java:224)
at io.rsocket.core.RSocketRequester.handleIncomingFrames(RSocketRequester.java:209)
at io.rsocket.core.RSocketRequester.lambda$kDn7LIfo960b6cXO3SLu8QVkTAE(Unknown Source:0)
at io.rsocket.core.-$$Lambda$RSocketRequester$kDn7LIfo960b6cXO3SLu8QVkTAE.accept(Unknown Source:4)
at reactor.core.publisher.LambdaSubscriber.onNext(LambdaSubscriber.java:160)
at io.rsocket.core.ClientServerInputMultiplexer$InternalDuplexConnection.onNext(ClientServerInputMultiplexer.java:248)

Spring dependency rsocket:1.1.2

spring log

2022-08-09 07:36:58.259 DEBUG 46773 --- [ctor-http-nio-6] io.rsocket.FrameLogger : sending -> UnsupportedSetupException: resume not supported

My connection example

        GlobalScope.launch {
            val transport = WebsocketClientTransport.create(URI.create("ws://192.168.43.40:7002"))
//            try {
                if (clientRSocket == null || !clientRSocket!!.isDisposed) {
                    Log.e("TAG", "连接中。。。" )
                    clientRSocket = RSocketConnector.create()
                        .metadataMimeType(WellKnownMimeType.MESSAGE_RSOCKET_COMPOSITE_METADATA.string)
                        .dataMimeType(WellKnownMimeType.APPLICATION_JSON.string)
                        .setupPayload(DefaultPayload.create("ttest"))
                        .acceptor(
                            SocketAcceptor.forRequestResponse { payload: Payload ->
                                val route: String? = decodeRoute(payload.sliceMetadata())
                                payload.release()
                                if ("message" == route) {
                                    val meta = MetaVo.Meta.parseFrom(payload.data)
                                    Log.e("MESSAGE", meta.toString())
                                    Mono.just(meta)
                                }
                                Mono.error(IllegalArgumentException("Route $route not found"))
                            }
                        )
                        .keepAlive(Duration.ofSeconds(30), Duration.ofMinutes(30))
//                        .reconnect(Retry.fixedDelay(4, Duration.ofSeconds(5)))
                        .resume(Resume().retry(Retry.fixedDelay(4, Duration.ofSeconds(5))))
//                        .resume(Resume().retry(Retry.backoff(Long.MAX_VALUE, Duration.ofSeconds(1))
//                            .maxBackoff(Duration.ofSeconds(16))
//                            .jitter(1.0)))
                        .connect(transport)
                        .doOnSuccess {
                            Log.e("TAG", "Success")

                        }
                        .doOnCancel {
                            Log.e("TAG", "Cancel")
                        }
                        .doOnError {
                            Log.e("TAG", "Error")
                            it.printStackTrace()
                        }.doFinally {
                            Log.e("TAG", "Finally")
                        }
                        .block()

                }
//            } catch (e :Exception) {
//                Log.e("Exception", "" )
//                e.printStackTrace()
//            }

            if (clientRSocket != null) {
                clientRSocket!!
                    .onClose()
                    .doOnSuccess {
                        Log.e("CLOSE", "Success")
                    }
                    .doOnCancel {
                        Log.e("CLOSE", "Cancel")
                    }
                    .doOnError {
                        Log.e("CLOSE", "Error")
                        it.printStackTrace()
                    }
                    .doFinally {
                        Log.e("CLOSE", "Finally")
                    }
                    .block()
            }
        }

Can you give me some guidance

How to write resume()

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions