建议先使用 java 定义接口 jar,并使用 erlanalysis 工具解析java接口至Erlang lib
Add dubblerl to rebar.config with your project
{deps, [
{dubboerl, {git, "https://github.com/apache/dubbo-erlang.git", {branch, "master"}}}
]}.
待补充
Suppose the interface lib you exported is called dubbo_service.
dubbo_service
lib
into the project’s apps
directory.{deps, [
{dubboerl, {git, "https://github.com/apache/dubbo-erlang.git", {branch, "master"}}},
{dubbo_service,{git,"${INTERFACE_LIB_URL}",{branch,"master"}}} %% replace ${INTERFACE_LIB_URL} with your lib git repos url
]}.
Please reference Reference Config
It is need you
dubboerl:init().
Request = #userInfoRequest{requestId = 123, username = "testname"},
{ok,RequestRef,Response,RpcContent} = userOperator:queryUserInfo(Request,#{sync=> true}).
If it occur error, is reponse {error,Reason}
.
Default is Async call.
Request = #userInfoRequest{requestId = 123, username = "testname"},
{ok,RequestRef} = userOperator:queryUserInfo(Request).
%% you can receive the message after.
handle_cast({msg_back,RequestRef,Response,RpcContent},State).
参考项目 dubboerl_demo