Comments (8)
do you have a sample application?
from micronaut-discovery-client.
I do, but I'm trying to make it a separate project so it's not dependent on a lot of cruft.
The main idea is that the registration part works per the #517 instructions but if I try a consul client, it does not work. Give me about an hour, I think I can give you an example. But everything I've tried so far to make a consul client work has resulted in a different exception.
Right now I'm just following the grpc demo tutorial to re-create the example. Since it'll need to have a running consul application and a test dependent on a running consul, it'll take me a second.
from micronaut-discovery-client.
This one isn't giving the same error. I'm trying to recreate from scratch. I think I followed the direcitons right on here.
The test goes as follows:
- Creates grpc server on a random port, registers successfully with consul
- test attempts doesn't communicate with consul for client discovery (see Clients.java) -
The client returns, but when executing it's not using the client consul discovery.
from micronaut-discovery-client.
So I'm testing with the latest SNAPSHOT version - and still not able to get a consul client. Maybe I have a missing dependency. Is there any sample project that exists that successfully grabs a consul client? No matter what I try, it doesn't work. So I'm not sure if I just set it up wrong or what to do.
from micronaut-discovery-client.
I tested with the latest SNAPSHOT version and the service registration works with the original dependencies. Now when I try to send a payload, it looks like it expects SSL to be turned on:
Caused by: io.netty.handler.ssl.NotSslRecordException: not an SSL/TLS record: 00001204000000000000037fffffff000400100000000600002000000004080000000000000f0001
at io.netty.handler.ssl.SslHandler.decodeJdkCompatible(SslHandler.java:1313)
at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1383)
at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:529)
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:468)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:290)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
... 1 common frames omitted
I'm assuming this is now a confugiration issue. Are there instructions to setup SSL or disable it?
from micronaut-discovery-client.
OK - validated and got it to work on the latest snapshot. Works as it is designed! Thanks!
from micronaut-discovery-client.
can you try with Micronaut Framework 4.1.4? Does it work for you without pinning any snapshots?
from micronaut-discovery-client.
Tried it. Still works. Is there a way I can programatically get the client? I see that we put the channel name in the annotation - is there a way to create the same bean without the annotation?
So instead of this:
@Singleton
@Bean
@Named("vectorizer")
PipeServiceGrpc.PipeServiceStub vectorizorPipeServiceStub(
@GrpcChannel("vectorizer") ManagedChannel channel) {
return PipeServiceGrpc.newStub(channel);
}
Is there something like:
@Inject
GreeterGrpcStub buildStub(ConsulManagedGrpcClientFactory cf, String serviceaName) {
ManagedChannel grpc = cf.getServiceChannel(serviceName);
return GreeterGrpc.newStub(
grpc);
}
Of course, I know there's no ConsulManagedGrpcClientFactory, but I could really find one handy to use.
I have multiple versions of the same service that I would run in the same JVM. I would like to have the service names in the configuration and dynamically create the clients at anytime. I figured since the annotation does inject the channel, there might be a way to accomplish the getting a managed channel from Consul but by only passing in the service name? Can you nudge me in the right direction to accomplish this?
from micronaut-discovery-client.
Related Issues (20)
- Attempt to replace Jackson with Micronaut Serialization HOT 1
- Migrate to new configuration ascidoc macro
- Add flag for use name as prefix HOT 2
- Add native test
- VaultConfigurationClient failed if 1 path is not found HOT 1
- Dash '-' not working for activeName for Consul PropertySource name HOT 2
- Consul deregistration not working for multi-registered application HOT 1
- Error occurred during service registration with Consul, app throw UnimplementedAdviceException HOT 10
- Micronaut won't start (throws exception) when "discovery-client" feature is enabled HOT 2
- version 4 do no contains some fixes done in version 3
- Microanut service registration for consul and eureka does not startup, will not fully register the service HOT 13
- Unable to run test locally HOT 1
- CI Java 21 for Discovery Client
- Issue with resolving environment in consul config
- Registration with Eureka doesn't work when using Micronaut serialization
- GRPC service execution is throwing exceptions when updating to 4.2 micronaut HOT 1
- Del @Deprecated Discovery Client
- SpringCloud Config Client doesn't work with Micronaut Serialization
- Consul Client doesn't work when using Micronaut serialization
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from micronaut-discovery-client.