AS AgentScopeAPI 手册 / API Reference

RocketMQUtils

public class RocketMQUtils
源码Source io/agentscope/runtime/protocol/a2a/RocketMQUtils.java:43–128

RocketMQ 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_ENDPOINT
staticfinal
String
RocketMQ 端点字段。
The ROCKETMQ ENDPOINT field.
ROCKETMQ_NAMESPACE
staticfinal
String
RocketMQ 命名空间字段。
The ROCKETMQ NAMESPACE field.
BIZ_TOPIC
staticfinal
String
BIZ 主题字段。
The BIZ TOPIC field.
BIZ_CONSUMER_GROUP
staticfinal
String
BIZ 消费者组字段。
The BIZ CONSUMER GROUP field.
ACCESS_KEY
staticfinal
String
访问键字段。
The ACCESS KEY field.
SECRET_KEY
staticfinal
String
密钥键字段。
The SECRET KEY field.

方法摘要Method Summary

方法Method说明Description
public static Producer buildProducer() throws ClientException
static
构建生产者。
Builds the producer.
public static PushConsumer buildConsumer(MessageListener messageListener) throws ClientException
static
构建消费者。
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
staticfinal

RocketMQ 端点字段。声明为 public static final String ROCKETMQ_ENDPOINT。

The ROCKETMQ ENDPOINT field.

源码Source io/agentscope/runtime/protocol/a2a/RocketMQUtils.java:45

ROCKETMQ_NAMESPACE

public static final String ROCKETMQ_NAMESPACE
staticfinal

RocketMQ 命名空间字段。声明为 public static final String ROCKETMQ_NAMESPACE。

The ROCKETMQ NAMESPACE field.

源码Source io/agentscope/runtime/protocol/a2a/RocketMQUtils.java:46

BIZ_TOPIC

public static final String BIZ_TOPIC
staticfinal

BIZ 主题字段。声明为 public static final String BIZ_TOPIC。

The BIZ TOPIC field.

源码Source io/agentscope/runtime/protocol/a2a/RocketMQUtils.java:47

BIZ_CONSUMER_GROUP

public static final String BIZ_CONSUMER_GROUP
staticfinal

BIZ 消费者组字段。声明为 public static final String BIZ_CONSUMER_GROUP。

The BIZ CONSUMER GROUP field.

源码Source io/agentscope/runtime/protocol/a2a/RocketMQUtils.java:48

ACCESS_KEY

public static final String ACCESS_KEY
staticfinal

访问键字段。声明为 public static final String ACCESS_KEY。

The ACCESS KEY field.

源码Source io/agentscope/runtime/protocol/a2a/RocketMQUtils.java:49

SECRET_KEY

public static final String SECRET_KEY
staticfinal

密钥键字段。声明为 public static final String SECRET_KEY。

The SECRET KEY field.

源码Source io/agentscope/runtime/protocol/a2a/RocketMQUtils.java:50

方法详情Method Detail

buildProducer

public static Producer buildProducer() throws ClientException
static

构建生产者。

Builds the producer.

返回Returns Producer
返回生产者。Returns producer.
抛出Throws
  • ClientException 可能抛出 `ClientException`。Thrown when the operation cannot be completed.
源码Source io/agentscope/runtime/protocol/a2a/RocketMQUtils.java:52–63

buildConsumer

public static PushConsumer buildConsumer(MessageListener messageListener) throws ClientException
static

构建消费者。

Builds the consumer.

参数Parameters
名称Name类型Type说明Description
messageListenerMessageListener消息监听器(类型 `MessageListener`)。The message listener.
返回Returns PushConsumer
返回PushConsumer。Returns push consumer.
抛出Throws
  • ClientException 可能抛出 `ClientException`。Thrown when the operation cannot be completed.
源码Source io/agentscope/runtime/protocol/a2a/RocketMQUtils.java:65–84

buildMessage

public static Message buildMessage(String topic, String liteTopic, RocketMQResponse response)
static

构建消息。

Builds the message.

参数Parameters
名称Name类型Type说明Description
topicString主题(类型 `String`)。The topic.
liteTopicStringlite 主题(类型 `String`)。The lite topic.
responseRocketMQResponse响应(类型 `RocketMQResponse`)。The response.
返回Returns Message
返回消息。Returns message.
源码Source io/agentscope/runtime/protocol/a2a/RocketMQUtils.java:86–99

toJsonString

public static String toJsonString(Object o)
static

设置该参数。

Performs the to json string operation.

参数Parameters
名称Name类型Type说明Description
oObjecto(类型 `Object`)。The o.
返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/runtime/protocol/a2a/RocketMQUtils.java:101–110

checkConfigParam

public static boolean checkConfigParam()
static

检查配置参数。

Returns the check config param.

返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/runtime/protocol/a2a/RocketMQUtils.java:112–126
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.