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

java interop - triple protocol-java -go #730

Merged
merged 29 commits into from
Mar 31, 2024
Merged

java interop - triple protocol-java -go #730

merged 29 commits into from
Mar 31, 2024

Conversation

fansofml
Copy link
Contributor

if err != nil {
panic(err)
}
if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

plz remove no used code

Copy link
Contributor Author

@fansofml fansofml Mar 22, 2024

Choose a reason for hiding this comment

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

ok,i will change it

<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-compiler</artifactId>
<version>${dubbo.version}</version>
<mainClass>org.apache.dubbo.gen.tri.Dubbo3TripleGenerator</mainClass>
Copy link
Contributor

@FoghostCn FoghostCn Mar 22, 2024

Choose a reason for hiding this comment

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

plz remove the generated codes and add a readme to tell people how to generate them

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have added instructions on how to generate proto in the README.

@@ -0,0 +1 @@
mvn -e clean compile exec:java -Dexec.mainClass="org.apache.dubbo.sample.Provider"
Copy link
Contributor

Choose a reason for hiding this comment

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

Better use mvn wrapper

Copy link
Contributor

Choose a reason for hiding this comment

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

https://github.com/apache/dubbo-samples/tree/master/11-quickstart

check mvn wrapper configuration in this directory.


DubboBootstrap bootstrap = DubboBootstrap.getInstance();
bootstrap.application(new ApplicationConfig("java-go-sample-server"))
.registry(new RegistryConfig("zookeeper://127.0.0.1:2181"))
Copy link
Contributor

Choose a reason for hiding this comment

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

registry is not mandatory for this case

ref.setTimeout(3000);
bootstrap.application(new ApplicationConfig("duboo-test"))
.registry(new RegistryConfig("zookeeper://127.0.0.1:2181"))
.protocol(new ProtocolConfig(CommonConstants.TRIPLE,50052))
Copy link
Contributor

Choose a reason for hiding this comment

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

protocol is not needed for consumer, remove this line please

ref.setProxy(CommonConstants.NATIVE_STUB);
ref.setTimeout(3000);
bootstrap.application(new ApplicationConfig("duboo-test"))
.registry(new RegistryConfig("zookeeper://127.0.0.1:2181"))
Copy link
Contributor

Choose a reason for hiding this comment

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

registry is not necessary for this case, better use ref.setUrl("tri://ip:port") instead.

dubbo.WithName("org.apache.dubbo.sample.GreeterImpl"),
dubbo.WithRegistry(
registry.WithZookeeper(),
registry.WithAddress("127.0.0.1:2181"),
Copy link
Contributor

Choose a reason for hiding this comment

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

remove this line

services:
GreeterConsumer:
# interface is for registry
interface: org.apache.dubbo.demo.GreeterImpl
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this file still needed? I think we don't need this file anymore with the new API. Please confirm if we can delete this file.

services:
GreeterProvider:
# interface is for registry
interface: org.apache.dubbo.demo.GreeterImpl
Copy link
Contributor

Choose a reason for hiding this comment

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

Please confirm if we can delete this file.

<artifactId>dubbo-dependencies-zookeeper-curator5</artifactId>
<type>pom</type>
<version>${dubbo.version}</version>
</dependency>
Copy link
Contributor

Choose a reason for hiding this comment

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

remove this dependency after registry configuration removed.

<artifactId>dubbo-dependencies-zookeeper-curator5</artifactId>
<type>pom</type>
<version>${dubbo.version}</version>
</dependency>
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove this dependency

@EndlessSeeker
Copy link
Contributor

plz add integrate test for this case

@fansofml
Copy link
Contributor Author

plz add integrate test for this case

You can test it by following the instructions in the README.

@chickenlj chickenlj merged commit cabe030 into apache:main Mar 31, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants