You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2018/11/26 03:21:58 UTC
[GitHub] Lzw2016 opened a new issue #311: 协议配置default(protocol.default=true)不起作用
Lzw2016 opened a new issue #311: 协议配置default(protocol.default=true)不起作用
URL: https://github.com/apache/incubator-dubbo-spring-boot-project/issues/311
### 配置如下
```
dubbo:
application: #------------------------------------------------------ dubbo应用配置
id: SpringDubboProvider
name: SpringDubboProvider
registry: #----------------------------------------------------------- 注册中心配置
id: zk-registry
protocol: zookeeper
address: 127.0.0.1:2181
default: true
client: curator
transporter: netty
check: true
register: true
subscribe: true
dynamic: true
group: dev-group
protocol: #-------------------------------------------------------------- 协议配置
id: dubbo
name: dubbo
port: 20881
default: true
```
设置服务暴露端口 `20881`
### 版本如下
```
<dependency>
<groupId>com.alibaba.boot</groupId>
<artifactId>dubbo-spring-boot-starter</artifactId>
<version>0.2.0</version>
</dependency>
```
### 代码如下
```
@Service
public class DefaultDemoService implements DemoService {
@Override
public String sayHello(String name) {
return "Hello, " + name + " (from Spring Boot)";
}
}
```
### 但是服务启动后暴露端口依然是`20880`, 不想每个服务都用 `@Service(protocol = {"dubbo"})`指定协议
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org