Skip to content

Commit

Permalink
Polish apache#220 no program
Browse files Browse the repository at this point in the history
  • Loading branch information
mercyblitz committed Dec 14, 2018
1 parent 93be35d commit 7bad4d2
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
package com.alibaba.boot.dubbo.demo.consumer.bootstrap;

import com.alibaba.boot.dubbo.demo.consumer.controller.DemoConsumerController;
import org.springframework.boot.SpringApplication;

import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;

/**
* Dubbo Consumer Demo
Expand All @@ -31,9 +32,8 @@
public class DubboConsumerDemo {

public static void main(String[] args) {

SpringApplication.run(DubboConsumerDemo.class,args);

new SpringApplicationBuilder(DubboConsumerDemo.class)
.profiles("prod")
.run(args);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
* limitations under the License.
*/
package com.alibaba.boot.dubbo.demo.consumer.controller;

import com.alibaba.boot.dubbo.demo.consumer.DemoService;
import com.alibaba.dubbo.config.annotation.Reference;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
Expand All @@ -32,7 +34,6 @@
public class DemoConsumerController {

@Reference(version = "${demo.service.version}",
application = "${dubbo.application.id}",
url = "dubbo://localhost:12345")
private DemoService demoService;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Application properties on prod profile
# Dubbo Endpoint (default status is disable)
endpoints.dubbo.enabled = true

# Dubbo Health
## StatusChecker Name defaults (default : "memory", "load" )
management.health.dubbo.status.defaults = memory
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,10 @@ management.security.enabled = false
demo.service.version = 1.0.0

# Dubbo Config properties
## ApplicationConfig Bean
dubbo.application.id = dubbo-consumer-demo
dubbo.application.name = dubbo-consumer-demo

## Legacy QOS Config
dubbo.qos.port = 22223

## ProtocolConfig Bean
dubbo.protocol.id = dubbo
dubbo.protocol.name = dubbo
dubbo.protocol.port = 12345

# Dubbo Endpoint (default status is disable)
endpoints.dubbo.enabled = true

# Dubbo Health
## StatusChecker Name defaults (default : "memory", "load" )
management.health.dubbo.status.defaults = memory
dubbo.protocol.port = 12345
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package com.alibaba.boot.dubbo.demo.provider.bootstrap;

import com.alibaba.boot.dubbo.demo.provider.service.DefaultDemoService;

import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;

Expand All @@ -31,11 +32,9 @@
public class DubboProviderDemo {

public static void main(String[] args) {

new SpringApplicationBuilder(DubboProviderDemo.class)
.profiles("prod")
.web(false)
.run(args);

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
*/
@Service(
version = "${demo.service.version}",
application = "${dubbo.application.id}",
protocol = "${dubbo.protocol.id}",
registry = "${dubbo.registry.id}"
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Application properties on prod profile
# Dubbo Endpoint (default status is disable)
endpoints.dubbo.enabled = true

# Dubbo Health
## StatusChecker Name defaults (default : "memory", "load" )
management.health.dubbo.status.defaults = memory
## StatusChecker Name extras (default : empty )
management.health.dubbo.status.extras = load,threadpool
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Spring boot application
spring.application.name = dubbo-provider-demo
server.port = 9090
management.port = 9091
management.security.enabled = false

# Service Version
Expand All @@ -10,11 +9,8 @@ demo.service.version = 1.0.0
# Base packages to scan Dubbo Components (e.g @Service , @Reference)
dubbo.scan.basePackages = com.alibaba.boot.dubbo.demo.provider.service


# Dubbo Config properties
## ApplicationConfig Bean
dubbo.application.id = dubbo-provider-demo
dubbo.application.name = dubbo-provider-demo
dubbo.application.qos.port=22222
dubbo.application.qos.enable=true

Expand All @@ -26,13 +22,4 @@ dubbo.protocol.status = server

## RegistryConfig Bean
dubbo.registry.id = my-registry
dubbo.registry.address = N/A

# Dubbo Endpoint (default status is disable)
endpoints.dubbo.enabled = true

# Dubbo Health
## StatusChecker Name defaults (default : "memory", "load" )
management.health.dubbo.status.defaults = memory
## StatusChecker Name extras (default : empty )
management.health.dubbo.status.extras = load,threadpool
dubbo.registry.address = N/A

0 comments on commit 7bad4d2

Please sign in to comment.