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

Service discovery with Nacos #5365

Open
ikhoon opened this issue Jan 2, 2024 · 6 comments · May be fixed by #5409
Open

Service discovery with Nacos #5365

ikhoon opened this issue Jan 2, 2024 · 6 comments · May be fixed by #5409
Assignees

Comments

@ikhoon
Copy link
Contributor

ikhoon commented Jan 2, 2024

It would be useful to support service registration and discovery using Nacos.

@KonaEspresso94
Copy link

Hi @ikhoon. I want to try this issue, can you assign this issue to me?

@ikhoon
Copy link
Contributor Author

ikhoon commented Jan 22, 2024

Sure. Thanks in advance! 🙇‍♂️

@KonaEspresso94 KonaEspresso94 linked a pull request Jan 25, 2024 that will close this issue
@shalk
Copy link

shalk commented May 9, 2024

I am nacos contributor and i can give some advice or some help.

For Nacos, it provide nacos-client. Nacos client version 1.x is based on http. from version 2.x nacos client is based on grpc.

The current pr is good and is light. It look like the PR use armeria to create nacos http client.

If we need more nacos power (grpc for long connection) and nacos plugins (eg. auth plugin), it should use nacos client to build the nacos module. like zookeeper module

@ikhoon
Copy link
Contributor Author

ikhoon commented May 9, 2024

As Armeria provides various transport layers, we prefer to use our stack to support certain protocols.

If we need more nacos power (grpc for long connection)

It sounds like gRPC is a better choice. I was wondering if there was a way to replace the gRPC client with Armeria gRPC client.

If it is not supported, I am curious about what you think about providing an API that can replace the underlying client with an Armeria gRPC client. Armeria is a rich gRPC client with more features than its upstream clients.

@shalk
Copy link

shalk commented May 9, 2024

As Armeria provides various transport layers, we prefer to use our stack to support certain protocols.

It make sense.

It sounds like gRPC is a better choice. I was wondering if there was a way to replace the gRPC client with Armeria gRPC client.

I can not replace the gRPC layer from the nacos-client by Armeria gRPC directly.

If it is not supported, I am curious about what you think about providing an API that can replace the underlying client with an Armeria gRPC client. Armeria is a rich gRPC client with more features than its upstream clients.

I think we can use Armeria gRPC to create NacosGrpcClient which support service register/list instance/watch etc.

The Nacos gRPC API is not document clear, I can give some info as follow:

  1. nacos grpc api is https://github.com/alibaba/nacos/blob/develop/api/src/main/proto/nacos_grpc_service.proto

  2. nacos use jackson to serialize the body to json , and then json to bytes in payload. https://github.com/alibaba/nacos/blob/develop/common/src/main/java/com/alibaba/nacos/common/remote/client/grpc/GrpcUtils.java#L75

Maybe i need try to create a prototype project (armeria-nacos-client) to test , make the api more clearly.

Should I need to try this ? @ikhoon

@ikhoon
Copy link
Contributor Author

ikhoon commented May 9, 2024

which use jackson to serialize the body to json and json to bytes in payload.

We have our own JSON marshaller which is more performant.

I don't know what wire protocol is used for the JSON payload. Armeria gRPC client supports JSON out of the box.

/**
* gRPC JSON serialization format.
*/
public static final SerializationFormat JSON = SerializationFormat.of("gjson");

Maybe i need try to create a prototype project (armeria-nacos-client) to test
Should I need to try this

Yes, please. 🙏 I'm looking forward to the result. If we can fully support all Nacos features, that would be better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants