This is an automated email from the ASF dual-hosted git repository.
jinrongtong pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/rocketmq-a2a.git
The following commit(s) were added to refs/heads/main by this push:
new 111a5e9 Optimize the code and add example (#19)
111a5e9 is described below
commit 111a5e934353d9ff6aeefe89f3cc01a76a7aaf7c
Author: Drizzle <[email protected]>
AuthorDate: Mon Feb 9 15:48:00 2026 +0800
Optimize the code and add example (#19)
* update
Change-Id: Icb48afcf44893ad3c07fc0e243e333096d8e3ec0
* optimize the code
Change-Id: Iaa158a2bd2bc55475e7c55e7ae3392b4e2f28fa0
* optimize the code
Change-Id: I9fba77a503e387b5d9feab13cd144021b938ec1f
* update
Change-Id: Ia842ff8df57e018a36c672c9ddc7d1c7f42240f3
* update
Change-Id: Ibfe44c7be6f7a25be6ba74644ac0e9bee9a8ce43
* update
Change-Id: I6ba98dca2dc8001494aec4ddbe4e8bea38f8250a
* update
Change-Id: Ib0f380ba1f073608842c4ad467757368e331bdeb
* update
Change-Id: I3034540314cc832d68a1095fdb5a1366f2b26864
* update
Change-Id: Ie22cf3da240e10ae70800f8c1443134c70c9215f
* optimize the code
Change-Id: I0bc42ef1f8813d4ed538810c27c8e468cda90309
* update
Change-Id: I31f0bfda2a217979be592c533065268f03418951
* update
Change-Id: If3147fde462620d5fa71a71c86a574babcc23589
* update
Change-Id: I5b711a35249a0525a749af7e92bbe4547f9eb910
* update
Change-Id: I6cd9b87e7aeeb85137ba324f79f17b386cf2bef8
* update
Change-Id: I5134715702d491ce02a900e9ca36bc214c20141e
* update
Change-Id: I8031f2fbe0dbd69ec40f23b7a7d6dab3ef53e047
* update
Change-Id: Ic418be82f1e52191d5c2afd7307c64f9962fe943
* update
Change-Id: Ibe5bbedcd98166602dcc760636d4433c33e80556
* add remote lite consumer
Change-Id: I9e547f667fa0f415d58f93ceeb9db4677c19c497
* add non stream
Change-Id: I942060900dee38be155e22500cd7fec86603de4c
* add server lite consumer
Change-Id: I08810df630ecae17601c31406b5920552a846b2d
* update
Change-Id: Iaae4766dfffbe6551e2309be98424cab137bdfc6
* add annoation
Change-Id: Ic38151d973adecc5fc9c6a73f1947ae2eca3aea0
* add annotation
Change-Id: I82d13fc5472e41c23de977027e9ff84a96e3db81
* add annotation
Change-Id: I63dfd7d6920f95deaa4a1b47528f4198734d9b9f
* update
Change-Id: Ib8ca53fd6dd3c711432c1ced007a8b5504e5d7df
* update
Change-Id: Ia4e08f2eb9519d1fd61a8a4711bd8ee65ada9829
* update
Change-Id: If58a01cb5e40cc3483b64883ccbb5d771a2cd87f
* update
Change-Id: I38151434b2c22f1f3525c4f98fd6ff0203bc5bc8
* update the code
Change-Id: Idf304840cd935e2ba63aad78bdf1551394ffa9f0
* update
Change-Id: I884db3542e08d2929ec01c35fa98eda4feff95cb
* update
Change-Id: I69e9aa12b18099539696a057cd6554bd9c5644b3
* update
Change-Id: Ibf2978963f707105d1626911cfef6ea0e97299d9
* update
Change-Id: Ib82f9e37fca0ecd453aa80ee018992d8bb236106
* update
Change-Id: If5f1ab5ca25e10ef85f0f214b45ceaf01ed64cb3
* update
Change-Id: I31f6c0131f88cafa012fb398b8a9e3cc29f99eab
* update
Change-Id: I3049808264927415ba969c4f4f3bf9d0c0d43576
* update
Change-Id: I4d6949bf6752a072ff1baf6c0cc5836482bb7400
* update
Change-Id: I8b945937f5b0f8079f5c4eec4bddd0cf34301c75
* optimize the code
Change-Id: If4b03bed77292ad62fb0954f00566b1a24975f28
* update
Change-Id: I56576f9077e78e93c307e0e16bb519a6be573202
* update
Change-Id: Ib870349c05faa007055e7cfa1ba3775a48901147
* optimize the code
Change-Id: Idda0aa62ab32f808b33d0e3c821e06e040289055
* update
Change-Id: I8f60af1e48d9d8149a8988ffcbe16f75ca28cc6c
* update
Change-Id: If0265c2e6ddb8ad7ab4c8f1d7b1f73886cd97f74
* update
Change-Id: I9e95f7be172c138706681ce92020477410d94ab9
* update annotation
Change-Id: Id60334389c848aa0e839fb8e4fabd5fd3fc7a69c
* optimize the code
Change-Id: I5112d95e4d8b76b379d6c1882b2bc4a9a515105f
* update code
Change-Id: Id08764e213773787c5a4fec8333f70f6733fbc36
* update
Change-Id: Ifd738bb7df10d6e669672f482da61412d95e2cac
* update the code
Change-Id: Ic03c1e0ef5310bc2aaad37e93dd110381cf137ab
* update
Change-Id: Iaa534ab0d0281395e786a162aabefb885d296b33
* update code
Change-Id: I35802501ccbdadd859c3e394dc74085d6bf2dfa0
* update
Change-Id: I1dcb46a59aa86d68734f2f0b3a9ba2074e90f9a2
* update code
Change-Id: I9f6d925422314eb5edb0b2925ed86570419352c4
* update code
Change-Id: I73511c908a187343ac826cc931636a8bfec6c1fc
* update the code
Change-Id: I75accb0ce6c1fd09419f75200f455ded91deccce
* update
Change-Id: Ie2ec0e960b4ed88e3bcf3957c59a5a80962ce06e
* update code
Change-Id: Ie542dacb9f1f434be167c558ae13ba379784561d
* update code
Change-Id: I80bb9c2d5fbcb65561f079103447e9873d4188fe
* update code
Change-Id: I90f9ec7d204df8f852db50fd8e8f9f4dc5d9768d
* optimize the code
Change-Id: I0f4eb90a41e3ce076858a8d8afc5a554ecab80ed
* update code
Change-Id: I5b25a9a5c7b5e3b1834e63d424757ef1dd00c4e1
* optimize the common
Change-Id: I8dc1b8adc87590a7c9d209fbc20b06ab2452d892
* update the code
Change-Id: I3fa211cbbf395ea00a992a22f2e0091681b99a88
* update code
Change-Id: I54378a6d2def8906a9ced7dda96c2f1386a84200
* update code
Change-Id: I525ff312a3aadc4449ad9d3f529790032c2ec365
* update the code
Change-Id: I392edcccbe0cfc4d22451e1b6d5d576fbfb8ffd9
* optimize the code
Change-Id: I9ed139c311cc7db391abd6643879f35f5f074c3b
* update code
Change-Id: I2d6d870e58258fa705180eb565c88a3b374e1742
* update
Change-Id: I6c7ef992aa148d72393fa593ec0537333e19f6a1
* update
Change-Id: I2ab836bc51e232a9123e70769a97439dcc6f51e8
* update
Change-Id: I3c7893d1dbe145c728ce56609773d832b745b93f
* update
Change-Id: I4fabf470c9b74edf40962f81ad2eae80f9259bc0
* optimize the code
Change-Id: Id30bab119956c66c7f3be8d8f536ed30bd1c52f8
* update code
Change-Id: Ic51400ec73246e12b084113e9dbe5b52c2238edc
* update
Change-Id: Ib3ea899a15099e5cbc3a9b2d17c05e3c19722bee
* update
Change-Id: Ib79793828b6e237e2d73d46f8b6a5c284f62f585
* update code
Change-Id: I6feaf18e83ed4da665d584c86bb51d9b17d3bd34
* update code
Change-Id: I7a57527d269dd1d8a9b96e203d4755939cea6919
* update
Change-Id: Ice76ac6620423e1581b013508c4da4b1066ba347
* update
Change-Id: I543dc8596fd284207cc55a84f355871453e8fb1d
* update
Change-Id: I9168035b9a34b74cf436c6498270aed91431666a
* add example about agent-scope
Change-Id: I3e4f2938914a173068f066378963d2c1356d041d
* update
Change-Id: I11415c17954459bd8bf82e19d9187cf72aac5b0e
* update
Change-Id: I2c236f30848df9493066f911834e5735e344fa44
* update
Change-Id: I16228f8e017657905df8caf6cb94ac0da07a0dde
* update version
Change-Id: I66d99c0bb738dcb5e4d0c212d2a896024176094d
* update
Change-Id: I4605bdec1b502d84b55f96f3bf4a50f9a99eca80
* update
Change-Id: Idbb88b4a753fbeea362876e680a26787d5e01a0c
* update
Change-Id: I95c32a5f977ab4bb5fec4a4b34c5a0da538e3bb1
* update
Change-Id: I2d3a6e70ad95e517dde85da27bb0b3317191ef5d
* update
Change-Id: I7d9048597ce4244a59a5a23d2567657c1d5a2bd9
* update
Change-Id: I548a68af3d41507ba368113ea2c5746afa7a29c0
* update
Change-Id: I7e377d8ac1442aa9c0433d5d66465db7efe3c43f
* update code
Change-Id: Iaeb21e9e1bdd477ff293008549d17ae97c367130
* update code
Change-Id: I37aaeafae4ca9550633e6ae60f59067e91710df7
* update code
Change-Id: I2b68ef9c325d145b06ec8e3211450751b0f2dbe2
* update the code
Change-Id: I474b20ea81e821094343482db66dc1ab34a164bb
* update code
Change-Id: I9437a267c4d0bc3f0c672e3d2654e0cda0cb7e09
* update code
Change-Id: I5c009d956b96b5033d1496fb06bb6a546c1ed394
* update the code
Change-Id: Ie734572b07f0025fa0ed79461e6d68ff61357362
* optimize the code
Change-Id: I2c77cc9dc46a592ffae6fca6a900cce504455bc3
* update
Change-Id: I854084d5775c428d80a69a833af56de82b3d7d2b
* optimize the code
Change-Id: Icd53821c930467e9fb094a92a02e0cde8a8ba1f6
* update
Change-Id: I870a5c52f04005551060a5f9f9330f1b91bda2bc
* update code
Change-Id: Idde7eb3696de2a0fdfe8cba9b3fa575786f288a7
* update code
Change-Id: I955b7bc7df7521d5eb9d7cd6fadd76c27f541f61
* update
Change-Id: Id218054ec4de4c10174a6a81783a436a6f963e8e
* update code
Change-Id: Ia097a002e4186fc50e2d106db8f13a46a037021f
* optimize the code
Change-Id: Ie8acfc56f4cc647a0a363ae5c0d199852da6496c
* update code
Change-Id: I2fe4ddd6148de27906f840a42723c8cafe9f3904
* update
Change-Id: I8393e725004e3cf4b68028b17768483ec79ae6c9
* update code
Change-Id: I43fcde910a607d3b072de3eba5fe9ea561ec367a
* update code
Change-Id: Id738dea6fb479c2c0cfa68376fe9d07ac178b38c
* update
Change-Id: Iee149b9888e6944f256e4feba8c82ddeb74b0dc7
* change requestId to use uuid
Change-Id: I85a1f72b071f3c1d15fde817289b3c9dbe80126a
* update code
Change-Id: I262e8d6184c5eb15cbf2e574f2908c714aa30f03
* add rocketmq-multiagent-failover
Change-Id: Ia70a9dea997a98c04fcb25045a7e6b93900f8c80
* update
Change-Id: I8a333dedc6f45bd38242f5130d38241751c4a8ce
* update
Change-Id: Ie8833cefd3224d1910c4a7d22eb71d8ee0419327
* update code
Change-Id: Ifc45d8ecb12054944919ea1e9b29d701fa5975d1
* update code
Change-Id: I459484bb195c82ee0008ab7383c3813b0120a981
* update log
Change-Id: I7a29a7a8be820b4adeb267b7fd039f4a7ab07e0b
* optimize the code
Change-Id: I8bdc50163aa500a804d3f57c0ba04e460a4b3da0
* update code
Change-Id: Ica216c9c47921df23d357e6a89273e65b09356f9
* update
Change-Id: Ibe8998e47e832b0944bf0945f829444b35499c36
* update code
Change-Id: Ieae64d731f82867789b28db283e44ccb6ca6b326
* update code
Change-Id: I965e31747e70882e00d96ec59b90359d82dc8bd4
* optimize the code
Change-Id: I51eb52948678c728b1e7601dd5b71abc3bd6a2f3
* update code
Change-Id: Ic277e134037525f8c2926f68b57efa1fab16dd26
* optimize the code
Change-Id: Ib409e7d88caa7daef47111dce7309c31cba8d4e1
* update
Change-Id: I80fde33e85bf477df7a14c7e25b5c09191e47762
* update static code
Change-Id: Ia5682f3bbc32bb84bdc30c6dd9ed20d370a027a0
* update code
Change-Id: I4893e6829d86930ac6e2ebff648a944b75b0ac2d
* update code
Change-Id: I2be00772f9e63b2b0fab24a3b0b20cfe6e8bf7bb
* optimize the code and add example aboout
rocketmq-multiagent-session-consisency
* optimize the code
Change-Id: I06c92043bed89148c11afa103d677ef60fab2678
* update code
Change-Id: Ib089d8cbbc982061bc7a5ce5c9aa82c2e243b245
---------
Co-authored-by: drizzle.zk <[email protected]>
---
.github/workflows/maven.yaml | 39 +++++++++++++++
.github/workflows/misspell_check.yml | 19 ++++++++
.gitignore | 3 --
example/rocketmq-multiagent-base-adk/README.md | 5 +-
.../src/main/java/common/model/Mission.java | 17 +++----
.../src/main/java/org/example/model/TaskInfo.java | 30 ++++--------
.../java/org/example/service/AgentService.java | 4 +-
.../rocketmq-multiagent-base-agentscope/README.md | 12 ++---
.../agentscope-client/pom.xml | 37 ++++++++++++++
.../agentscope-server/pom.xml | 31 +++++++-----
.../README.md | 13 ++---
.../src/main/java/model/RocketMQRequest.java | 23 ++++-----
.../src/main/java/model/RocketMQResponse.java | 26 ++++------
.../java/org/example/service/RocketMQService.java | 4 +-
.../example/stream/handle/StreamingTaskHandle.java | 56 +++++-----------------
.../stream/recovery/StreamRecoveryContext.java | 27 +----------
.../src/main/resources/static/index.html | 2 +-
.../resources/static/static/js/index.2eedb438.js | 1 +
.../a2a/common/future/A2AResponseFuture.java | 7 ---
.../rocketmq/a2a/common/model/RocketMQRequest.java | 4 +-
.../a2a/common/model/RocketMQResource.java | 4 +-
.../a2a/common/model/RocketMQResponse.java | 4 +-
.../rocketmq/a2a/common/model/ServerReceipt.java | 20 ++++----
.../rocketmq/a2a/common/uitl/RocketMQUtil.java | 8 ++--
.../transport/config/RocketMQTransportConfig.java | 41 +++++-----------
25 files changed, 218 insertions(+), 219 deletions(-)
diff --git a/.github/workflows/maven.yaml b/.github/workflows/maven.yaml
new file mode 100644
index 0000000..369d57c
--- /dev/null
+++ b/.github/workflows/maven.yaml
@@ -0,0 +1,39 @@
+name: Build and Run Tests by Maven
+on:
+ pull_request:
+ types: [opened, reopened, synchronize]
+ push:
+ branches: [main]
+
+jobs:
+ java_build:
+ name: "maven-compile (${{ matrix.os }}, JDK-${{ matrix.jdk }})"
+ runs-on: ${{ matrix.os }}
+ strategy:
+ fail-fast: false
+ matrix:
+ # see
https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
+ os: [ubuntu-latest]
+ jdk: [17]
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+ - name: Set up JDK ${{ matrix.jdk }}
+ uses: actions/setup-java@v4
+ with:
+ java-version: ${{ matrix.jdk }}
+ # See
https://github.com/actions/setup-java?tab=readme-ov-file#supported-distributions
+ # AdoptOpenJDK got moved to Eclipse Temurin and won't be updated
anymore.
+ distribution: "corretto"
+ cache: "maven"
+ - name: Build with Maven
+ run: mvn -B package --file pom.xml
+
+ - name: Upload JVM crash logs
+ if: failure()
+ uses: actions/upload-artifact@v4
+ with:
+ name: jvm-crash-logs
+ path: ${{ github.workspace }}/hs_err_pid*.log
+ if-no-files-found: ignore
+ retention-days: 1
diff --git a/.github/workflows/misspell_check.yml
b/.github/workflows/misspell_check.yml
new file mode 100644
index 0000000..1cff151
--- /dev/null
+++ b/.github/workflows/misspell_check.yml
@@ -0,0 +1,19 @@
+name: Misspell Check
+on:
+ pull_request:
+ types: [opened, reopened, synchronize]
+ push:
+ branches: [main]
+jobs:
+ misspell-check:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - name: Install misspell
+ run: |
+ curl -L
https://raw.githubusercontent.com/client9/misspell/master/install-misspell.sh |
sh
+ - name: Add misspell to PATH
+ run: |
+ echo "$(pwd)/bin" >> $GITHUB_PATH
+ - name: Run misspell
+ run: find . -type f -print0 | xargs -0 misspell -error -i
transfered,derivate
diff --git a/.gitignore b/.gitignore
index b2d9d01..15c7cc2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,9 +5,6 @@ target/
### IntelliJ IDEA ###
.idea/
-*.iws
-*.iml
-*.ipr
### Eclipse ###
.apt_generated
diff --git a/example/rocketmq-multiagent-base-adk/README.md
b/example/rocketmq-multiagent-base-adk/README.md
index c715588..ec93065 100644
--- a/example/rocketmq-multiagent-base-adk/README.md
+++ b/example/rocketmq-multiagent-base-adk/README.md
@@ -34,7 +34,6 @@
3. 在百炼平台中创建天气助手应用与创建行程助手应用
-
4. 创建天气助手Agent
- 在阿里云百炼的应用管理页面,单击创建应用按钮。

@@ -194,7 +193,7 @@ java -DrocketMQNamespace=
-DworkAgentResponseTopic=WorkerAgentResponse -DworkAge
```

-6.运行supervisor-agent-web
+#### 6.运行supervisor-agent-web
```shell
cd supervisor-agent-web/target
@@ -203,7 +202,7 @@ cd supervisor-agent-web/target
```shell
java -DrocketMQNamespace= -DworkAgentResponseTopic=WorkerAgentResponse
-DworkAgentResponseGroupID=CID_HOST_AGENT_LITE -DapiKey= -DrocketMQAK=
-DrocketMQSK= -jar supervisor-agent-web-2.1.1-SNAPSHOT.jar
```
-- 打开浏览器,访问 localhost:9090
+- 打开浏览器,访问 http://localhost:9090
- 下面的示例展示了以RocketMQ作为底层Transport过程中实现异步通信以及断点重传功能
- 咨询杭州明天天气怎么样的过程中,点击中断按钮模拟网络中断,点击重连实现网络重连,数据流恢复重传
diff --git
a/example/rocketmq-multiagent-base-adk/common-base-adk/src/main/java/common/model/Mission.java
b/example/rocketmq-multiagent-base-adk/common-base-adk/src/main/java/common/model/Mission.java
index bc26a77..f64eb57 100644
---
a/example/rocketmq-multiagent-base-adk/common-base-adk/src/main/java/common/model/Mission.java
+++
b/example/rocketmq-multiagent-base-adk/common-base-adk/src/main/java/common/model/Mission.java
@@ -148,10 +148,7 @@ public class Mission {
* Builder class for constructing Mission objects with a fluent API.
*/
public static class Builder {
- private String agent;
- private String messageInfo;
- private String taskId;
- private String sessionId;
+ private final Mission mission = new Mission();
/**
* Sets the agent identifier for the mission.
@@ -160,7 +157,7 @@ public class Mission {
* @return the Builder instance for method chaining.
*/
public Builder agent(String agent) {
- this.agent = agent;
+ mission.setAgent(agent);
return this;
}
@@ -171,7 +168,7 @@ public class Mission {
* @return the Builder instance for method chaining.
*/
public Builder messageInfo(String messageInfo) {
- this.messageInfo = messageInfo;
+ mission.setMessageInfo(messageInfo);
return this;
}
@@ -182,7 +179,7 @@ public class Mission {
* @return the Builder instance for method chaining.
*/
public Builder taskId(String taskId) {
- this.taskId = taskId;
+ mission.setTaskId(taskId);
return this;
}
@@ -193,17 +190,17 @@ public class Mission {
* @return the Builder instance for method chaining.
*/
public Builder sessionId(String sessionId) {
- this.sessionId = sessionId;
+ mission.setSessionId(sessionId);
return this;
}
/**
- * Builds and returns a new Mission instance with the configured
properties.
+ * Returns a new Mission instance with the configured properties.
*
* @return a new Mission instance.
*/
public Mission build() {
- return new Mission(agent, messageInfo, taskId, sessionId);
+ return mission;
}
}
}
diff --git
a/example/rocketmq-multiagent-base-adk/supervisor-agent-web/src/main/java/org/example/model/TaskInfo.java
b/example/rocketmq-multiagent-base-adk/supervisor-agent-web/src/main/java/org/example/model/TaskInfo.java
index 7e17d9b..6bb04d7 100644
---
a/example/rocketmq-multiagent-base-adk/supervisor-agent-web/src/main/java/org/example/model/TaskInfo.java
+++
b/example/rocketmq-multiagent-base-adk/supervisor-agent-web/src/main/java/org/example/model/TaskInfo.java
@@ -54,11 +54,11 @@ public class TaskInfo {
/**
* Constructs a {@link TaskInfo} with basic metadata and a response sink.
*
- * @param taskId the unique task ID.
- * @param taskDesc the task description.
- * @param userId the user ID.
+ * @param taskId the unique task ID.
+ * @param taskDesc the task description.
+ * @param userId the user ID.
* @param sessionId the session ID.
- * @param sink the reactive sink for streaming responses.
+ * @param sink the reactive sink for streaming responses.
*/
public TaskInfo(String taskId, String taskDesc, String sessionId, String
userId, Sinks.Many<String> sink) {
this.taskId = taskId;
@@ -176,11 +176,7 @@ public class TaskInfo {
* Builder class for constructing {@link TaskInfo} instances with a fluent
API.
*/
public static class Builder {
- private String taskId;
- private String taskDesc;
- private String userId;
- private String sessionId;
- private Sinks.Many<String> sink;
+ private final TaskInfo taskInfo = new TaskInfo();
/**
* Sets the task ID for the {@link TaskInfo} being built.
@@ -189,7 +185,7 @@ public class TaskInfo {
* @return the current {@link Builder} instance.
*/
public Builder taskId(String taskId) {
- this.taskId = taskId;
+ taskInfo.setTaskId(taskId);
return this;
}
@@ -200,7 +196,7 @@ public class TaskInfo {
* @return the current {@link Builder} instance.
*/
public Builder taskDesc(String taskDesc) {
- this.taskDesc = taskDesc;
+ taskInfo.setTaskDesc(taskDesc);
return this;
}
@@ -211,7 +207,7 @@ public class TaskInfo {
* @return the current {@link Builder} instance.
*/
public Builder userId(String userId) {
- this.userId = userId;
+ taskInfo.setUserId(userId);
return this;
}
@@ -222,7 +218,7 @@ public class TaskInfo {
* @return the current {@link Builder} instance.
*/
public Builder sessionId(String sessionId) {
- this.sessionId = sessionId;
+ taskInfo.setSessionId(sessionId);
return this;
}
@@ -233,7 +229,7 @@ public class TaskInfo {
* @return the current {@link Builder} instance.
*/
public Builder sink(Sinks.Many<String> sink) {
- this.sink = sink;
+ taskInfo.setSink(sink);
return this;
}
@@ -243,12 +239,6 @@ public class TaskInfo {
* @return a new {@link TaskInfo} instance.
*/
public TaskInfo build() {
- TaskInfo taskInfo = new TaskInfo();
- taskInfo.setTaskId(taskId);
- taskInfo.setTaskDesc(taskDesc);
- taskInfo.setUserId(userId);
- taskInfo.setSessionId(sessionId);
- taskInfo.setSink(sink);
return taskInfo;
}
}
diff --git
a/example/rocketmq-multiagent-base-adk/supervisor-agent-web/src/main/java/org/example/service/AgentService.java
b/example/rocketmq-multiagent-base-adk/supervisor-agent-web/src/main/java/org/example/service/AgentService.java
index d572fdf..f5c3c68 100644
---
a/example/rocketmq-multiagent-base-adk/supervisor-agent-web/src/main/java/org/example/service/AgentService.java
+++
b/example/rocketmq-multiagent-base-adk/supervisor-agent-web/src/main/java/org/example/service/AgentService.java
@@ -295,8 +295,8 @@ public class AgentService {
/**
* Binds the specified sink to each task in the task list.
*
- * @param taskInfoList List of task information containing tasks to bind
the sink to.
- * @param sink The sink object to be bound to the tasks.
+ * @param taskInfoList list of task information containing tasks to bind
the sink to.
+ * @param sink The sink object to be bound to the tasks.
*/
private void bindSinkToTasks(List<TaskInfo> taskInfoList,
Sinks.Many<String> sink) {
for (TaskInfo taskInfo : taskInfoList) {
diff --git a/example/rocketmq-multiagent-base-agentscope/README.md
b/example/rocketmq-multiagent-base-agentscope/README.md
index 8686cd6..a14d38b 100644
--- a/example/rocketmq-multiagent-base-agentscope/README.md
+++ b/example/rocketmq-multiagent-base-agentscope/README.md
@@ -42,7 +42,6 @@ mvn clean package -Dmaven.test.skip=true
-Dcheckstyle.skip=true
| rocketMQAK | rocketmq账号 | 否 |
| rocketMQSK | rocketmq密码 | 否 |
| apiKey | 百炼平台调用apiKey | 是 |
-| appId | 对应百炼智能应用appId | 是 |
| workAgentResponseTopic | LiteTopic | 是 |
| workAgentResponseGroupID | LiteConsumer CID | 是 |
@@ -50,20 +49,21 @@ mvn clean package -Dmaven.test.skip=true
-Dcheckstyle.skip=true
#### 3.运行agentscope-server
```shell
-cd agentscope-server
+cd agentscope-server/target
```
```shell
-mvn exec:java -Dexec.mainClass=io.agentscope.AgentScopeDeployRocketMQExample
-DrocketMQEndpoint= -DrocketMQNamespace= -DbizTopic=LLM_TOPIC
-DbizConsumerGroup=LLM_CID -DrocketMQAK= -DrocketMQSK= -DapiKey=
+java -DrocketMQEndpoint= -DrocketMQNamespace= -DbizTopic=LLM_TOPIC
-DbizConsumerGroup=LLM_CID -DrocketMQAK= -DrocketMQSK= -DapiKey= -jar
agentscope-server-2.1.1-SNAPSHOT-jar-with-dependencies.jar
```
-#### 4.运行agentscope-client
+#### 4.运行agentscope-client
```shell
-cd agentscope-client
+cd agentscope-client/target
```
```shell
-mvn compile exec:java -Dexec.mainClass=io.agentscope.A2aAgentCallerExample
-DrocketMQNamespace= -DworkAgentResponseTopic=WorkerAgentResponse
-DworkAgentResponseGroupID=CID_HOST_AGENT_LITE -DrocketMQAK= -DrocketMQSK=
+java -DrocketMQNamespace= -DworkAgentResponseTopic=WorkerAgentResponse
-DworkAgentResponseGroupID=CID_HOST_AGENT_LITE -DrocketMQAK= -DrocketMQSK= -jar
agentscope-client-2.1.1-SNAPSHOT-jar-with-dependencies.jar
```
+#### 5.开始体验
启动后可在终端与agentscope构建的agent进行会话
<img src="docs/img.png" alt="Architecture Diagram" width="600"/>
diff --git
a/example/rocketmq-multiagent-base-agentscope/agentscope-client/pom.xml
b/example/rocketmq-multiagent-base-agentscope/agentscope-client/pom.xml
index fc9b752..37cab52 100644
--- a/example/rocketmq-multiagent-base-agentscope/agentscope-client/pom.xml
+++ b/example/rocketmq-multiagent-base-agentscope/agentscope-client/pom.xml
@@ -52,4 +52,41 @@
<artifactId>rocketmq-a2a</artifactId>
</dependency>
</dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>17</source>
+ <target>17</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>3.6.0</version>
+ <configuration>
+ <archive>
+ <manifest>
+
<mainClass>io.agentscope.A2aAgentCallerExample</mainClass>
+ </manifest>
+ </archive>
+ <descriptorRefs>
+ <descriptorRef>jar-with-dependencies</descriptorRef>
+ </descriptorRefs>
+ </configuration>
+ <executions>
+ <execution>
+ <id>make-assembly</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
diff --git
a/example/rocketmq-multiagent-base-agentscope/agentscope-server/pom.xml
b/example/rocketmq-multiagent-base-agentscope/agentscope-server/pom.xml
index 8c3fe03..af928ac 100644
--- a/example/rocketmq-multiagent-base-agentscope/agentscope-server/pom.xml
+++ b/example/rocketmq-multiagent-base-agentscope/agentscope-server/pom.xml
@@ -70,28 +70,37 @@
<build>
<plugins>
- <plugin>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-maven-plugin</artifactId>
- <configuration>
-
<mainClass>io.agentscope.browser.BrowserAgentApplication</mainClass>
- </configuration>
- </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
- <version>3.11.0</version>
<configuration>
<source>17</source>
<target>17</target>
</configuration>
</plugin>
<plugin>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-maven-plugin</artifactId>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>3.6.0</version>
<configuration>
-
<mainClass>io.agentscope.AgentScopeDeployRocketMQExample</mainClass>
+ <archive>
+ <manifest>
+
<mainClass>io.agentscope.AgentScopeDeployRocketMQExample</mainClass>
+ </manifest>
+ </archive>
+ <descriptorRefs>
+ <descriptorRef>jar-with-dependencies</descriptorRef>
+ </descriptorRefs>
</configuration>
+ <executions>
+ <execution>
+ <id>make-assembly</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+ </executions>
</plugin>
</plugins>
</build>
diff --git a/example/rocketmq-multiagent-session-consistency/README.md
b/example/rocketmq-multiagent-session-consistency/README.md
index 44d17dd..3b1488f 100644
--- a/example/rocketmq-multiagent-session-consistency/README.md
+++ b/example/rocketmq-multiagent-session-consistency/README.md
@@ -61,27 +61,28 @@ java -DrocketMQEndpoint= -DrocketMQNamespace= -DrocketMQAK=
-DrocketMQSK= -DbizT
### 4.运行web-gateway (监听9090端口)
```shell
-cd SupervisorAgent-Web/target
+cd web-gateway/target
```
```shell
-java -DrocketMQEndpoint= -DrocketMQNamespace=
-DworkAgentResponseTopic=WorkerAgentResponse
-DworkAgentResponseGroupID=CID_HOST_AGENT_LITE -DrocketMQAK= -DrocketMQSK=
-DagentTopic=LLM_TOPIC -jar web-gateway-2.1.1-SNAPSHOT.jar --server.port=9090
+java -DrocketMQEndpoint= -DrocketMQNamespace=
-DworkAgentResponseTopic=WorkerAgentResponse
-DworkAgentResponseGroupID=CID_HOST_AGENT_LITE -DrocketMQAK= -DrocketMQSK=
-DagentTopic=LLM_TOPIC -jar web-gateway-2.1.1-SNAPSHOT.jar --server.port=9090
```
### 5.运行web-gateway (监听9191端口)
```shell
-cd SupervisorAgent-Web/target
+cd web-gateway/target
```
```shell
-java -DrocketMQEndpoint= -DrocketMQNamespace=
-DworkAgentResponseTopic=WorkerAgentResponse
-DworkAgentResponseGroupID=CID_HOST_AGENT_LITE -DrocketMQAK= -DrocketMQSK=
-DagentTopic=LLM_TOPIC -jar web-gateway-2.1.1-SNAPSHOT.jar --server.port=9191
+java -DrocketMQEndpoint= -DrocketMQNamespace=
-DworkAgentResponseTopic=WorkerAgentResponse
-DworkAgentResponseGroupID=CID_HOST_AGENT_LITE -DrocketMQAK= -DrocketMQSK=
-DagentTopic=LLM_TOPIC -jar web-gateway-2.1.1-SNAPSHOT.jar --server.port=9191
```
### 6.运行web-gateway (监听9292端口)
```shell
-cd SupervisorAgent-Web/target
+cd web-gateway/target
```
```shell
-java -DrocketMQEndpoint= -DrocketMQNamespace=
-DworkAgentResponseTopic=WorkerAgentResponse
-DworkAgentResponseGroupID=CID_HOST_AGENT_LITE -DrocketMQAK= -DrocketMQSK=
-DagentTopic=LLM_TOPIC -jar web-gateway-2.1.1-SNAPSHOT.jar --server.port=9292
+java -DrocketMQEndpoint= -DrocketMQNamespace=
-DworkAgentResponseTopic=WorkerAgentResponse
-DworkAgentResponseGroupID=CID_HOST_AGENT_LITE -DrocketMQAK= -DrocketMQSK=
-DagentTopic=LLM_TOPIC -jar web-gateway-2.1.1-SNAPSHOT.jar --server.port=9292
```
+### 7.开始体验
- 打开浏览器,访问 http://localhost:9090
- 点击“重连会话”按钮,即可在节点切换过程中实现无缝会话恢复与数据续传
diff --git
a/example/rocketmq-multiagent-session-consistency/common-session-consistency/src/main/java/model/RocketMQRequest.java
b/example/rocketmq-multiagent-session-consistency/common-session-consistency/src/main/java/model/RocketMQRequest.java
index 77a787a..416cc07 100644
---
a/example/rocketmq-multiagent-session-consistency/common-session-consistency/src/main/java/model/RocketMQRequest.java
+++
b/example/rocketmq-multiagent-session-consistency/common-session-consistency/src/main/java/model/RocketMQRequest.java
@@ -177,18 +177,13 @@ public class RocketMQRequest {
* Builder class for constructing RocketMQRequest instances fluently.
*/
public static class Builder {
- private String question;
- private String agentTopic;
- private String workAgentResponseTopic;
- private String userId;
- private String liteTopic;
- private String taskId;
+ private final RocketMQRequest rocketMQRequest = new RocketMQRequest();
/**
* Sets the user's input question.
*/
public Builder question(String question) {
- this.question = question;
+ rocketMQRequest.setQuestion(question);
return this;
}
@@ -196,7 +191,7 @@ public class RocketMQRequest {
* Sets the agent topic.
*/
public Builder agentTopic(String agentTopic) {
- this.agentTopic = agentTopic;
+ rocketMQRequest.setAgentTopic(agentTopic);
return this;
}
@@ -204,7 +199,7 @@ public class RocketMQRequest {
* Sets the work agent response topic.
*/
public Builder workAgentResponseTopic(String workAgentResponseTopic) {
- this.workAgentResponseTopic = workAgentResponseTopic;
+ rocketMQRequest.setWorkAgentResponseTopic(workAgentResponseTopic);
return this;
}
@@ -212,7 +207,7 @@ public class RocketMQRequest {
* Sets the user ID.
*/
public Builder userId(String userId) {
- this.userId = userId;
+ rocketMQRequest.setUserId(userId);
return this;
}
@@ -220,7 +215,7 @@ public class RocketMQRequest {
* Sets the lite topic.
*/
public Builder liteTopic(String liteTopic) {
- this.liteTopic = liteTopic;
+ rocketMQRequest.setLiteTopic(liteTopic);
return this;
}
@@ -228,15 +223,15 @@ public class RocketMQRequest {
* Sets the task ID.
*/
public Builder taskId(String taskId) {
- this.taskId = taskId;
+ rocketMQRequest.setTaskId(taskId);
return this;
}
/**
- * Builds and returns a new RocketMQRequest instance.
+ * Returns a new RocketMQRequest instance.
*/
public RocketMQRequest build() {
- return new RocketMQRequest(question, agentTopic,
workAgentResponseTopic, userId, liteTopic, taskId);
+ return rocketMQRequest;
}
}
}
diff --git
a/example/rocketmq-multiagent-session-consistency/common-session-consistency/src/main/java/model/RocketMQResponse.java
b/example/rocketmq-multiagent-session-consistency/common-session-consistency/src/main/java/model/RocketMQResponse.java
index bc5aeed..ebf1021 100644
---
a/example/rocketmq-multiagent-session-consistency/common-session-consistency/src/main/java/model/RocketMQResponse.java
+++
b/example/rocketmq-multiagent-session-consistency/common-session-consistency/src/main/java/model/RocketMQResponse.java
@@ -200,19 +200,13 @@ public class RocketMQResponse {
* Builder class for constructing RocketMQResponse instances fluently.
*/
public static class Builder {
- private String liteTopic;
- private String responseBody;
- private boolean stream;
- private boolean end;
- private String userId;
- private String taskId;
- private String question;
+ private final RocketMQResponse rocketMQResponse = new
RocketMQResponse();
/**
* Sets the lite topic.
*/
public Builder liteTopic(String liteTopic) {
- this.liteTopic = liteTopic;
+ rocketMQResponse.setLiteTopic(liteTopic);
return this;
}
@@ -220,7 +214,7 @@ public class RocketMQResponse {
* Sets the response body.
*/
public Builder responseBody(String responseBody) {
- this.responseBody = responseBody;
+ rocketMQResponse.setResponseBody(responseBody);
return this;
}
@@ -228,7 +222,7 @@ public class RocketMQResponse {
* Sets whether this response is part of a streaming sequence.
*/
public Builder stream(boolean stream) {
- this.stream = stream;
+ rocketMQResponse.setStream(stream);
return this;
}
@@ -236,7 +230,7 @@ public class RocketMQResponse {
* Sets whether this is the final message in a streaming sequence.
*/
public Builder end(boolean end) {
- this.end = end;
+ rocketMQResponse.setEnd(end);
return this;
}
@@ -244,7 +238,7 @@ public class RocketMQResponse {
* Sets the user ID.
*/
public Builder userId(String userId) {
- this.userId = userId;
+ rocketMQResponse.setUserId(userId);
return this;
}
@@ -252,7 +246,7 @@ public class RocketMQResponse {
* Sets the task ID.
*/
public Builder taskId(String taskId) {
- this.taskId = taskId;
+ rocketMQResponse.setTaskId(taskId);
return this;
}
@@ -260,15 +254,15 @@ public class RocketMQResponse {
* Sets the original user question.
*/
public Builder question(String question) {
- this.question = question;
+ rocketMQResponse.setQuestion(question);
return this;
}
/**
- * Builds and returns a new RocketMQResponse instance.
+ * Returns a new RocketMQResponse instance.
*/
public RocketMQResponse build() {
- return new RocketMQResponse(liteTopic, responseBody, stream, end,
userId, taskId, question);
+ return rocketMQResponse;
}
}
}
diff --git
a/example/rocketmq-multiagent-session-consistency/web-gateway/src/main/java/org/example/service/RocketMQService.java
b/example/rocketmq-multiagent-session-consistency/web-gateway/src/main/java/org/example/service/RocketMQService.java
index c987e1c..54ae97f 100644
---
a/example/rocketmq-multiagent-session-consistency/web-gateway/src/main/java/org/example/service/RocketMQService.java
+++
b/example/rocketmq-multiagent-session-consistency/web-gateway/src/main/java/org/example/service/RocketMQService.java
@@ -250,8 +250,8 @@ public class RocketMQService {
* Processes the received response message and emits it to the appropriate
sink.
* Handles task completion logic based on response flags.
*
- * @param response The response message from RocketMQ.
- * @param offset The offset of the message in the topic.
+ * @param response the response message from RocketMQ.
+ * @param offset the offset of the message in the topic.
*/
private void processResponseResult(RocketMQResponse response, Long offset)
{
if (null == response) {
diff --git
a/example/rocketmq-multiagent-session-consistency/web-gateway/src/main/java/org/example/stream/handle/StreamingTaskHandle.java
b/example/rocketmq-multiagent-session-consistency/web-gateway/src/main/java/org/example/stream/handle/StreamingTaskHandle.java
index cf9c954..97d81a7 100644
---
a/example/rocketmq-multiagent-session-consistency/web-gateway/src/main/java/org/example/stream/handle/StreamingTaskHandle.java
+++
b/example/rocketmq-multiagent-session-consistency/web-gateway/src/main/java/org/example/stream/handle/StreamingTaskHandle.java
@@ -76,11 +76,11 @@ public class StreamingTaskHandle {
/**
* Constructs a new StreamingTaskHandle instance.
*
- * @param taskId the unique ID of the task
- * @param taskDesc the description or type of the task
+ * @param taskId the unique ID of the task
+ * @param taskDesc the description or type of the task
* @param sessionId the session ID associated with this task
- * @param userId the ID of the user who owns this task
- * @param sink the sink used to emit real-time output to clients
+ * @param userId the ID of the user who owns this task
+ * @param sink the sink used to emit real-time output to clients
* @param isRecover whether this task is resuming from a previous state
*/
public StreamingTaskHandle(String taskId, String taskDesc, String
sessionId, String userId, Sinks.Many<String> sink, boolean isRecover) {
@@ -255,14 +255,7 @@ public class StreamingTaskHandle {
* Builder class for constructing StreamingTaskHandle instances.
*/
public static class Builder {
- private String taskId;
- private String taskDesc;
- private String sessionId;
- private String userId;
- private Sinks.Many<String> sink;
- private String lastOutput = "";
- private boolean isComplete = false;
- private boolean isRecover = false;
+ private StreamingTaskHandle streamingTaskHandle = new
StreamingTaskHandle();
/**
* Sets the task ID for the StreamingTaskHandle being built.
@@ -271,7 +264,7 @@ public class StreamingTaskHandle {
* @return this Builder instance.
*/
public Builder taskId(String taskId) {
- this.taskId = taskId;
+ streamingTaskHandle.setTaskId(taskId);
return this;
}
@@ -282,7 +275,7 @@ public class StreamingTaskHandle {
* @return this Builder instance.
*/
public Builder taskDesc(String taskDesc) {
- this.taskDesc = taskDesc;
+ streamingTaskHandle.setTaskDesc(taskDesc);
return this;
}
@@ -293,7 +286,7 @@ public class StreamingTaskHandle {
* @return this Builder instance.
*/
public Builder sessionId(String sessionId) {
- this.sessionId = sessionId;
+ streamingTaskHandle.setSessionId(sessionId);
return this;
}
@@ -304,7 +297,7 @@ public class StreamingTaskHandle {
* @return this Builder instance.
*/
public Builder userId(String userId) {
- this.userId = userId;
+ streamingTaskHandle.setUserId(userId);
return this;
}
@@ -315,29 +308,7 @@ public class StreamingTaskHandle {
* @return this Builder instance.
*/
public Builder sink(Sinks.Many<String> sink) {
- this.sink = sink;
- return this;
- }
-
- /**
- * Sets the last output for the StreamingTaskHandle being built.
- *
- * @param lastOutput the last output.
- * @return this Builder instance.
- */
- public Builder lastOutput(String lastOutput) {
- this.lastOutput = lastOutput;
- return this;
- }
-
- /**
- * Sets the completion status for the StreamingTaskHandle being built.
- *
- * @param isComplete {@code true} if complete, {@code false} otherwise
- * @return this Builder instance.
- */
- public Builder isComplete(boolean isComplete) {
- this.isComplete = isComplete;
+ streamingTaskHandle.setSink(sink);
return this;
}
@@ -348,19 +319,16 @@ public class StreamingTaskHandle {
* @return this Builder instance.
*/
public Builder isRecover(boolean isRecover) {
- this.isRecover = isRecover;
+ streamingTaskHandle.setRecover(isRecover);
return this;
}
/**
- * Builds and returns a new StreamingTaskHandle instance with the
configured properties.
+ * Returns a new StreamingTaskHandle instance with the configured
properties.
*
* @return a new StreamingTaskHandle instance.
*/
public StreamingTaskHandle build() {
- StreamingTaskHandle streamingTaskHandle = new
StreamingTaskHandle(taskId, taskDesc, sessionId, userId, sink, isRecover);
- streamingTaskHandle.setLastOutput(lastOutput);
- streamingTaskHandle.setComplete(isComplete);
return streamingTaskHandle;
}
}
diff --git
a/example/rocketmq-multiagent-session-consistency/web-gateway/src/main/java/org/example/stream/recovery/StreamRecoveryContext.java
b/example/rocketmq-multiagent-session-consistency/web-gateway/src/main/java/org/example/stream/recovery/StreamRecoveryContext.java
index fb2bedb..a151c70 100644
---
a/example/rocketmq-multiagent-session-consistency/web-gateway/src/main/java/org/example/stream/recovery/StreamRecoveryContext.java
+++
b/example/rocketmq-multiagent-session-consistency/web-gateway/src/main/java/org/example/stream/recovery/StreamRecoveryContext.java
@@ -30,12 +30,12 @@ public class StreamRecoveryContext {
* A multi-emitter sink that allows sending multiple string events to
subscribers.
* Used during session recovery to push incremental updates, status
messages, or data replays.
*/
- private Sinks.Many<String> sink;
+ private final Sinks.Many<String> sink;
/**
* A CompletableFuture that represents the asynchronous result of the
recovery operation.
*/
- private CompletableFuture<Boolean> completableFuture;
+ private final CompletableFuture<Boolean> completableFuture;
/**
* Constructs a new StreamRecoveryContext with the specified sink and
CompletableFuture.
@@ -48,12 +48,6 @@ public class StreamRecoveryContext {
this.completableFuture = completableFuture;
}
- /**
- * Default constructor for StreamRecoveryContext.
- */
- public StreamRecoveryContext() {
- }
-
/**
* Returns a new Builder instance for creating StreamRecoveryContext
objects.
*
@@ -72,15 +66,6 @@ public class StreamRecoveryContext {
return sink;
}
- /**
- * Sets the multi-emitter sink.
- *
- * @param sink the sink to set.
- */
- public void setSink(Many<String> sink) {
- this.sink = sink;
- }
-
/**
* Gets the CompletableFuture representing the recovery result.
*
@@ -90,14 +75,6 @@ public class StreamRecoveryContext {
return completableFuture;
}
- /**
- * Sets the CompletableFuture representing the recovery result.
- *
- * @param completableFuture the CompletableFuture to set.
- */
- public void setCompletableFuture(CompletableFuture<Boolean>
completableFuture) {
- this.completableFuture = completableFuture;
- }
/**
* Builder class for constructing StreamRecoveryContext instances.
diff --git
a/example/rocketmq-multiagent-session-consistency/web-gateway/src/main/resources/static/index.html
b/example/rocketmq-multiagent-session-consistency/web-gateway/src/main/resources/static/index.html
index a3ea03b..c269eca 100644
---
a/example/rocketmq-multiagent-session-consistency/web-gateway/src/main/resources/static/index.html
+++
b/example/rocketmq-multiagent-session-consistency/web-gateway/src/main/resources/static/index.html
@@ -1 +1 @@
-<!doctype html><html><head><link rel="icon" href="/favicon.png"><title>ONS
Lite Topic Solution</title><meta charset="UTF-8"><meta name="viewport"
content="width=device-width, initial-scale=1.0"><script defer
src="/static/js/lib-react.3e22a6ef.js"></script><script defer
src="/static/js/512.e06f6b7f.js"></script><script defer
src="/static/js/index.ad32df60.js"></script><link
href="/static/css/index.bdb65db3.css" rel="stylesheet"></head><body><div
id="root"></div></body></html>
\ No newline at end of file
+<!doctype html><html><head><link rel="icon" href="/favicon.png"><title>ONS
Lite Topic Solution</title><meta charset="UTF-8"><meta name="viewport"
content="width=device-width, initial-scale=1.0"><script defer
src="/static/js/lib-react.3e22a6ef.js"></script><script defer
src="/static/js/512.e06f6b7f.js"></script><script defer
src="/static/js/index.2eedb438.js"></script><link
href="/static/css/index.bdb65db3.css" rel="stylesheet"></head><body><div
id="root"></div></body></html>
diff --git
a/example/rocketmq-multiagent-session-consistency/web-gateway/src/main/resources/static/static/js/index.2eedb438.js
b/example/rocketmq-multiagent-session-consistency/web-gateway/src/main/resources/static/static/js/index.2eedb438.js
new file mode 100644
index 0000000..5d04a42
--- /dev/null
+++
b/example/rocketmq-multiagent-session-consistency/web-gateway/src/main/resources/static/static/js/index.2eedb438.js
@@ -0,0 +1 @@
+(()=>{"use strict";var e,t,r,n,s,o,a={6919(e,t,r){var
n=r(4848),s=r(6540),o=r(5338),a=r(4795),l=r(8884),c=r(7181),i=r(1198);r(1890);var
u=r(4614),d=r(8397),m=r(1081),h=r(2930),f=r(3535),g=r(4718),p=r(400),y=r(8032),b=r(1166),x=r(9033);let
S="http://localhost:9090,http://localhost:9191,http://localhost:9292".split(",").filter(Boolean),v=e=>{let
t=e?S.filter(t=>t!==e):S;return
0===t.length?S[0]||"default-node":t[Math.floor(Math.random()*t.length)]},j=function(e){let
t=!(arguments.length>1) [...]
\ No newline at end of file
diff --git
a/src/main/java/org/apache/rocketmq/a2a/common/future/A2AResponseFuture.java
b/src/main/java/org/apache/rocketmq/a2a/common/future/A2AResponseFuture.java
index a705fed..0b32f84 100644
--- a/src/main/java/org/apache/rocketmq/a2a/common/future/A2AResponseFuture.java
+++ b/src/main/java/org/apache/rocketmq/a2a/common/future/A2AResponseFuture.java
@@ -113,15 +113,8 @@ public class A2AResponseFuture {
* Validates that both {@code completableFuture} and {@code
typeReference} are not null.
*
* @return a new {@code A2AResponseFuture} instance.
- * @throws IllegalArgumentException if either {@code
completableFuture} or {@code typeReference} is null.
*/
public A2AResponseFuture build() {
- if (completableFuture == null) {
- throw new IllegalArgumentException("completableFuture must not
be null");
- }
- if (typeReference == null) {
- throw new IllegalArgumentException("typeReference must not be
null");
- }
return new A2AResponseFuture(completableFuture, typeReference);
}
}
diff --git
a/src/main/java/org/apache/rocketmq/a2a/common/model/RocketMQRequest.java
b/src/main/java/org/apache/rocketmq/a2a/common/model/RocketMQRequest.java
index cb18784..0a4e10b 100644
--- a/src/main/java/org/apache/rocketmq/a2a/common/model/RocketMQRequest.java
+++ b/src/main/java/org/apache/rocketmq/a2a/common/model/RocketMQRequest.java
@@ -290,9 +290,9 @@ public class RocketMQRequest {
}
/**
- * Builds and returns the constructed RocketMQRequest instance.
+ * Returns the constructed RocketMQRequest instance with the
configured properties.
*
- * @return the constructed RocketMQRequest.
+ * @return a new RocketMQRequest instance.
*/
public RocketMQRequest build() {
return request;
diff --git
a/src/main/java/org/apache/rocketmq/a2a/common/model/RocketMQResource.java
b/src/main/java/org/apache/rocketmq/a2a/common/model/RocketMQResource.java
index 24360fe..752a0fd 100644
--- a/src/main/java/org/apache/rocketmq/a2a/common/model/RocketMQResource.java
+++ b/src/main/java/org/apache/rocketmq/a2a/common/model/RocketMQResource.java
@@ -144,9 +144,9 @@ public class RocketMQResource {
}
/**
- * Builds and returns the constructed RocketMQResource instance.
+ * Returns a new RocketMQResource instance with the configured
properties.
*
- * @return the constructed RocketMQResource instance.
+ * @return a new RocketMQResource instance.
*/
public RocketMQResource build() {
return info;
diff --git
a/src/main/java/org/apache/rocketmq/a2a/common/model/RocketMQResponse.java
b/src/main/java/org/apache/rocketmq/a2a/common/model/RocketMQResponse.java
index b637c71..33d03b7 100644
--- a/src/main/java/org/apache/rocketmq/a2a/common/model/RocketMQResponse.java
+++ b/src/main/java/org/apache/rocketmq/a2a/common/model/RocketMQResponse.java
@@ -334,9 +334,9 @@ public class RocketMQResponse {
}
/**
- * Builds and returns the constructed {@code RocketMQResponse} object.
+ * Returns a new {@code RocketMQResponse} object with the configured
properties.
*
- * @return the built {@code RocketMQResponse} instance.
+ * @return a new RocketMQResponse instance.
*/
public RocketMQResponse build() {
return response;
diff --git
a/src/main/java/org/apache/rocketmq/a2a/common/model/ServerReceipt.java
b/src/main/java/org/apache/rocketmq/a2a/common/model/ServerReceipt.java
index 8f29f10..f1d348b 100644
--- a/src/main/java/org/apache/rocketmq/a2a/common/model/ServerReceipt.java
+++ b/src/main/java/org/apache/rocketmq/a2a/common/model/ServerReceipt.java
@@ -37,8 +37,8 @@ public class ServerReceipt {
/**
* Constructs a ServerReceipt instance with the specified response topic
and lite topic.
*
- * @param serverWorkAgentResponseTopic The response topic for server
communication.
- * @param serverLiteTopic The lite topic associated with the
response topic.
+ * @param serverWorkAgentResponseTopic the response topic for server
communication.
+ * @param serverLiteTopic the lite topic associated with the response
topic.
*/
public ServerReceipt(String serverWorkAgentResponseTopic, String
serverLiteTopic) {
this.serverWorkAgentResponseTopic = serverWorkAgentResponseTopic;
@@ -48,7 +48,7 @@ public class ServerReceipt {
/**
* Returns the server work agent response topic.
*
- * @return The response topic used for server communication.
+ * @return the response topic used for server communication.
*/
public String getServerWorkAgentResponseTopic() {
return serverWorkAgentResponseTopic;
@@ -57,7 +57,7 @@ public class ServerReceipt {
/**
* Returns the server lite topic.
*
- * @return The lite topic associated with the response topic.
+ * @return the lite topic associated with the response topic.
*/
public String getServerLiteTopic() {
return serverLiteTopic;
@@ -66,7 +66,7 @@ public class ServerReceipt {
/**
* Creates a new Builder instance for constructing ServerReceipt objects.
*
- * @return A new Builder instance.
+ * @return a new Builder instance.
*/
public static Builder builder() {
return new Builder();
@@ -82,8 +82,8 @@ public class ServerReceipt {
/**
* Sets the server work agent response topic for the ServerReceipt
being built.
*
- * @param serverWorkAgentResponseTopic The response topic for server
communication.
- * @return This Builder instance for method chaining.
+ * @param serverWorkAgentResponseTopic the response topic for server
communication.
+ * @return this Builder instance for method chaining.
*/
public Builder serverWorkAgentResponseTopic(String
serverWorkAgentResponseTopic) {
this.serverWorkAgentResponseTopic = serverWorkAgentResponseTopic;
@@ -93,8 +93,8 @@ public class ServerReceipt {
/**
* Sets the server lite topic for the ServerReceipt being built.
*
- * @param serverLiteTopic The lite topic associated with the response
topic.
- * @return This Builder instance for method chaining.
+ * @param serverLiteTopic the lite topic associated with the response
topic.
+ * @return this Builder instance for method chaining.
*/
public Builder serverLiteTopic(String serverLiteTopic) {
this.serverLiteTopic = serverLiteTopic;
@@ -104,7 +104,7 @@ public class ServerReceipt {
/**
* Builds and returns a new ServerReceipt instance with the configured
properties.
*
- * @return A new ServerReceipt instance.
+ * @return a new ServerReceipt instance.
*/
public ServerReceipt build() {
return new ServerReceipt(serverWorkAgentResponseTopic,
serverLiteTopic);
diff --git
a/src/main/java/org/apache/rocketmq/a2a/common/uitl/RocketMQUtil.java
b/src/main/java/org/apache/rocketmq/a2a/common/uitl/RocketMQUtil.java
index 929cfb2..6aa6626 100644
--- a/src/main/java/org/apache/rocketmq/a2a/common/uitl/RocketMQUtil.java
+++ b/src/main/java/org/apache/rocketmq/a2a/common/uitl/RocketMQUtil.java
@@ -207,7 +207,7 @@ public class RocketMQUtil {
* @param secretKey the secret key for authenticating with the RocketMQ
service.
* @param workAgentResponseTopic the lightweight topic used to receive
asynchronous replies.
* @param workAgentResponseGroupID the consumer group ID (CID) for
subscribing to the response topic {@code workAgentResponseTopic}.
- * @param liteTopic Typically, a liteTopic that is bound to {@code
#workAgentResponseTopic}.
+ * @param liteTopic typically, a liteTopic that is bound to {@code
#workAgentResponseTopic}.
* LiteTopic is a session identifier, similar to a SessionId, dynamically
created at runtime for data storage and isolation.
* @return a LitePushConsumer instance.
*/
@@ -381,7 +381,7 @@ public class RocketMQUtil {
*
* @param payloadAndHeaders the request payload and metadata (e.g., auth
headers)
* @param agentTopic the default destination topic bound to the target
agent.
- * @param liteTopic Typically, a liteTopic that is bound to {@code
#workAgentResponseTopic}.
+ * @param liteTopic typically, a liteTopic that is bound to {@code
#workAgentResponseTopic}.
* LiteTopic is a session identifier, similar to a SessionId, dynamically
created at runtime for data storage and isolation.
* @param workAgentResponseTopic the lightweight topic used to receive
asynchronous replies.
* @param producer the RocketMQ producer used to send the message.
@@ -448,7 +448,7 @@ public class RocketMQUtil {
**
* @param response the incoming A2A streaming response.
* @param namespace logical isolation unit.
- * @param liteTopic Typically, LiteTopic is a session identifier, similar
to a SessionId,
+ * @param liteTopic typically, LiteTopic is a session identifier, similar
to a SessionId,
* dynamically created at runtime for data storage and isolation.
* @return {@link ConsumeResult#SUCCESS} if processed (even if skipped),
{@link ConsumeResult#FAILURE} on error.
*/
@@ -697,7 +697,7 @@ public class RocketMQUtil {
* Parses RocketMQ-related information from an AgentCard.
*
* @param agentCard the AgentCard containing transport endpoints.
- * @return RocketMQResource, or {@code null} if parsing fails or no
RocketMQ interface found.
+ * @return rocketMQResource, or {@code null} if parsing fails or no
RocketMQ interface found.
*/
public static RocketMQResource parseAgentCardAddition(AgentCard agentCard)
{
if (null == agentCard ||
StringUtils.isEmpty(agentCard.preferredTransport()) ||
StringUtils.isEmpty(agentCard.url()) ||
CollectionUtils.isEmpty(agentCard.additionalInterfaces())) {
diff --git
a/src/main/java/org/apache/rocketmq/a2a/transport/config/RocketMQTransportConfig.java
b/src/main/java/org/apache/rocketmq/a2a/transport/config/RocketMQTransportConfig.java
index 711ed02..42de5ce 100644
---
a/src/main/java/org/apache/rocketmq/a2a/transport/config/RocketMQTransportConfig.java
+++
b/src/main/java/org/apache/rocketmq/a2a/transport/config/RocketMQTransportConfig.java
@@ -334,17 +334,7 @@ public class RocketMQTransportConfig extends
ClientTransportConfig<RocketMQTrans
* Builder class for RocketMQTransportConfig.
*/
public static class Builder {
- private String accessKey;
- private String secretKey;
- private String endpoint;
- private String namespace;
- private String workAgentResponseTopic;
- private String workAgentResponseGroupID;
- private String agentTopic;
- private String agentUrl;
- private String liteTopic;
- private boolean useDefaultRecoverMode = false;
- private A2AHttpClient httpClient;
+ private final RocketMQTransportConfig config = new
RocketMQTransportConfig();
/**
* Sets the access key.
@@ -353,7 +343,7 @@ public class RocketMQTransportConfig extends
ClientTransportConfig<RocketMQTrans
* @return the builder instance.
*/
public Builder accessKey(String accessKey) {
- this.accessKey = accessKey;
+ config.setAccessKey(accessKey);
return this;
}
@@ -364,7 +354,7 @@ public class RocketMQTransportConfig extends
ClientTransportConfig<RocketMQTrans
* @return the builder instance.
*/
public Builder secretKey(String secretKey) {
- this.secretKey = secretKey;
+ config.setSecretKey(secretKey);
return this;
}
@@ -375,7 +365,7 @@ public class RocketMQTransportConfig extends
ClientTransportConfig<RocketMQTrans
* @return the builder instance.
*/
public Builder endpoint(String endpoint) {
- this.endpoint = endpoint;
+ config.setEndpoint(endpoint);
return this;
}
@@ -386,7 +376,7 @@ public class RocketMQTransportConfig extends
ClientTransportConfig<RocketMQTrans
* @return the builder instance.
*/
public Builder namespace(String namespace) {
- this.namespace = namespace;
+ config.setNamespace(namespace);
return this;
}
@@ -397,7 +387,7 @@ public class RocketMQTransportConfig extends
ClientTransportConfig<RocketMQTrans
* @return the builder instance.
*/
public Builder workAgentResponseTopic(String workAgentResponseTopic) {
- this.workAgentResponseTopic = workAgentResponseTopic;
+ config.setWorkAgentResponseTopic(workAgentResponseTopic);
return this;
}
@@ -408,7 +398,7 @@ public class RocketMQTransportConfig extends
ClientTransportConfig<RocketMQTrans
* @return the builder instance.
*/
public Builder workAgentResponseGroupID(String
workAgentResponseGroupID) {
- this.workAgentResponseGroupID = workAgentResponseGroupID;
+ config.setWorkAgentResponseGroupID(workAgentResponseGroupID);
return this;
}
@@ -419,7 +409,7 @@ public class RocketMQTransportConfig extends
ClientTransportConfig<RocketMQTrans
* @return the builder instance.
*/
public Builder agentTopic(String agentTopic) {
- this.agentTopic = agentTopic;
+ config.setAgentTopic(agentTopic);
return this;
}
@@ -430,7 +420,7 @@ public class RocketMQTransportConfig extends
ClientTransportConfig<RocketMQTrans
* @return the builder instance.
*/
public Builder agentUrl(String agentUrl) {
- this.agentUrl = agentUrl;
+ config.setAgentUrl(agentUrl);
return this;
}
@@ -441,7 +431,7 @@ public class RocketMQTransportConfig extends
ClientTransportConfig<RocketMQTrans
* @return the builder instance.
*/
public Builder liteTopic(String liteTopic) {
- this.liteTopic = liteTopic;
+ config.setLiteTopic(liteTopic);
return this;
}
@@ -452,7 +442,7 @@ public class RocketMQTransportConfig extends
ClientTransportConfig<RocketMQTrans
* @return the builder instance.
*/
public Builder useDefaultRecoverMode(boolean useDefaultRecoverMode) {
- this.useDefaultRecoverMode = useDefaultRecoverMode;
+ config.setUseDefaultRecoverMode(useDefaultRecoverMode);
return this;
}
@@ -463,7 +453,7 @@ public class RocketMQTransportConfig extends
ClientTransportConfig<RocketMQTrans
* @return the builder instance.
*/
public Builder httpClient(A2AHttpClient httpClient) {
- this.httpClient = httpClient;
+ config.setHttpClient(httpClient);
return this;
}
@@ -473,13 +463,6 @@ public class RocketMQTransportConfig extends
ClientTransportConfig<RocketMQTrans
* @return a new RocketMQTransportConfig instance.
*/
public RocketMQTransportConfig build() {
- // Use full constructor to ensure all fields are properly
initialized
- RocketMQTransportConfig config = new RocketMQTransportConfig(
- accessKey, secretKey, endpoint, namespace,
- workAgentResponseTopic, workAgentResponseGroupID,
- agentTopic, httpClient, liteTopic, useDefaultRecoverMode
- );
- config.setAgentUrl(agentUrl);
return config;
}
}