Look at this TS client code snippet below :
this.socketClient.connect().subscribe({
onComplete: socket => {
const endpoint = ‚endpoint’;
socket.requestResponse({
data: id, //id is a non-empty string
metadata: String.fromCharCode(endpoint.length) + endpoint
}).subscribe({
onComplete: () => console.log(’Task completed’),
onError: error => {
console.log('Connection closed due to:: ' + error);
},
});
},
onError: error => console.error(error),
onSubscribe: cancel => {}
});
I need assistance with the proper signature of my server's endpoint
. I tried the suggested solution but faced issues. When I debug getEndpoint
, the call is processed but id
isn't resolved:
@MessageMapping("endpoint")
public Mono<String> getEndpoint(@Payload String id) {
log.info("requested id:"+id);
//Server side logic to fetch the relevant 'endpoint' from the database
return Mono.just(DefaultPayload.create(endpoint));
}
Your support is highly appreciated.