dubbo
dubbo copied to clipboard
Problems assign username/password when using redis as registry.
dubbo2.5.8 用redis做注册中心时,设置密码时,为什么还需要设置用户名,不设置用户名报错 URL.class 类,public URL(String protocol, String username, String password, String host, int port, String path, Map<String, String> parameters) 方法 if ((username == null || username.length() == 0) && password != null && password.length() > 0) { throw new IllegalArgumentException("Invalid url, password without username!"); }
dubbo目前只能支持无密码的redis
有个取巧的办法,就是在配置文件中设置了密码,然后再设置一个用户名,只要用户名不为空就行;username="任意合法值"。 例: <dubbo:registry address="redis://xx.xx.212.27" password="xxxxx" port="6379" username="222"/>