Comments (6)
The issue is with the serialization. There appears to not be a suitable Serde for InetAddress (I am using micronaut serialization).
I made my own Serde which seems to work (no need for @SerdeImport
anymore. I have only tested this using localhost
, so it may need some more testing.
@Singleton
public class InetAddressSerde implements Serde<InetAddress> {
@Nullable
@Override
public InetAddress deserialize(Decoder decoder, DecoderContext context, Argument<? super InetAddress> type) throws IOException {
return InetAddress.getByName(decoder.decodeString());
}
@Override
public void serialize(Encoder encoder, EncoderContext context, Argument<? extends InetAddress> type, InetAddress value) throws IOException {
encoder.encodeString(value.getHostAddress());
}
}
Why?
It looks like the registration is attempting to utilize this service
The serialized registration FROM micronaut using @SerdeImport
is:
{
"checks": [
{
"TTL": "25s",
"status": "passing"
}
],
"ID": "my-svc:55e23743cb",
"address": {
"multicastAddress": false,
"anyLocalAddress": false,
"loopbackAddress": true,
"linkLocalAddress": false,
"siteLocalAddress": false,
"MCGlobal": false,
"MCNodeLocal": false,
"MCLinkLocal": false,
"MCSiteLocal": false,
"MCOrgLocal": false,
"address": [127, 0, 0, 1],
"hostAddress": "127.0.0.1",
"hostName": "localhost",
"canonicalHostName": "localhost"
},
"port": 8081,
"name": "my-svc"
}
This is a sample payload. from their docs
from micronaut-discovery-client.
Consul and the Micronaut Framework - Microservices Service Discovery guide also fails with same issue.
from micronaut-discovery-client.
I've seen this issue too.
We have the intention to replace Jackson with Micronaut Serialization in this module for Micronaut 4, however, we are not there yet. Once #379 is done, I will give it a try.
from micronaut-discovery-client.
Any update on this? I am having the same issue:
micronaut: 3.7.0
discovery-client: 3.1.0
consul (docker): 1.14.3
from micronaut-discovery-client.
@stmty9, thank you so much for sharing the custom Serde code.
from micronaut-discovery-client.
closed via micronaut-projects/micronaut-serialization#593 and #523
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
- Microanut service registration for consul client will resutle in a failure even if the service is registered HOT 8
- 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.