Skip to content

Commit 09ec708

Browse files
committed
Add MultiInstanceConnecting.md
Add Proxy Tarantool client example with multiple routers Add Proxy Tarantool client example with address provider Closes #348 Closes #349
1 parent b59dc93 commit 09ec708

File tree

3 files changed

+29
-3
lines changed

3 files changed

+29
-3
lines changed

Diff for: README.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,11 @@ If you use this code in another project don't forget to add `cartridge-driver` d
4343
</dependency>
4444
```
4545
## Advanced usage
46-
* [Proxy methods](docs/ProxyTarantoolClient.md)
47-
Connecting to routers with crud library. It proxies space interface's methods to crud methods.
46+
* [Using CRUD stored procedures](docs/ProxyTarantoolClient.md)
47+
Connecting to routers with [tarantool/crud](https://github.com/tarantool/crud) library.
48+
It proxies space interface's methods to CRUD methods.
49+
* [Connecting to multiple instances](docs/MultiInstanceConnecting.md)
50+
Connecting to multiple Tarantool instances.
4851
* [Retrying](docs/RetryingTarantoolClient.md)
4952
Retrying transient cluster failures.
5053
* [TarantoolTuple usage](docs/TarantoolTupleUsage.md)

Diff for: docs/MultiInstanceConnecting.md

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[Main page](../README.md)
2+
3+
# Connecting to multiple Tarantool instances
4+
5+
This section shows examples of how to connect to multiple [Cartridge](https://github.com/tarantool/cartridge) routers.
6+
We recommend to use balancer in production applications rather than leaving this task to the connector.
7+
8+
## Setting addresses manually
9+
10+
Example of TarantoolClient set up with connecting to multiple routers
11+
https://github.com/tarantool/cartridge-java/blob/b2d504cf26d431d2a80fa21b5d475d8f89a5181f/src/test/java/io/tarantool/driver/integration/ReconnectIT.java#L291-L301
12+
https://github.com/tarantool/cartridge-java/blob/b2d504cf26d431d2a80fa21b5d475d8f89a5181f/src/test/java/io/tarantool/driver/integration/ReconnectIT.java#L315-L321
13+
14+
## Setting addresses with address provider
15+
16+
Example of TarantoolClient set up with address provider
17+
You may use the provided code as a reference for your own implementation
18+
https://github.com/tarantool/cartridge-java/blob/b2d504cf26d431d2a80fa21b5d475d8f89a5181f/src/test/java/io/tarantool/driver/integration/ProxyTarantoolClientWithAddressProviderExampleIT.java#L75-L82
19+
Example of TarantoolClusterAddressProvider setup
20+
https://github.com/tarantool/cartridge-java/blob/b2d504cf26d431d2a80fa21b5d475d8f89a5181f/src/test/java/io/tarantool/driver/integration/ProxyTarantoolClientWithAddressProviderExampleIT.java#L43-L68
21+
Do not forget to set tarantool function witch will return addresses
22+
The function must be global, so that it can be called from the connector
23+
https://github.com/tarantool/cartridge-java/blob/b2d504cf26d431d2a80fa21b5d475d8f89a5181f/src/test/resources/cartridge/app/roles/custom.lua#L3-L30

Diff for: docs/ProxyTarantoolClient.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[Main page](../README.md)
22

3-
# Proxy Tarantool client
3+
# Using CRUD stored procedures
44

55
This section shows the necessary settings for connecting to instances with a user-defined CRUD API exposed as Lua
66
stored functions or Cartridge roles implementing the API similar to the one of [tarantool/crud](https://github.com/tarantool/crud).

0 commit comments

Comments
 (0)