forked from apache/dubbo-website
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add english version for language section (3.0) (apache#994)
Co-authored-by: Yunkun Huang <[email protected]>
- Loading branch information
Showing
10 changed files
with
397 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ package-lock.json | |
.idea/ | ||
|
||
.DS_Store | ||
/.hugo_build.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
--- | ||
type: docs | ||
title: "Multi-language implementation" | ||
linkTitle: "multi-language" | ||
weight: 60 | ||
description: "Dubbo support multi-language implementation, please learn about the special usage of each language" | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
--- | ||
type: docs | ||
title: "Erlang" | ||
linkTitle: "Erlang" | ||
weight: 200 | ||
description: "Erlang support" | ||
--- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
--- | ||
type: docs | ||
title: "Quick start " | ||
linkTitle: "Quick start" | ||
weight: 1 | ||
description: "Erlang Quick start" | ||
--- | ||
|
||
It is recommended to use java to define the interface jar first, and use the [erlanalysis](https://github.com/apache/dubbo-erlang/tree/master/tools/erlanalysis) tool to parse the java interface to Erlang lib | ||
|
||
|
||
## Import dependent libraries | ||
|
||
### Use the Rebar compilation tool. | ||
|
||
Add dubblerl to rebar.config to your project | ||
|
||
```erlang | ||
{deps, [ | ||
{dubboerl, {git, "https://github.com/apache/dubbo-erlang.git", {branch, "master"}}} | ||
]}. | ||
``` | ||
|
||
### Use erlang.mk compilation tool | ||
|
||
`in progress...` | ||
|
||
## Import interface library | ||
Suppose the interface lib you exported is called dubbo_service. | ||
* If you didn't upload your lib to your git repository, It is recommended that you copy the `dubbo_service` lib | ||
into the project's `apps` directory. | ||
* If it is uploaded to your git repository, you can import like this: | ||
```erlang | ||
{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 | ||
]}. | ||
``` | ||
|
||
## Consumer configuration | ||
Please reference [Reference Config](./reference.md) | ||
|
||
## Init dubbolib in your project | ||
It is need you | ||
```erlang | ||
dubboerl:init(). | ||
``` | ||
|
||
## How to call? | ||
|
||
### Synchronous call | ||
|
||
```erlang | ||
Request = #userInfoRequest{requestId = 123, username = "testname"}, | ||
{ok,RequestRef,Response,RpcContent} = userOperator:queryUserInfo(Request,#{sync=> true}). | ||
``` | ||
If it occur error, is reponse `{error,Reason}`. | ||
|
||
### Asynchronous call | ||
|
||
Default is Async call. | ||
```erlang | ||
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). | ||
``` | ||
|
||
## Example | ||
Refer to [dubboerl_demo](https://github.com/apache/dubbo-erlang/tree/master/samples) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
type: docs | ||
title: "Consumer configuration" | ||
linkTitle: "Consumer configuration" | ||
weight: 2 | ||
description: "Configure consumers in erlang" | ||
--- | ||
|
||
## Basic configuration | ||
|
||
Consumers need to add configuration items to `sys.config` file `dubboerl` filed. | ||
|
||
```erlang | ||
{dubboerl,[ | ||
%% other config ... | ||
{consumer,[ | ||
{<<"interface fullname">>,[Option]}, | ||
%% eg: | ||
{<<"org.apache.dubbo.erlang.sample.service.facade.UserOperator">>,[]}, | ||
]} | ||
]} | ||
``` | ||
|
||
Option is to be added. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
type: docs | ||
title: "Serialized configuration items" | ||
linkTitle: "Serialized configuration items" | ||
weight: 4 | ||
description: "Configure the serialization method in erlang" | ||
--- | ||
|
||
The library currently only implements the `dubbo://` communication protocol. | ||
|
||
It supports `hessian` and `json` as serialization method. | ||
|
||
## Configuration example | ||
|
||
Provider configuration items to add to the `sys.config` file `dubboerl` field. | ||
|
||
```erlang | ||
{dubboerl,[ | ||
%% other config ... | ||
{protocol,hessian} | ||
]} | ||
``` | ||
|
||
| ConfigName | Type | DefaultValue | Remarks | | ||
| --- | --- | --- | --- | | ||
| protocol | atom() | hessian | hessian,json | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
type: docs | ||
title: "Provider configuration" | ||
linkTitle: "Provider configuration" | ||
weight: 3 | ||
description: "Configure service provider in erlang" | ||
--- | ||
|
||
## basic configuration | ||
|
||
Provider configuration items to add to the `sys.config` file `dubboerl` field | ||
|
||
```erlang | ||
{dubboerl,[ | ||
%% other config ... | ||
{provider,[ | ||
{module_implements,interface_module,interface_fullname,[Options]}, | ||
%% eg: | ||
{userOperator_impl,userOperator,<<"org.apache.dubbo.erlang.sample.service.facade.UserOperator">>,[Option]} | ||
]} | ||
]} | ||
``` | ||
|
||
| ConfigName | Type | DefaultValue | Remarks | | ||
| --- | --- | --- | --- | | ||
| module_implements | atom() | - | The service implements module name| | ||
| interface_module | atom() | - | Interface module name is transfer form java jar | | ||
| interface_fullname | binary() | - | Interface full name is the java class name | | ||
|
||
Option is to be added. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
--- | ||
type: docs | ||
title: "golang" | ||
linkTitle: "golang" | ||
weight: 200 | ||
description: "golang support" | ||
--- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
type: docs | ||
title: "Go language definition service" | ||
linkTitle: "Go language definition service" | ||
weight: 10 | ||
description: "" | ||
--- |
Oops, something went wrong.