CARVIEW |
Select Language
HTTP/2 200
date: Sat, 19 Jul 2025 13:56:47 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
etag: W/"c1cfbe13368830350a5b3ae1efeb644c"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=s4xkfuqTGJLwHxvRjGsojMfKCYmZNCLU9wO9eovCWkKJzgsVrnhsLBTxzmM7MExz7eJ7bKXn8HYhiCQhZnnA17vH1OWgtBpZUJ6EKqlyLZ1nTPtnBREWLm2B7hfmkauQMpQiUE5BF%2BfqvV0jJVrkqJPH6XqA%2FJdZ1JnraolKJ%2BYl59KpeUQmLtEy6jmf10tr1VCtJ68PFK7nZDVQxhOlBsDa5QRFhJ35Wm%2BL8ypbsg%2Bb4jJ%2FTnIP%2FGnXYzd1BivgQKVZFjEplR%2BGfA5OdJR8Uw%3D%3D--4sKP%2B0KSPVOhmz77--cR5yN8qF6oQKOEmwk0C8qw%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.2125568927.1752933407; Path=/; Domain=github.com; Expires=Sun, 19 Jul 2026 13:56:47 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Sun, 19 Jul 2026 13:56:47 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: DF2A:0A55:28AF27:324D8A:687BA41F
RSocket SDK Stack · alibaba/alibaba-rsocket-broker Wiki · GitHub
Skip to content
Navigation Menu
{{ message }}
This repository was archived by the owner on Jul 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 168
RSocket SDK Stack
linux_china edited this page Oct 15, 2020
·
11 revisions
RSocket作为一个标准的协议,目前支持各种主流开发语言的SDK对接:
- Java语言: 支持Kotlin, Groovy, Scala等JVM之上语言
- JavaScript: 同时支持浏览器端JavaScript、Node.js后端和Deno TypeScript
- Rust: 支持WebAssembly对接
- RSocket并没有限制数据流格式,你可以根据实际场景选择各种序列化框架
RSocket提供了非常多语言的SDK,那么如何让各种语言SDK调用更能和语言贴近(Language Native),这里我们建议使用Proxy模式。 Proxy模式是将对象的函数调用通过Proxy机制转换到用户自定义的行为处理上,也就是通常说的Unknown method call和method missing。
让我们看一下各个语言对应的Proxy机制
- Java Proxy InvocationHandler
public class DynamicInvocationHandler implements InvocationHandler {
@Override
public Object invoke(Object proxy, Method method, Object[] args)
}
}
- JavaScript Proxy对象
更详细的介绍可参考: Why Proxy is a Gem in JavaScript? https://medium.com/javascript-in-plain-english/why-proxies-in-javascript-are-fantastic-db100ddc10a0
function constructInvocationHandler(options) {
let handler = {
get(target, methodName) {
let serviceName = options.serviceName;
return (...args) => {
console.log(serviceName)
console.log(methodName)
console.log(args);
}
}
};
return new Proxy({}, handler);
}
- TypeScript Proxy机制:
function constructInvocationHandler<T>(options: any): T {
let handler = {
get(target:any, methodName:string) {
return (...args:any[]) => {
console.log(options.serviceName)
console.log(methodName)
console.log(args);
return "good"
}
}
};
return new Proxy({}, handler);
}
- PHP __call
public function __call($name, $args)
{
echo "Calling $name $args[0]";
}
- Ruby' method_missing hook
def method_missing(m, *args, &block)
m_to_s
end
- Python的__getattr__
class PythonInvocationHandler(object):
def __init__(self, service_name):
self.service_name = service_name
def __getattr__(self, name):
def _missing(*args, **kwargs):
print "A missing method was called."
print "The object was %r, the method was %r. " % (self, name)
print "It was called with %r and %r as arguments" % (args, kwargs)
return _missing
更多语言的Proxy实现机制介绍在这里: https://rosettacode.org/wiki/Respond_to_an_unknown_method_call
Alibaba RSocket Broker采用标准的RSocket协议,但是在接入时还需要提供额外的一些metadata信息,如在连接时,需要提供:
- 应用信息(message/x.rsocket.application+json): 提供接入方的信息,主要如下:
{
"id": "uuid-1113" ,
"name:" : "app-1",
"ip": "192.168.1.2"
}
- JWT信息(message/x.rsocket.authentication.v0): 标准的接入的安全认证信息,如果Broker没有启动安全信息,则不需要。
在调用时,还需要提供三个metadata:
- 路由元信息(message/x.rsocket.routing.v0): 如 com.alibaba.user.UserService.findUserById
- 数据编码元信息(message/x.rsocket.mime-type.v0): 如 json等
可以参考 RawRSocketTest.java
- RSocket对Top 20编程语言的支持:https://rsocketbyexample.info/top20/index.html
- Binary: byte stream
- Async message
- Multi transports
- Reactive Semantics
- request/response
- request/stream
- fire-and-forget
- channel
- TCP+TLS
- WebSocket+TLS
- UDP(Aeron)
- RDMA
Clone this wiki locally
You can’t perform that action at this time.