SoulSong opened a new issue, #8619:
URL: https://github.com/apache/seatunnel/issues/8619

   ### Search before asking
   
   - [x] I had searched in the 
[issues](https://github.com/apache/seatunnel/issues?q=is%3Aissue+label%3A%22bug%22)
 and found no similar issues.
   
   
   ### What happened
   
   Read snapshot and increasement data from mongodb, then sink into kafka. 
Expect output message format as change stream realtime origin format.
   
   
   ### SeaTunnel Version
   
   2.3.9
   
   ### SeaTunnel Config
   
   ```conf
   env {
     # You can set engine configuration here
     parallelism = 1
     job.mode = "STREAMING"
     checkpoint.interval = 5000
   }
   
   source {
     MongoDB-CDC {
       plugin_output = "user_collection"
       hosts = "****"
       database = ["test"]
       collection = ["test.user_collection"]
       schema = {
             table = "test.user_collection"
             fields {
               "_id" : string,
               "name" : string,
               "age" : int,
               "favs" : "array<string>"
             }
           }
     }
   }
   
   # Console printing of the read Mongodb data
   sink {
     Console {
       plugin_input = "user_collection"
       parallelism = 1
     }
     kafka {
         plugin_input = "user_collection"
         topic = "mongo_cdc_user_collcection"
         bootstrap.servers = "***9092"
         format = json
         kafka.request.timeout.ms = 60000
         semantics = EXACTLY_ONCE
         partition = 0
         kafka.config = {
           acks = "all"
           request.timeout.ms = 60000
           buffer.memory = 33554432
         }
     }
   }
   ```
   
   ### Running Command
   
   ```shell
   ./bin/seatunnel.sh --config ./jobs/mongodb_cdc.conf -m local
   ```
   
   ### Error Exception
   
   ```log
   test two format settings:
   - format = json
   
   {
      "_id": "67a45c82fdcc30858659e163",
      "name": "Alice",
      "age": 16,
      "favs": null
   }
   
   - canal-json
   
   {
      "data": {
         "_id": "{\"_value\": {\"$numberInt\": \"1\"}}",
         "name": null,
         "age": 30,
         "favs": [
            "a",
            "b"
         ]
      },
      "type": "INSERT"
   }
   ```
   
   ### Zeta or Flink or Spark Version
   
   zeta
   
   ### Java or Scala Version
   
   java
   
   ### Screenshots
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to