AlexStocks commented on code in PR #992:
URL: https://github.com/apache/dubbo-go-samples/pull/992#discussion_r2649030682
##########
async/README.md:
##########
@@ -3,24 +3,95 @@
[[English](README.md) | [中文](README_zh.md)]
This sample showcases how to invoke Dubbo services asynchronously with the new
-`client`/`server` APIs over the Triple protocol. The client issues both a
regular
-async call (`GetUser`) and a fire-and-forget style call (`SayHello`) while the
-server uses Protobuf serialization to serve Triple requests. Note: This sample
-demonstrates the non-blocking nature of async calls; the response can be
obtained
-through the return value.
+`client`/`server` APIs over the Triple protocol. It demonstrates both Go-to-Go
+and Java-to-Go async interoperability.
-## Run the sample
+## Features
-1. **Start the provider**
+- **Go Client & Server**: Async calls using `client.WithAsync()`
+- **Java Client**: Async calls using `CompletableFuture` API
+- **Java Server**: Async service implementation with `CompletableFuture`
+- **Interoperability**: Java client can call Go server, Go client can call
Java server
+
+## Run Go to Go sample
+
+1. **Start the Go server**
```bash
go run ./async/go-server/cmd/main.go
```
-2. **Start the consumer**
+2. **Start the Go client** (connects to Go server by default)
```bash
go run ./async/go-client/cmd/main.go
```
The client prints "non-blocking before async callback resp: do something ... "
and "test end" logs, demonstrating the non-blocking nature of async calls.
+
+## Run Java-Go interoperability sample
+
+This demonstrates **cross-language async calls**:
+
+- **Go client** → **Java server**
+- **Java client** → **Go server**
+
+### Prerequisites
+
+- Java 11 or higher
+- Maven 3.6+
+
+### Build Java modules
+
+From the `async` directory:
+
+```bash
+mvn clean compile
+```
+
+### Test: Go client → Java server
+
+1. **Modify the Go client URL** in `go-client/cmd/main.go`:
+
+ ```go
+ client.WithClientURL("tri://127.0.0.1:50051"),
+ ```
Review Comment:
@MrSibe Please consider copilot's suggestion.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]