await stream.ForEachAsync(quotes => Console.WriteLine($"RawDemo.OnNext===>[{quotes.Metadata}]{quotes.Data}"));
byte[] intBytes = BitConverter.GetBytes(6);
string stringBytes = Encoding.Default.GetString(intBytes, 0, 1);
metaData = stringBytes + "quotes";
var stringclient = new RSocketClient.ForStrings(client); //A simple client that uses UTF8 strings instead of bytes.
await stringclient.RequestStream(json, metaData)
.ForEachAsync((result) =>
{
Console.WriteLine($"Result ===> {result}");
});
var client = new RSocketClient(new WebSocketTransport("ws://localhost:8080/"));
await client.ConnectAsync(new RSocketOptions()
{
MetadataMimeType = "message/x.rsocket.routing.v0",
DataMimeType = "application/octet-stream"
});
Console.WriteLine("Requesting Raw Protobuf Stream...");
var route = new ReadOnlySequence<byte>(new byte[]
{
(byte) Encoding.UTF8.GetByteCount("request.stream")
}.Concat(Encoding.UTF8.GetBytes("request.stream")).ToArray());
//Make a Raw binary call just to show how it's done.
var stream = client.RequestStream(
resultmapper: result => (Data: Encoding.UTF8.GetString(result.data.ToArray()), Metadata: Encoding.UTF8.GetString(result.metadata.ToArray())),
data: new ReadOnlySequence<byte>(Encoding.UTF8.GetBytes("test")), metadata: route);
await stream.ForEachAsync(persons => Console.WriteLine($"RawDemo.OnNext===>[{persons.Metadata}]{persons.Data}"));
Hi Oleh, Can I use this dependency in my spring boot project?
<dependency>
<groupId>io.rsocket.routing</groupId>
<artifactId>rsocket-routing-broker-spring</artifactId>
<version>0.3.0-SNAPSHOT</version>
</dependency>
I configured spring snapshot repo in my pom, but got "Not authorized" when compile.
REQUEST-CHANNEL
mode. If a pod went down, how could that work be transitioned?Hi everyone.
I have a question.
is Rsocket-routing-client-spring support spring security?
i was cofig spring security for Rsocket-routing-client-spring but it have not effect.
hi there, I found rsocket really interesting and promising. With a colleague of mine, we have setup a little poc to test many features of RSocket and RSocket spring libs.
As for now, we have setup web javascript client talking to a java broker built ontop of rsocket-routing-broker-spring.
And our javascript client uses js libs rsocket-core and rsocket-websocket-client.
BUT (there is always a but), our js client can't succeed in connecting to java broker. And the error thrown back to brower app states the following:
RSocket error 0x3 (REJECTED_SETUP): RouteSetup not found in metadata. See error source
property for details.
RSocket open channel request error: Error: RSocket error 0x3 (REJECTED_SETUP): RouteSetup not found in metadata. See error source property for details.
at createErrorFromFrame (RSocketFrame.js?626d:271)
at RSocketMachineImpl._handleConnectionFrame (RSocketMachine.js?4c6f:605)
at Object.eval [as onNext] (RSocketMachine.js?4c6f:252)
at FlowableSubscriber.onNext (Flowable.js?468d:249)
at ReassemblySubscriber.onNext (ReassemblyDuplexConnection.js?899c:132)
at eval (RSocketWebSocketClient.js?9ba9:80)
at Set.forEach (<anonymous>)
at WebSocket.eval (RSocketWebSocketClient.js?9ba9:80)
As far as we understand it, web-app doesn't send setup configuration as expected by java broker but we can not find any useful documentation or ressource.
So, here our question, does someone have a pure javascript example or sample showing how a js client sends a valid RouteSetup to a java broker?
Thanks in advance
PS : Please be kind for any english mistakes (not fluent) ;)
Hi @OlegDokuka, @spencergibb
Thanks for the useful insights on rsocket.
I have a request if you could provide a sample reference for "rsocket-broker-spring" and "rsocket-broker-http-bridge" with retry and resume when broker or http-bridge is restarted but the requester and responder are still up and running.
I have been trying to achieve this for almost one week but got no luck.
below are repositories of which I have taken the reference.
https://github.com/spencergibb/rsocket-broker-sample
https://github.com/OlgaMaciaszek/spring-one-2021-rsocket-http-sample