micronaut-projects / micronaut-discovery-client

Micronaut's Discovery Client
Apache License 2.0
22 stars 20 forks source link

SpringCloud Config Client doesn't work with Micronaut Serialization #600

Open ggerbaud opened 6 months ago

ggerbaud commented 6 months ago

Expected Behavior

Very similar to #552

Serializable objects should be annotated with @Serdeable

Actual Behaviour

ConfigServerResponse and ConfigServerPropertySource classes are not annotated with @Serdeable and then in produce this error

Caused by: io.micronaut.core.beans.exceptions.IntrospectionException: No bean introspection available for type [class io.micronaut.discovery.spring.config.client.ConfigServerResponse]. Ensure the class is annotated with io.micronaut.core.annotation.Introspected

One could use @SerdeImport(ConfigServerResponse.class) but ConfigServerPropertySource has a protected constructor and then it doesn't work.

Steps To Reproduce

  1. Generate a project with this configuration (It's for Consul, weirdly there is no SpringCloud Config feature)
  2. Remove Consul properties and add these (replace with your SCC instance)
    micronaut:
    application:
    name: demo-scc
    config-client:
    enabled: true
    spring:
    cloud:
    config:
      uri: https://my.instance.url
      label: my_label
      username: user
      password: pass
  3. launch

Environment Information

No response

Example Application

No response

Version

4.x