0

我已将 Spring Boot 版本从 2.0 更新到 2.1.2,并为指标启用了执行器端点。但是为执行器端点获取此异常。它适用于以前的版本。

wsmsDefaultHandlerExceptionResolver:已解决 [org.springframework.http.converter.HttpMessageNotWritableException:无法写入 JSON:如果不指定 Schema,则无法写入 Avro 输出;嵌套异常是 com.fasterxml.jackson.databind.JsonMappingException: Can not write Avro output without specified Schema]

使用过的版本

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.1.2.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>

<avro.version>1.8.2</avro.version>
    <jackson.version>2.9.8</jackson.version>
    <spring-cloud.version>Greenwich.SR2</spring-cloud.version>
    <spring-cloud-stream-dependency.version>Fishtown.SR2</spring-cloud-stream-dependency.version>

应用程序.yml:

cloud:
stream:
  schema:
    avro:
      dynamic-schema-generation-enabled: true
  bindings:
    import-service-output:
      destination: import-service
      contentType: application/*+avro
    input:
      group: import-service
      destination: import-service
      contentType: application/*+avro
  schemaRegistryClient:
    endpoint: localhost:8081
    username: <username-key>
    password: <password-secret-key>
    
  kafka:
    binder:
      brokers: localhost:9092
4

0 回答 0