feat(rocketmq): add agent and management console
This commit is contained in:
86 files changed
+12373
-505
No files matched your search
@@ -985,8 +985,8 @@ async fn test_connection_with_info_inner(
|
||||
#[cfg(feature = "mq-admin")]
|
||||
DatabaseType::MessageQueue => {
|
||||
let mqc = state.mq_admin_config_for_connection(connection_id, &config).await?;
|
||||
let kafka_launch = dbx_core::mq::service::resolve_kafka_launch_spec(&mqc, state);
|
||||
let adapter = match state.mq_registry.get_or_build_config(connection_id, mqc, kafka_launch).await {
|
||||
let agent_launch = dbx_core::mq::service::resolve_mq_agent_launch_spec(&mqc, state);
|
||||
let adapter = match state.mq_registry.get_or_build_config(connection_id, mqc, agent_launch).await {
|
||||
Ok(adapter) => adapter,
|
||||
Err(err) => {
|
||||
state.mq_registry.drop_connection(connection_id).await;
|
||||
@@ -1303,8 +1303,8 @@ pub async fn connect_db(
|
||||
#[cfg(feature = "mq-admin")]
|
||||
DatabaseType::MessageQueue => {
|
||||
let mqc = state.mq_admin_config_for_connection(&id, &config).await?;
|
||||
let kafka_launch = dbx_core::mq::service::resolve_kafka_launch_spec(&mqc, &state);
|
||||
let adapter = match state.mq_registry.get_or_build_config(&id, mqc, kafka_launch).await {
|
||||
let agent_launch = dbx_core::mq::service::resolve_mq_agent_launch_spec(&mqc, &state);
|
||||
let adapter = match state.mq_registry.get_or_build_config(&id, mqc, agent_launch).await {
|
||||
Ok(adapter) => adapter,
|
||||
Err(err) => {
|
||||
state.mq_registry.drop_connection(&id).await;
|
||||
|
||||
@@ -246,6 +246,26 @@ pub async fn mq_clear_backlog(
|
||||
dbx_core::mq::service::mq_clear_backlog_core(&state, &connection_id, topic, sub).await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn mq_get_consumer_group_config(
|
||||
state: State<'_, Arc<AppState>>,
|
||||
connection_id: String,
|
||||
group_id: String,
|
||||
) -> Result<serde_json::Value, String> {
|
||||
dbx_core::mq::service::mq_get_consumer_group_config_core(&state, &connection_id, group_id).await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn mq_alter_consumer_group_config(
|
||||
state: State<'_, Arc<AppState>>,
|
||||
connection_id: String,
|
||||
group_id: String,
|
||||
config: serde_json::Value,
|
||||
) -> Result<(), String> {
|
||||
ensure_connection_writable(&state, &connection_id, "Alter consumer group config").await?;
|
||||
dbx_core::mq::service::mq_alter_consumer_group_config_core(&state, &connection_id, group_id, config).await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn mq_peek_messages(
|
||||
state: State<'_, Arc<AppState>>,
|
||||
@@ -442,6 +462,79 @@ pub async fn mq_get_cluster_info(
|
||||
dbx_core::mq::service::mq_get_cluster_info_core(&state, &connection_id).await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn mq_get_topic_route(
|
||||
state: State<'_, Arc<AppState>>,
|
||||
connection_id: String,
|
||||
topic: dbx_core::mq::TopicRef,
|
||||
) -> Result<serde_json::Value, String> {
|
||||
dbx_core::mq::service::mq_get_topic_route_core(&state, &connection_id, topic).await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn mq_alter_topic_config(
|
||||
state: State<'_, Arc<AppState>>,
|
||||
connection_id: String,
|
||||
topic: dbx_core::mq::TopicRef,
|
||||
configs: serde_json::Value,
|
||||
) -> Result<(), String> {
|
||||
dbx_core::mq::service::mq_alter_topic_config_core(&state, &connection_id, topic, configs).await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn mq_skip_topic_accumulation(
|
||||
state: State<'_, Arc<AppState>>,
|
||||
connection_id: String,
|
||||
topic: dbx_core::mq::TopicRef,
|
||||
) -> Result<serde_json::Value, String> {
|
||||
dbx_core::mq::service::mq_skip_topic_accumulation_core(&state, &connection_id, topic).await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn mq_view_message(
|
||||
state: State<'_, Arc<AppState>>,
|
||||
connection_id: String,
|
||||
topic: dbx_core::mq::TopicRef,
|
||||
msg_id: String,
|
||||
) -> Result<serde_json::Value, String> {
|
||||
dbx_core::mq::service::mq_view_message_core(&state, &connection_id, topic, msg_id).await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn mq_query_messages_by_key(
|
||||
state: State<'_, Arc<AppState>>,
|
||||
connection_id: String,
|
||||
topic: dbx_core::mq::TopicRef,
|
||||
key: String,
|
||||
begin: i64,
|
||||
end: i64,
|
||||
max_num: u32,
|
||||
) -> Result<serde_json::Value, String> {
|
||||
dbx_core::mq::service::mq_query_messages_by_key_core(&state, &connection_id, topic, key, begin, end, max_num).await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn mq_query_messages_by_topic(
|
||||
state: State<'_, Arc<AppState>>,
|
||||
connection_id: String,
|
||||
topic: dbx_core::mq::TopicRef,
|
||||
begin: i64,
|
||||
end: i64,
|
||||
max_num: u32,
|
||||
) -> Result<serde_json::Value, String> {
|
||||
dbx_core::mq::service::mq_query_messages_by_topic_core(&state, &connection_id, topic, begin, end, max_num).await
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub async fn mq_query_message_trace(
|
||||
state: State<'_, Arc<AppState>>,
|
||||
connection_id: String,
|
||||
msg_id: String,
|
||||
trace_topic: Option<String>,
|
||||
) -> Result<serde_json::Value, String> {
|
||||
dbx_core::mq::service::mq_query_message_trace_core(&state, &connection_id, msg_id, trace_topic).await
|
||||
}
|
||||
|
||||
// ---- Raw request (escape hatch) ----
|
||||
|
||||
#[tauri::command]
|
||||
|
||||
Reference in new issue
Block a user