You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by vishnu murali <vi...@gmail.com> on 2020/07/16 04:01:57 UTC

Schema validation problem

Hi all

My schema is:



{
  "fields": [

    {
      "name": "ID",

      "type": "long"

    },

    {
      "name": "Group",

      "type": [

        "null",

        {
          "avro.java.string": "String",

          "type": "string"

        }

      ]

    },

    {
      "name": "Key",

      "type": [

        "null",

        {
          "avro.java.string": "String",

          "type": "string"

        }

      ]

    },

    {
      "name": "Value",

      "type": [

        "null",

        {
          "avro.java.string": "String",

          "type": "string"

        }

      ]

    }

  ],

  "name": "Runconfig",

  "namespace": "com.ns.vishnu.kafkaavorest.Model",

  "type": "record"

}





My Data is:

Runconfig rc = Runconfig.newBuilder()
        .setID(1L)
        .setGroup("new")
        .setKey("year")
        .setValue("11")
        .build();



runTemlate.send(“n-run”,rc);





Exception will be: org.apache.kafka.common.InvalidRecordException: This
record has failed the validation on broker and hence be rejected.





What is the validation mistake in this ?

I checked  every datatype it is correct only!!

Any suggestions on this !!

Re: Schema validation problem

Posted by vishnu murali <vi...@gmail.com>.
When I am checking Kafka logs it is there:


Invalid record due to REST client error
(io.confluent.kafka.schemaregistry.validator.RecordSchemaValidator)

io.confluent.kafka.schemaregistry.client.rest.exceptions.RestClientException:
This ID is banned; error code: 40403

                at
io.confluent.kafka.schemaregistry.validator.LruSchemaRegistryClient.getSchemaByIdFromRegistry(LruSchemaRegistryClient.java:188)

On Thu, Jul 16, 2020, 09:31 vishnu murali <vi...@gmail.com>
wrote:

> Hi all
>
> My schema is:
>
>
>
> {
>   "fields": [
>
>     {
>       "name": "ID",
>
>       "type": "long"
>
>     },
>
>     {
>       "name": "Group",
>
>       "type": [
>
>         "null",
>
>         {
>           "avro.java.string": "String",
>
>           "type": "string"
>
>         }
>
>       ]
>
>     },
>
>     {
>       "name": "Key",
>
>       "type": [
>
>         "null",
>
>         {
>           "avro.java.string": "String",
>
>           "type": "string"
>
>         }
>
>       ]
>
>     },
>
>     {
>       "name": "Value",
>
>       "type": [
>
>         "null",
>
>         {
>           "avro.java.string": "String",
>
>           "type": "string"
>
>         }
>
>       ]
>
>     }
>
>   ],
>
>   "name": "Runconfig",
>
>   "namespace": "com.ns.vishnu.kafkaavorest.Model",
>
>   "type": "record"
>
> }
>
>
>
>
>
> My Data is:
>
> Runconfig rc = Runconfig.newBuilder()
>         .setID(1L)
>         .setGroup("new")
>         .setKey("year")
>         .setValue("11")
>         .build();
>
>
>
> runTemlate.send(“n-run”,rc);
>
>
>
>
>
> Exception will be: org.apache.kafka.common.InvalidRecordException: This
> record has failed the validation on broker and hence be rejected.
>
>
>
>
>
> What is the validation mistake in this ?
>
> I checked  every datatype it is correct only!!
>
> Any suggestions on this !!
>