fn _offline_register()

in shenyu-client-rust/src/core.rs [469:505]


    fn _offline_register(
        &self,
        app_name: &str,
        rpc_type: &str,
        context_path: &str,
        namespace_id: &str,
        port: &u16,
        host: &Option<String>,
    ) {
        let json_data = serde_json::json!({
            "appName": app_name,
            "contextPath": context_path,
            "protocol": rpc_type,
            "host": host.clone().unwrap(),
            "port": port,
            "namespaceId": namespace_id,
            "eventType": EventType::OFFLINE.to_string(),
        });

        // Broadcast offline to all shenyu admin.
        for url in &self.register_offline_servers {
            if let Ok(true) = self.request(url, &json_data) {
                info!(
                    "[SUCCESS], offline success, register data: {:#?}",
                    &json_data
                );
                continue;
            }
            error!(
                "[ERROR], offline from {} failed, app_name: {}, host: {}, port: {}",
                url,
                app_name,
                host.clone().unwrap(),
                port
            );
        }
    }