Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Dubbo-fixed annotation demo fail to start]. #1570

Merged
merged 1 commit into from
May 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static void main(String[] args) throws Exception {
}

@Configuration
@EnableDubbo(scanBasePackages = "com.alibaba.dubbo.examples.annotation.action", multipleConfig = true)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happened to the multiConfig property. Has this property beed removed? If i want to config more than one registries, how to achieve this now?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default annotation supports dubbo.application and other singular forms, eg: dubbo.registry.xx;
If you use multipleConfig=true, you need to use this form dubbo.applications.xx, as a demo, using the default is appropriate.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

multipleConfig=true & dubbo.applications.xx

I know the right to use now.

@EnableDubbo(scanBasePackages = "com.alibaba.dubbo.examples.annotation.action")
@PropertySource("classpath:/com/alibaba/dubbo/examples/annotation/dubbo-consumer.properties")
@ComponentScan(value = {"com.alibaba.dubbo.examples.annotation.action"})
static public class ConsumerConfiguration {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,13 @@ public static void main(String[] args) throws Exception {
}

@Configuration
@EnableDubbo(scanBasePackages = "com.alibaba.dubbo.examples.annotation.impl", multipleConfig = true)
@EnableDubbo(scanBasePackages = "com.alibaba.dubbo.examples.annotation.impl")
@PropertySource("classpath:/com/alibaba/dubbo/examples/annotation/dubbo-provider.properties")
// @ComponentScan(value = {"com.alibaba.dubbo.examples.annotation.impl"})
static public class ProviderConfiguration {
@Bean
public ProviderConfig providerConfig() {
ProviderConfig providerConfig = new ProviderConfig();
providerConfig.setTimeout(1000);
providerConfig.setTimeout(5000);
return providerConfig;
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#<dubbo:application name="annotation-consumer"/>
dubbo.application.application-id.name=annotation-consumer
#<dubbo:registry id="registry-id" address="multicast://224.5.6.7:1234"/>
dubbo.registry.registry-id.address=zookeeper://127.0.0.1:2181
dubbo.application.name=annotation-consumer
dubbo.registry.address=multicast://224.5.6.7:1234
dubbo.consumer.consumer-id.timeout=3000
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
#<dubbo:application id="application-id" name="dubbo-annotation-provider"/>
dubbo.application.application-id.name=xxx
#<dubbo:registry id="registry-id" address="multicast://224.5.6.7:1234"/>
dubbo.registry.registry-id.address=zookeeper://127.0.0.1:2181
#<dubbo:protocol id="protocol-id" name="dubbo" port="12345"/>
dubbo.application.name=xxx
dubbo.registry.address=multicast://224.5.6.7:1234
dubbo.protocol.protocol-id.name=dubbo
dubbo.protocol.protocol-id.port=20883
24 changes: 24 additions & 0 deletions dubbo-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,30 @@ limitations under the License.
<artifactId>hessian-lite</artifactId>
<version>3.2.2</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>dubbo-serialization-api</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>dubbo-serialization-hessian2</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>dubbo-serialization-fst</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>dubbo-serialization-fastjson</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>dubbo-serialization-kryo</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>dubbo-serialization-jdk</artifactId>
</dependency>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why add so many serialization extensions, i think one is enough.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Hessian2 protocol is used by default, and all supported types can be added to annotations. There is no harm in dubbo's default protocol.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My opinion, only add necessary dependencies to demo, reduce chances to get users confused.

<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
Expand Down