Skip to content

创建连接时uri如果是域名,默认会加上19530 #1546

@tried-code

Description

@tried-code

SDK版本:2.6.0
MilvusClientV2 sourceClient = new MilvusClientV2(ConnectConfig.builder() .uri("https://milvus.xiaoying.io") .token("xxxx") .dbName("xxx") .build());

会报错[DEADLINE_EXCEEDED: deadline exceeded after 9.984330316s. Name resolution delay 0.013935956 seconds. [closed=[], open=[[wait_for_ready, buffered_nanos=9994177403, waiting_for_connection],原因是域名未做处理默认会加上19530端口

public URLParser(String url) { try { if (url.startsWith("https://")) { this.secure = true; } URI uri = new URI(url); this.hostname = uri.getHost(); if (Objects.isNull(this.hostname)) { throw new IllegalArgumentException("Missing hostname in url"); } else { this.port = uri.getPort(); if (this.port <= 0) { this.port = 19530; } String path = uri.getPath(); if (!Objects.isNull(path) && !path.isEmpty() && !"/".equals(path)) { this.database = path.substring(1); } else { this.database = null; } } } catch (URISyntaxException e) { throw new IllegalArgumentException("Invalid url: " + url, e); } }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions