Skip to content

Commit

Permalink
update basic sample
Browse files Browse the repository at this point in the history
  • Loading branch information
chickenlj committed Mar 28, 2024
1 parent 8f29abb commit 3e691e6
Show file tree
Hide file tree
Showing 11 changed files with 180 additions and 2 deletions.
2 changes: 1 addition & 1 deletion 1-basic/dubbo-samples-spring-boot-idl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Run the following command to see server works as expected:
```shell
curl \
--header "Content-Type: application/json" \
--data '{name:"Dubbo"}' \
--data '{"name":"Dubbo"}' \
http://localhost:50052/org.apache.dubbo.springboot.demo.idl.Greeter/greet/
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@
dubbo:
application:
name: dubbo-springboot-demo-consumer
logger: slf4j
registry:
address: zookeeper://${zookeeper.address:127.0.0.1}:2181
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to You under the Apache License, Version 2.0
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<Configuration status="WARN">
<Appenders>
<Console name="Console" target="SYSTEM_OUT" follow="true">
<PatternLayout pattern="%style{%d{HH:mm:ss.SSS}}{Magenta} %style{|-}{White}%highlight{%-5p} [%t] %style{%40.40c}{Cyan}:%style{%-3L}{Blue} %style{-|}{White} %m%n%rEx{filters(jdk.internal.reflect,java.lang.reflect,sun.reflect)}" disableAnsi="false" charset="UTF-8"/>
</Console>
</Appenders>
<Loggers>
<Root level="info">
<AppenderRef ref="Console"/>
</Root>
<Logger name="log4j.logger.org.apache.zookeeper" level="warn" />
<Logger name="log4j.logger.org.apache.dubbo.registry.zookeeper" level="warn" />
<Logger name="log4j.logger.org.apache.dubbo.config.deploy" level="warn" />
<Logger name="log4j.logger.org.apache.dubbo.registry.client" level="warn" />
<Logger name="log4j.logger.org.apache.dubbo.rpc.model" level="warn" />
</Loggers>
</Configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
dubbo:
application:
name: dubbo-springboot-demo-idl-provider
logger: slf4j
protocol:
name: tri
port: 50052
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to You under the Apache License, Version 2.0
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<Configuration status="WARN">
<Appenders>
<Console name="Console" target="SYSTEM_OUT" follow="true">
<PatternLayout pattern="%style{%d{HH:mm:ss.SSS}}{Magenta} %style{|-}{White}%highlight{%-5p} [%t] %style{%40.40c}{Cyan}:%style{%-3L}{Blue} %style{-|}{White} %m%n%rEx{filters(jdk.internal.reflect,java.lang.reflect,sun.reflect)}" disableAnsi="false" charset="UTF-8"/>
</Console>
</Appenders>
<Loggers>
<Root level="info">
<AppenderRef ref="Console"/>
</Root>
<Logger name="log4j.logger.org.apache.zookeeper" level="warn" />
<Logger name="log4j.logger.org.apache.dubbo.registry.zookeeper" level="warn" />
<Logger name="log4j.logger.org.apache.dubbo.config.deploy" level="warn" />
<Logger name="log4j.logger.org.apache.dubbo.registry.client" level="warn" />
<Logger name="log4j.logger.org.apache.dubbo.rpc.model" level="warn" />
</Loggers>
</Configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,20 @@
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-zookeeper-curator5-spring-boot-starter</artifactId>
<exclusions>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
</exclusion>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</exclusion>
</exclusions>
</dependency>

<!-- spring starter -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
dubbo:
application:
name: dubbo-springboot-demo-consumer
logger: slf4j
qos-port: 33333
registry:
address: zookeeper://${zookeeper.address:127.0.0.1}:2181
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to You under the Apache License, Version 2.0
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<Configuration status="WARN">
<Appenders>
<Console name="Console" target="SYSTEM_OUT" follow="true">
<PatternLayout pattern="%style{%d{HH:mm:ss.SSS}}{Magenta} %style{|-}{White}%highlight{%-5p} [%t] %style{%40.40c}{Cyan}:%style{%-3L}{Blue} %style{-|}{White} %m%n%rEx{filters(jdk.internal.reflect,java.lang.reflect,sun.reflect)}" disableAnsi="false" charset="UTF-8"/>
</Console>
</Appenders>
<Loggers>
<Root level="info">
<AppenderRef ref="Console"/>
</Root>
<Logger name="log4j.logger.org.apache.zookeeper" level="warn" />
<Logger name="log4j.logger.org.apache.dubbo.registry.zookeeper" level="warn" />
<Logger name="log4j.logger.org.apache.dubbo.config.deploy" level="warn" />
<Logger name="log4j.logger.org.apache.dubbo.registry.client" level="warn" />
<Logger name="log4j.logger.org.apache.dubbo.rpc.model" level="warn" />
</Loggers>
</Configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,36 @@
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-zookeeper-curator5-spring-boot-starter</artifactId>
<exclusions>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
</exclusion>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-nacos-spring-boot-starter</artifactId>
</dependency>

<!-- spring starter -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@

dubbo:
application:
name: dubbo-springboot-demo-provider
name: dubbo-springboot-demo-provider
logger: slf4j
protocol:
name: tri
port: 50052
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to You under the Apache License, Version 2.0
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<Configuration status="WARN">
<Appenders>
<Console name="Console" target="SYSTEM_OUT" follow="true">
<PatternLayout pattern="%style{%d{HH:mm:ss.SSS}}{Magenta} %style{|-}{White}%highlight{%-5p} [%t] %style{%40.40c}{Cyan}:%style{%-3L}{Blue} %style{-|}{White} %m%n%rEx{filters(jdk.internal.reflect,java.lang.reflect,sun.reflect)}" disableAnsi="false" charset="UTF-8"/>
</Console>
</Appenders>
<Loggers>
<Root level="info">
<AppenderRef ref="Console"/>
</Root>
<Logger name="log4j.logger.org.apache.zookeeper" level="warn" />
<Logger name="log4j.logger.org.apache.dubbo.registry.zookeeper" level="warn" />
<Logger name="log4j.logger.org.apache.dubbo.config.deploy" level="warn" />
<Logger name="log4j.logger.org.apache.dubbo.registry.client" level="warn" />
<Logger name="log4j.logger.org.apache.dubbo.rpc.model" level="warn" />
</Loggers>
</Configuration>

0 comments on commit 3e691e6

Please sign in to comment.