We recommend using java to define the Dubbo interface. And use erlanalysis tool parse java interface transfer to erlang lib.
Add dubblerl to rebar.config with your project
{deps, [ {dubboerl, {git, "http://github.com/dubboerl/dubboerl.git", {branch, "master"}}} ]}.
Waiting for improvement
Suppose the interface lib you exported is called dubbo_service.
dubbo_service
lib into the project’s apps
directory.{deps, [ {dubboerl, {git, "http://github.com/dubboerl/dubboerl.git", {branch, "master"}}}, {dubbo_service,{git,"${INTERFACE_LIB_URL}",{branch,"master"}}} %% replace ${INTERFACE_LIB_URL} with your lib git repos url ]}.
Please reference Consumer Config
It is need you
dubboerl:init().
Request = #userInfoRequest{requestId = 123, username = "testname"}, {ok,RequestRef,Response,RpcContent} = user:queryUserInfo(Request,#{sync=ture}).
If it occur error, is reponse {error,Reason}
.
Default is Async call.
Request = #userInfoRequest{requestId = 123, username = "testname"}, {ok,RequestRef} = user:queryUserInfo(Request). %% you can receive the message after. {msg_back,RequestRef,Response,RpcContent}.