RocketMQUtils
public class RocketMQUtils
io/agentscope/runtime/protocol/a2a/RocketMQUtils.java:43–128RocketMQ Utils,支持智能体之间的发现、委派与协作。位于 io.agentscope.runtime.protocol.a2a 包。核心成员包括 buildProducer、buildConsumer、buildMessage、toJsonString、checkConfigParam、ROCKETMQ_ENDPOINT。
A class in io.agentscope.runtime.protocol.a2a that supports discovery, delegation and collaboration between agents. Declared in io.agentscope.runtime.protocol.a2a.
字段摘要Field Summary
| 字段Field | 类型Type | 说明Description |
|---|---|---|
ROCKETMQ_ENDPOINTstaticfinal | String | RocketMQ 端点字段。 The ROCKETMQ ENDPOINT field. |
ROCKETMQ_NAMESPACEstaticfinal | String | RocketMQ 命名空间字段。 The ROCKETMQ NAMESPACE field. |
BIZ_TOPICstaticfinal | String | BIZ 主题字段。 The BIZ TOPIC field. |
BIZ_CONSUMER_GROUPstaticfinal | String | BIZ 消费者组字段。 The BIZ CONSUMER GROUP field. |
ACCESS_KEYstaticfinal | String | 访问键字段。 The ACCESS KEY field. |
SECRET_KEYstaticfinal | String | 密钥键字段。 The SECRET KEY field. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public static Producer buildProducer() throws ClientExceptionstatic | 构建生产者。 Builds the producer. |
public static PushConsumer buildConsumer(MessageListener messageListener) throws ClientExceptionstatic | 构建消费者。 Builds the consumer. |
public static Message buildMessage(String topic, String liteTopic, RocketMQResponse response)static | 构建消息。 Builds the message. |
public static String toJsonString(Object o)static | 设置该参数。 Performs the to json string operation. |
public static boolean checkConfigParam()static | 检查配置参数。 Returns the check config param. |
字段详情Field Detail
ROCKETMQ_ENDPOINT
public static final String ROCKETMQ_ENDPOINT
RocketMQ 端点字段。声明为 public static final String ROCKETMQ_ENDPOINT。
The ROCKETMQ ENDPOINT field.
io/agentscope/runtime/protocol/a2a/RocketMQUtils.java:45ROCKETMQ_NAMESPACE
public static final String ROCKETMQ_NAMESPACE
RocketMQ 命名空间字段。声明为 public static final String ROCKETMQ_NAMESPACE。
The ROCKETMQ NAMESPACE field.
io/agentscope/runtime/protocol/a2a/RocketMQUtils.java:46BIZ_TOPIC
public static final String BIZ_TOPIC
BIZ 主题字段。声明为 public static final String BIZ_TOPIC。
The BIZ TOPIC field.
io/agentscope/runtime/protocol/a2a/RocketMQUtils.java:47BIZ_CONSUMER_GROUP
public static final String BIZ_CONSUMER_GROUP
BIZ 消费者组字段。声明为 public static final String BIZ_CONSUMER_GROUP。
The BIZ CONSUMER GROUP field.
io/agentscope/runtime/protocol/a2a/RocketMQUtils.java:48ACCESS_KEY
public static final String ACCESS_KEY
访问键字段。声明为 public static final String ACCESS_KEY。
The ACCESS KEY field.
io/agentscope/runtime/protocol/a2a/RocketMQUtils.java:49SECRET_KEY
public static final String SECRET_KEY
密钥键字段。声明为 public static final String SECRET_KEY。
The SECRET KEY field.
io/agentscope/runtime/protocol/a2a/RocketMQUtils.java:50方法详情Method Detail
buildProducer
public static Producer buildProducer() throws ClientException
构建生产者。
Builds the producer.
ProducerClientException可能抛出 `ClientException`。Thrown when the operation cannot be completed.
io/agentscope/runtime/protocol/a2a/RocketMQUtils.java:52–63buildConsumer
public static PushConsumer buildConsumer(MessageListener messageListener) throws ClientException
构建消费者。
Builds the consumer.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
messageListener | MessageListener | 消息监听器(类型 `MessageListener`)。The message listener. |
PushConsumerClientException可能抛出 `ClientException`。Thrown when the operation cannot be completed.
io/agentscope/runtime/protocol/a2a/RocketMQUtils.java:65–84buildMessage
public static Message buildMessage(String topic, String liteTopic, RocketMQResponse response)
构建消息。
Builds the message.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
topic | String | 主题(类型 `String`)。The topic. |
liteTopic | String | lite 主题(类型 `String`)。The lite topic. |
response | RocketMQResponse | 响应(类型 `RocketMQResponse`)。The response. |
Messageio/agentscope/runtime/protocol/a2a/RocketMQUtils.java:86–99toJsonString
public static String toJsonString(Object o)
设置该参数。
Performs the to json string operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
o | Object | o(类型 `Object`)。The o. |
Stringio/agentscope/runtime/protocol/a2a/RocketMQUtils.java:101–110checkConfigParam
public static boolean checkConfigParam()
检查配置参数。
Returns the check config param.
booleanio/agentscope/runtime/protocol/a2a/RocketMQUtils.java:112–126