please help “serialization format issue” from kafka to elasticsearch Unicorn Meta Zoo #1:...

I preordered a game on my Xbox while on the home screen of my friend's account. Which of us owns the game?

What does a straight horizontal line above a few notes, after a changed tempo mean?

What's the difference between using dependency injection with a container and using a service locator?

Why doesn't the standard consider a template constructor as a copy constructor?

view price of already bought and installed apps on play sotr

Co-worker works way more than he should

Philosophical question on logistic regression: why isn't the optimal threshold value trained?

Can I criticise the more senior developers around me for not writing clean code?

Could moose/elk survive in the Amazon forest?

Multiple options vs single option UI

A faster way to compute the largest prime factor

Should the Product Owner dictate what info the UI needs to display?

What is this word supposed to be?

How much of a wave function must reside inside event horizon for it to be consumed by the black hole?

How do I reattach a shelf to the wall when it ripped out of the wall?

Obeylines and gappto from etoolbox

"Whatever a Russian does, they end up making the Kalashnikov gun"? Are there any similar proverbs in English?

Which big number is bigger?

Raising a bilingual kid. When should we introduce the majority language?

My admission is revoked after accepting the admission offer

Double-nominative constructions and “von”

Bayes factor vs P value

What is /etc/mtab in Linux?

Is there metaphorical meaning of "aus der Haft entlassen"?



please help “serialization format issue” from kafka to elasticsearch



Unicorn Meta Zoo #1: Why another podcast?
Announcing the arrival of Valued Associate #679: Cesar ManaraHelp getting iPython to run from the OSX terminalOn Ubuntu: I deleted /usr/bin/python2.7 - please helppython2.7 from macports stdin issueHow to convert a file format from tar.gz to tar.bz2 using the windows console?Please Help installing Qt centos 7please help me with resolving the error while installing tensorflowCan someone help me set up tensorflow & neural-style-tf please?





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







0















source DB: mongodb 3.6
kafka: confluent 5.12
target: elastcisearch 7



from mongodb to kafka, it is working well



[oracle@houbiap5 confluent5]$ bin/kafka-console-consumer --bootstrap-server houbiap5:9092 --topic customers --from-beginning
{"after":null,"patch":null,"source":{"version":"0.9.4.Final","connector":"mongodb","name":"mongodbTest","rs":"mongo01","ns":"inventory.customers","sec":1556119323,"ord":1,"h":1255747003695718904,"initsync":false},"op":"d","ts_ms":1556119323326}
null
{"after":null,"patch":null,"source":{"version":"0.9.4.Final","connector":"mongodb","name":"mongodbTest","rs":"mongo01","ns":"inventory.customers","sec":1556119323,"ord":2,"h":-3344312220964857180,"initsync":false},"op":"d","ts_ms":1556119323328}
null
{"after":null,"patch":null,"source":{"version":"0.9.4.Final","connector":"mongodb","name":"mongodbTest","rs":"mongo01","ns":"inventory.customers","sec":1556119323,"ord":3,"h":8650281562576212760,"initsync":false},"op":"d","ts_ms":1556119323328}
null
{"after":null,"patch":null,"source":{"version":"0.9.4.Final","connector":"mongodb","name":"mongodbTest","rs":"mongo01","ns":"inventory.customers","sec":1556119323,"ord":4,"h":7307862537196435761,"initsync":false},"op":"d","ts_ms":1556119323328}
null
{"after":null,"patch":null,"source":{"version":"0.9.4.Final","connector":"mongodb","name":"mongodbTest","rs":"mongo01","ns":"inventory.customers","sec":1556119323,"ord":5,"h":7141663475881294335,"initsync":false},"op":"d","ts_ms":1556119323328}
null
{"after":"{"_id" : {"$numberLong" : "1001"},"first_name" : "Sally","last_name" : "Thomas","email" : "sally.thomas@acme.com"}","patch":null,"source":{"version":"0.9.4.Final","connector":"mongodb","name":"mongodbTest","rs":"mongo01","ns":"inventory.customers","sec":1556119356,"ord":1,"h":-8203394498065317421,"initsync":false},"op":"c","ts_ms":1556119356396}
{"after":"{"_id" : {"$numberLong" : "1002"},"first_name" : "George","last_name" : "Bailey","email" : "gbailey@foobar.com"}","patch":null,"source":{"version":"0.9.4.Final","connector":"mongodb","name":"mongodbTest","rs":"mongo01","ns":"inventory.customers","sec":1556119356,"ord":2,"h":-6732911301588244805,"initsync":false},"op":"c","ts_ms":1556119356396}
{"after":"{"_id" : {"$numberLong" : "1003"},"first_name" : "Edward","last_name" : "Walker","email" : "ed@walker.com"}","patch":null,"source":{"version":"0.9.4.Final","connector":"mongodb","name":"mongodbTest","rs":"mongo01","ns":"inventory.customers","sec":1556119356,"ord":3,"h":5731956300969233689,"initsync":false},"op":"c","ts_ms":1556119356396}
{"after":"{"_id" : {"$numberLong" : "1004"},"first_name" : "Anne","last_name" : "Kretchmar","email" : "annek@noanswer.org"}","patch":null,"source":{"version":"0.9.4.Final","connector":"mongodb","name":"mongodbTest","rs":"mongo01","ns":"inventory.customers","sec":1556119356,"ord":4,"h":3324121584721164025,"initsync":false},"op":"c","ts_ms":1556119356396}



I am using avroConverter in mongo-source.json
"key.converter": "io.confluent.connect.avro.AvroConverter",
"key.converter.schema.registry.url": "http://houbiap5:8081",
"value.converter": "io.confluent.connect.avro.AvroConverter",
"value.converter.schema.registry.url": "http://houbiap5:8081",



so the data should be AVRO format in kafka



[oracle@houbiap5 dba]$ cat mongo-es-sink.json
{
"name": "mongo-es-sink",
"config": {
"connector.class": "io.confluent.connect.elasticsearch.ElasticsearchSinkConnector",
"tasks.max": "1",
"topics": "customers",



    "key.converter": "io.confluent.connect.avro.AvroConverter",
"key.converter.schema.registry.url": "http://houbiap5:8081",
"value.converter": "io.confluent.connect.avro.AvroConverter",
"value.converter.schema.registry.url": "http://houbiap5:8081",

"connection.url": "http://houtestdb5:9200",

"key.ignore": "true",
"type.name": "kafka-connect"
}


}



now when I registered elasticsearch connector , i got the following errors



[oracle@houbiap5 dba]$ curl -s http://houbiap5:8083/connectors/mongo-es-sink/status |jq
{
"name": "mongo-es-sink",
"connector": {
"state": "RUNNING",
"worker_id": "10.154.54.83:8083"
},
"tasks": [
{
"id": 0,
"state": "FAILED",
"worker_id": "10.154.54.83:8083",
"trace": "org.apache.kafka.connect.errors.ConnectException: Tolerance exceeded in error handlerntat org.apache.kafka.connect.runtime.errors.RetryWithToleranceOperator.execAndHandleError(RetryWithToleranceOperator.java:178)ntat org.apache.kafka.connect.runtime.errors.RetryWithToleranceOperator.execute(RetryWithToleranceOperator.java:104)ntat org.apache.kafka.connect.runtime.WorkerSinkTask.convertAndTransformRecord(WorkerSinkTask.java:484)ntat org.apache.kafka.connect.runtime.WorkerSinkTask.convertMessages(WorkerSinkTask.java:464)ntat org.apache.kafka.connect.runtime.WorkerSinkTask.poll(WorkerSinkTask.java:320)ntat org.apache.kafka.connect.runtime.WorkerSinkTask.iteration(WorkerSinkTask.java:224)ntat org.apache.kafka.connect.runtime.WorkerSinkTask.execute(WorkerSinkTask.java:192)ntat org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:175)ntat org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:219)ntat java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)ntat java.util.concurrent.FutureTask.run(FutureTask.java:266)ntat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)ntat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)ntat java.lang.Thread.run(Thread.java:748)nCaused by: org.apache.kafka.connect.errors.DataException: Failed to deserialize data for topic customers to Avro: ntat io.confluent.connect.avro.AvroConverter.toConnectData(AvroConverter.java:107)ntat org.apache.kafka.connect.runtime.WorkerSinkTask.lambda$convertAndTransformRecord$0(WorkerSinkTask.java:484)ntat org.apache.kafka.connect.runtime.errors.RetryWithToleranceOperator.execAndRetry(RetryWithToleranceOperator.java:128)ntat org.apache.kafka.connect.runtime.errors.RetryWithToleranceOperator.execAndHandleError(RetryWithToleranceOperator.java:162)nt... 13 morenCaused by: org.apache.kafka.common.errors.SerializationException: Error deserializing Avro message for id -1nCaused by: org.apache.kafka.common.errors.SerializationException: Unknown magic byte!n"
}
],
"type": "sink"
}



Please help, thanks a lot!










share|improve this question







New contributor




user1027177 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



























    0















    source DB: mongodb 3.6
    kafka: confluent 5.12
    target: elastcisearch 7



    from mongodb to kafka, it is working well



    [oracle@houbiap5 confluent5]$ bin/kafka-console-consumer --bootstrap-server houbiap5:9092 --topic customers --from-beginning
    {"after":null,"patch":null,"source":{"version":"0.9.4.Final","connector":"mongodb","name":"mongodbTest","rs":"mongo01","ns":"inventory.customers","sec":1556119323,"ord":1,"h":1255747003695718904,"initsync":false},"op":"d","ts_ms":1556119323326}
    null
    {"after":null,"patch":null,"source":{"version":"0.9.4.Final","connector":"mongodb","name":"mongodbTest","rs":"mongo01","ns":"inventory.customers","sec":1556119323,"ord":2,"h":-3344312220964857180,"initsync":false},"op":"d","ts_ms":1556119323328}
    null
    {"after":null,"patch":null,"source":{"version":"0.9.4.Final","connector":"mongodb","name":"mongodbTest","rs":"mongo01","ns":"inventory.customers","sec":1556119323,"ord":3,"h":8650281562576212760,"initsync":false},"op":"d","ts_ms":1556119323328}
    null
    {"after":null,"patch":null,"source":{"version":"0.9.4.Final","connector":"mongodb","name":"mongodbTest","rs":"mongo01","ns":"inventory.customers","sec":1556119323,"ord":4,"h":7307862537196435761,"initsync":false},"op":"d","ts_ms":1556119323328}
    null
    {"after":null,"patch":null,"source":{"version":"0.9.4.Final","connector":"mongodb","name":"mongodbTest","rs":"mongo01","ns":"inventory.customers","sec":1556119323,"ord":5,"h":7141663475881294335,"initsync":false},"op":"d","ts_ms":1556119323328}
    null
    {"after":"{"_id" : {"$numberLong" : "1001"},"first_name" : "Sally","last_name" : "Thomas","email" : "sally.thomas@acme.com"}","patch":null,"source":{"version":"0.9.4.Final","connector":"mongodb","name":"mongodbTest","rs":"mongo01","ns":"inventory.customers","sec":1556119356,"ord":1,"h":-8203394498065317421,"initsync":false},"op":"c","ts_ms":1556119356396}
    {"after":"{"_id" : {"$numberLong" : "1002"},"first_name" : "George","last_name" : "Bailey","email" : "gbailey@foobar.com"}","patch":null,"source":{"version":"0.9.4.Final","connector":"mongodb","name":"mongodbTest","rs":"mongo01","ns":"inventory.customers","sec":1556119356,"ord":2,"h":-6732911301588244805,"initsync":false},"op":"c","ts_ms":1556119356396}
    {"after":"{"_id" : {"$numberLong" : "1003"},"first_name" : "Edward","last_name" : "Walker","email" : "ed@walker.com"}","patch":null,"source":{"version":"0.9.4.Final","connector":"mongodb","name":"mongodbTest","rs":"mongo01","ns":"inventory.customers","sec":1556119356,"ord":3,"h":5731956300969233689,"initsync":false},"op":"c","ts_ms":1556119356396}
    {"after":"{"_id" : {"$numberLong" : "1004"},"first_name" : "Anne","last_name" : "Kretchmar","email" : "annek@noanswer.org"}","patch":null,"source":{"version":"0.9.4.Final","connector":"mongodb","name":"mongodbTest","rs":"mongo01","ns":"inventory.customers","sec":1556119356,"ord":4,"h":3324121584721164025,"initsync":false},"op":"c","ts_ms":1556119356396}



    I am using avroConverter in mongo-source.json
    "key.converter": "io.confluent.connect.avro.AvroConverter",
    "key.converter.schema.registry.url": "http://houbiap5:8081",
    "value.converter": "io.confluent.connect.avro.AvroConverter",
    "value.converter.schema.registry.url": "http://houbiap5:8081",



    so the data should be AVRO format in kafka



    [oracle@houbiap5 dba]$ cat mongo-es-sink.json
    {
    "name": "mongo-es-sink",
    "config": {
    "connector.class": "io.confluent.connect.elasticsearch.ElasticsearchSinkConnector",
    "tasks.max": "1",
    "topics": "customers",



        "key.converter": "io.confluent.connect.avro.AvroConverter",
    "key.converter.schema.registry.url": "http://houbiap5:8081",
    "value.converter": "io.confluent.connect.avro.AvroConverter",
    "value.converter.schema.registry.url": "http://houbiap5:8081",

    "connection.url": "http://houtestdb5:9200",

    "key.ignore": "true",
    "type.name": "kafka-connect"
    }


    }



    now when I registered elasticsearch connector , i got the following errors



    [oracle@houbiap5 dba]$ curl -s http://houbiap5:8083/connectors/mongo-es-sink/status |jq
    {
    "name": "mongo-es-sink",
    "connector": {
    "state": "RUNNING",
    "worker_id": "10.154.54.83:8083"
    },
    "tasks": [
    {
    "id": 0,
    "state": "FAILED",
    "worker_id": "10.154.54.83:8083",
    "trace": "org.apache.kafka.connect.errors.ConnectException: Tolerance exceeded in error handlerntat org.apache.kafka.connect.runtime.errors.RetryWithToleranceOperator.execAndHandleError(RetryWithToleranceOperator.java:178)ntat org.apache.kafka.connect.runtime.errors.RetryWithToleranceOperator.execute(RetryWithToleranceOperator.java:104)ntat org.apache.kafka.connect.runtime.WorkerSinkTask.convertAndTransformRecord(WorkerSinkTask.java:484)ntat org.apache.kafka.connect.runtime.WorkerSinkTask.convertMessages(WorkerSinkTask.java:464)ntat org.apache.kafka.connect.runtime.WorkerSinkTask.poll(WorkerSinkTask.java:320)ntat org.apache.kafka.connect.runtime.WorkerSinkTask.iteration(WorkerSinkTask.java:224)ntat org.apache.kafka.connect.runtime.WorkerSinkTask.execute(WorkerSinkTask.java:192)ntat org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:175)ntat org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:219)ntat java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)ntat java.util.concurrent.FutureTask.run(FutureTask.java:266)ntat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)ntat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)ntat java.lang.Thread.run(Thread.java:748)nCaused by: org.apache.kafka.connect.errors.DataException: Failed to deserialize data for topic customers to Avro: ntat io.confluent.connect.avro.AvroConverter.toConnectData(AvroConverter.java:107)ntat org.apache.kafka.connect.runtime.WorkerSinkTask.lambda$convertAndTransformRecord$0(WorkerSinkTask.java:484)ntat org.apache.kafka.connect.runtime.errors.RetryWithToleranceOperator.execAndRetry(RetryWithToleranceOperator.java:128)ntat org.apache.kafka.connect.runtime.errors.RetryWithToleranceOperator.execAndHandleError(RetryWithToleranceOperator.java:162)nt... 13 morenCaused by: org.apache.kafka.common.errors.SerializationException: Error deserializing Avro message for id -1nCaused by: org.apache.kafka.common.errors.SerializationException: Unknown magic byte!n"
    }
    ],
    "type": "sink"
    }



    Please help, thanks a lot!










    share|improve this question







    New contributor




    user1027177 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      0












      0








      0








      source DB: mongodb 3.6
      kafka: confluent 5.12
      target: elastcisearch 7



      from mongodb to kafka, it is working well



      [oracle@houbiap5 confluent5]$ bin/kafka-console-consumer --bootstrap-server houbiap5:9092 --topic customers --from-beginning
      {"after":null,"patch":null,"source":{"version":"0.9.4.Final","connector":"mongodb","name":"mongodbTest","rs":"mongo01","ns":"inventory.customers","sec":1556119323,"ord":1,"h":1255747003695718904,"initsync":false},"op":"d","ts_ms":1556119323326}
      null
      {"after":null,"patch":null,"source":{"version":"0.9.4.Final","connector":"mongodb","name":"mongodbTest","rs":"mongo01","ns":"inventory.customers","sec":1556119323,"ord":2,"h":-3344312220964857180,"initsync":false},"op":"d","ts_ms":1556119323328}
      null
      {"after":null,"patch":null,"source":{"version":"0.9.4.Final","connector":"mongodb","name":"mongodbTest","rs":"mongo01","ns":"inventory.customers","sec":1556119323,"ord":3,"h":8650281562576212760,"initsync":false},"op":"d","ts_ms":1556119323328}
      null
      {"after":null,"patch":null,"source":{"version":"0.9.4.Final","connector":"mongodb","name":"mongodbTest","rs":"mongo01","ns":"inventory.customers","sec":1556119323,"ord":4,"h":7307862537196435761,"initsync":false},"op":"d","ts_ms":1556119323328}
      null
      {"after":null,"patch":null,"source":{"version":"0.9.4.Final","connector":"mongodb","name":"mongodbTest","rs":"mongo01","ns":"inventory.customers","sec":1556119323,"ord":5,"h":7141663475881294335,"initsync":false},"op":"d","ts_ms":1556119323328}
      null
      {"after":"{"_id" : {"$numberLong" : "1001"},"first_name" : "Sally","last_name" : "Thomas","email" : "sally.thomas@acme.com"}","patch":null,"source":{"version":"0.9.4.Final","connector":"mongodb","name":"mongodbTest","rs":"mongo01","ns":"inventory.customers","sec":1556119356,"ord":1,"h":-8203394498065317421,"initsync":false},"op":"c","ts_ms":1556119356396}
      {"after":"{"_id" : {"$numberLong" : "1002"},"first_name" : "George","last_name" : "Bailey","email" : "gbailey@foobar.com"}","patch":null,"source":{"version":"0.9.4.Final","connector":"mongodb","name":"mongodbTest","rs":"mongo01","ns":"inventory.customers","sec":1556119356,"ord":2,"h":-6732911301588244805,"initsync":false},"op":"c","ts_ms":1556119356396}
      {"after":"{"_id" : {"$numberLong" : "1003"},"first_name" : "Edward","last_name" : "Walker","email" : "ed@walker.com"}","patch":null,"source":{"version":"0.9.4.Final","connector":"mongodb","name":"mongodbTest","rs":"mongo01","ns":"inventory.customers","sec":1556119356,"ord":3,"h":5731956300969233689,"initsync":false},"op":"c","ts_ms":1556119356396}
      {"after":"{"_id" : {"$numberLong" : "1004"},"first_name" : "Anne","last_name" : "Kretchmar","email" : "annek@noanswer.org"}","patch":null,"source":{"version":"0.9.4.Final","connector":"mongodb","name":"mongodbTest","rs":"mongo01","ns":"inventory.customers","sec":1556119356,"ord":4,"h":3324121584721164025,"initsync":false},"op":"c","ts_ms":1556119356396}



      I am using avroConverter in mongo-source.json
      "key.converter": "io.confluent.connect.avro.AvroConverter",
      "key.converter.schema.registry.url": "http://houbiap5:8081",
      "value.converter": "io.confluent.connect.avro.AvroConverter",
      "value.converter.schema.registry.url": "http://houbiap5:8081",



      so the data should be AVRO format in kafka



      [oracle@houbiap5 dba]$ cat mongo-es-sink.json
      {
      "name": "mongo-es-sink",
      "config": {
      "connector.class": "io.confluent.connect.elasticsearch.ElasticsearchSinkConnector",
      "tasks.max": "1",
      "topics": "customers",



          "key.converter": "io.confluent.connect.avro.AvroConverter",
      "key.converter.schema.registry.url": "http://houbiap5:8081",
      "value.converter": "io.confluent.connect.avro.AvroConverter",
      "value.converter.schema.registry.url": "http://houbiap5:8081",

      "connection.url": "http://houtestdb5:9200",

      "key.ignore": "true",
      "type.name": "kafka-connect"
      }


      }



      now when I registered elasticsearch connector , i got the following errors



      [oracle@houbiap5 dba]$ curl -s http://houbiap5:8083/connectors/mongo-es-sink/status |jq
      {
      "name": "mongo-es-sink",
      "connector": {
      "state": "RUNNING",
      "worker_id": "10.154.54.83:8083"
      },
      "tasks": [
      {
      "id": 0,
      "state": "FAILED",
      "worker_id": "10.154.54.83:8083",
      "trace": "org.apache.kafka.connect.errors.ConnectException: Tolerance exceeded in error handlerntat org.apache.kafka.connect.runtime.errors.RetryWithToleranceOperator.execAndHandleError(RetryWithToleranceOperator.java:178)ntat org.apache.kafka.connect.runtime.errors.RetryWithToleranceOperator.execute(RetryWithToleranceOperator.java:104)ntat org.apache.kafka.connect.runtime.WorkerSinkTask.convertAndTransformRecord(WorkerSinkTask.java:484)ntat org.apache.kafka.connect.runtime.WorkerSinkTask.convertMessages(WorkerSinkTask.java:464)ntat org.apache.kafka.connect.runtime.WorkerSinkTask.poll(WorkerSinkTask.java:320)ntat org.apache.kafka.connect.runtime.WorkerSinkTask.iteration(WorkerSinkTask.java:224)ntat org.apache.kafka.connect.runtime.WorkerSinkTask.execute(WorkerSinkTask.java:192)ntat org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:175)ntat org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:219)ntat java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)ntat java.util.concurrent.FutureTask.run(FutureTask.java:266)ntat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)ntat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)ntat java.lang.Thread.run(Thread.java:748)nCaused by: org.apache.kafka.connect.errors.DataException: Failed to deserialize data for topic customers to Avro: ntat io.confluent.connect.avro.AvroConverter.toConnectData(AvroConverter.java:107)ntat org.apache.kafka.connect.runtime.WorkerSinkTask.lambda$convertAndTransformRecord$0(WorkerSinkTask.java:484)ntat org.apache.kafka.connect.runtime.errors.RetryWithToleranceOperator.execAndRetry(RetryWithToleranceOperator.java:128)ntat org.apache.kafka.connect.runtime.errors.RetryWithToleranceOperator.execAndHandleError(RetryWithToleranceOperator.java:162)nt... 13 morenCaused by: org.apache.kafka.common.errors.SerializationException: Error deserializing Avro message for id -1nCaused by: org.apache.kafka.common.errors.SerializationException: Unknown magic byte!n"
      }
      ],
      "type": "sink"
      }



      Please help, thanks a lot!










      share|improve this question







      New contributor




      user1027177 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      source DB: mongodb 3.6
      kafka: confluent 5.12
      target: elastcisearch 7



      from mongodb to kafka, it is working well



      [oracle@houbiap5 confluent5]$ bin/kafka-console-consumer --bootstrap-server houbiap5:9092 --topic customers --from-beginning
      {"after":null,"patch":null,"source":{"version":"0.9.4.Final","connector":"mongodb","name":"mongodbTest","rs":"mongo01","ns":"inventory.customers","sec":1556119323,"ord":1,"h":1255747003695718904,"initsync":false},"op":"d","ts_ms":1556119323326}
      null
      {"after":null,"patch":null,"source":{"version":"0.9.4.Final","connector":"mongodb","name":"mongodbTest","rs":"mongo01","ns":"inventory.customers","sec":1556119323,"ord":2,"h":-3344312220964857180,"initsync":false},"op":"d","ts_ms":1556119323328}
      null
      {"after":null,"patch":null,"source":{"version":"0.9.4.Final","connector":"mongodb","name":"mongodbTest","rs":"mongo01","ns":"inventory.customers","sec":1556119323,"ord":3,"h":8650281562576212760,"initsync":false},"op":"d","ts_ms":1556119323328}
      null
      {"after":null,"patch":null,"source":{"version":"0.9.4.Final","connector":"mongodb","name":"mongodbTest","rs":"mongo01","ns":"inventory.customers","sec":1556119323,"ord":4,"h":7307862537196435761,"initsync":false},"op":"d","ts_ms":1556119323328}
      null
      {"after":null,"patch":null,"source":{"version":"0.9.4.Final","connector":"mongodb","name":"mongodbTest","rs":"mongo01","ns":"inventory.customers","sec":1556119323,"ord":5,"h":7141663475881294335,"initsync":false},"op":"d","ts_ms":1556119323328}
      null
      {"after":"{"_id" : {"$numberLong" : "1001"},"first_name" : "Sally","last_name" : "Thomas","email" : "sally.thomas@acme.com"}","patch":null,"source":{"version":"0.9.4.Final","connector":"mongodb","name":"mongodbTest","rs":"mongo01","ns":"inventory.customers","sec":1556119356,"ord":1,"h":-8203394498065317421,"initsync":false},"op":"c","ts_ms":1556119356396}
      {"after":"{"_id" : {"$numberLong" : "1002"},"first_name" : "George","last_name" : "Bailey","email" : "gbailey@foobar.com"}","patch":null,"source":{"version":"0.9.4.Final","connector":"mongodb","name":"mongodbTest","rs":"mongo01","ns":"inventory.customers","sec":1556119356,"ord":2,"h":-6732911301588244805,"initsync":false},"op":"c","ts_ms":1556119356396}
      {"after":"{"_id" : {"$numberLong" : "1003"},"first_name" : "Edward","last_name" : "Walker","email" : "ed@walker.com"}","patch":null,"source":{"version":"0.9.4.Final","connector":"mongodb","name":"mongodbTest","rs":"mongo01","ns":"inventory.customers","sec":1556119356,"ord":3,"h":5731956300969233689,"initsync":false},"op":"c","ts_ms":1556119356396}
      {"after":"{"_id" : {"$numberLong" : "1004"},"first_name" : "Anne","last_name" : "Kretchmar","email" : "annek@noanswer.org"}","patch":null,"source":{"version":"0.9.4.Final","connector":"mongodb","name":"mongodbTest","rs":"mongo01","ns":"inventory.customers","sec":1556119356,"ord":4,"h":3324121584721164025,"initsync":false},"op":"c","ts_ms":1556119356396}



      I am using avroConverter in mongo-source.json
      "key.converter": "io.confluent.connect.avro.AvroConverter",
      "key.converter.schema.registry.url": "http://houbiap5:8081",
      "value.converter": "io.confluent.connect.avro.AvroConverter",
      "value.converter.schema.registry.url": "http://houbiap5:8081",



      so the data should be AVRO format in kafka



      [oracle@houbiap5 dba]$ cat mongo-es-sink.json
      {
      "name": "mongo-es-sink",
      "config": {
      "connector.class": "io.confluent.connect.elasticsearch.ElasticsearchSinkConnector",
      "tasks.max": "1",
      "topics": "customers",



          "key.converter": "io.confluent.connect.avro.AvroConverter",
      "key.converter.schema.registry.url": "http://houbiap5:8081",
      "value.converter": "io.confluent.connect.avro.AvroConverter",
      "value.converter.schema.registry.url": "http://houbiap5:8081",

      "connection.url": "http://houtestdb5:9200",

      "key.ignore": "true",
      "type.name": "kafka-connect"
      }


      }



      now when I registered elasticsearch connector , i got the following errors



      [oracle@houbiap5 dba]$ curl -s http://houbiap5:8083/connectors/mongo-es-sink/status |jq
      {
      "name": "mongo-es-sink",
      "connector": {
      "state": "RUNNING",
      "worker_id": "10.154.54.83:8083"
      },
      "tasks": [
      {
      "id": 0,
      "state": "FAILED",
      "worker_id": "10.154.54.83:8083",
      "trace": "org.apache.kafka.connect.errors.ConnectException: Tolerance exceeded in error handlerntat org.apache.kafka.connect.runtime.errors.RetryWithToleranceOperator.execAndHandleError(RetryWithToleranceOperator.java:178)ntat org.apache.kafka.connect.runtime.errors.RetryWithToleranceOperator.execute(RetryWithToleranceOperator.java:104)ntat org.apache.kafka.connect.runtime.WorkerSinkTask.convertAndTransformRecord(WorkerSinkTask.java:484)ntat org.apache.kafka.connect.runtime.WorkerSinkTask.convertMessages(WorkerSinkTask.java:464)ntat org.apache.kafka.connect.runtime.WorkerSinkTask.poll(WorkerSinkTask.java:320)ntat org.apache.kafka.connect.runtime.WorkerSinkTask.iteration(WorkerSinkTask.java:224)ntat org.apache.kafka.connect.runtime.WorkerSinkTask.execute(WorkerSinkTask.java:192)ntat org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:175)ntat org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:219)ntat java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)ntat java.util.concurrent.FutureTask.run(FutureTask.java:266)ntat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)ntat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)ntat java.lang.Thread.run(Thread.java:748)nCaused by: org.apache.kafka.connect.errors.DataException: Failed to deserialize data for topic customers to Avro: ntat io.confluent.connect.avro.AvroConverter.toConnectData(AvroConverter.java:107)ntat org.apache.kafka.connect.runtime.WorkerSinkTask.lambda$convertAndTransformRecord$0(WorkerSinkTask.java:484)ntat org.apache.kafka.connect.runtime.errors.RetryWithToleranceOperator.execAndRetry(RetryWithToleranceOperator.java:128)ntat org.apache.kafka.connect.runtime.errors.RetryWithToleranceOperator.execAndHandleError(RetryWithToleranceOperator.java:162)nt... 13 morenCaused by: org.apache.kafka.common.errors.SerializationException: Error deserializing Avro message for id -1nCaused by: org.apache.kafka.common.errors.SerializationException: Unknown magic byte!n"
      }
      ],
      "type": "sink"
      }



      Please help, thanks a lot!







      python






      share|improve this question







      New contributor




      user1027177 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question







      New contributor




      user1027177 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question






      New contributor




      user1027177 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 23 hours ago









      user1027177user1027177

      1




      1




      New contributor




      user1027177 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      user1027177 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      user1027177 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          0






          active

          oldest

          votes












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "3"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });






          user1027177 is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1429222%2fplease-help-serialization-format-issue-from-kafka-to-elasticsearch%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          user1027177 is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          user1027177 is a new contributor. Be nice, and check out our Code of Conduct.













          user1027177 is a new contributor. Be nice, and check out our Code of Conduct.












          user1027177 is a new contributor. Be nice, and check out our Code of Conduct.
















          Thanks for contributing an answer to Super User!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1429222%2fplease-help-serialization-format-issue-from-kafka-to-elasticsearch%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          VNC viewer RFB protocol error: bad desktop size 0x0I Cannot Type the Key 'd' (lowercase) in VNC Viewer...

          Tribunal Administrativo e Fiscal de Mirandela Referências Menu de...

          looking for continuous Screen Capture for retroactivly reproducing errors, timeback machineRolling desktop...