Sudharsan K
Sudharsan K

Reputation: 11

Unable to get the "before" Value in debezium with source as mongodb

I have a debezium set up with source as mongodb and sink as pub/sub. When an update event or the delete event happens I cant get the "before" Value. I am getting "null" in both the cases.

Here is my debezium config

debezium.sink.type=pubsub
debezium.sink.pubsub.project.id=<Project>
debezium.sink.pubsub.ordering.enabled=true
debezium.sink.pubsub.batch.delay.threshold.ms=100
debezium.sink.pubsub.batch.element.count.threshold=100
debezium.source.connector.class=io.debezium.connector.mongodb.MongoDbConnector
debezium.source.snapshot.mode=initial
debezium.source.poll.interval.ms=1000
debezium.source.errors.max.retries=3
debezium.source.tasks.max=100
debezium.source.mongodb.connection.string=<conn-string>
debezium.source.mongodb.user=debz
debezium.source.mongodb.password=pwd
debezium.source.database.include.list=dbname
debezium.source.topic.prefix=doc_stream
debezium.format.key=json
debezium.format.value=json
debezium.format.value.schemas.enable=false
quarkus.log.console.json=true
quarkus.log.file.enable=false
quarkus.log.level=INFO
debezium.source.offset.storage.file.filename=/tmp/offsets.dat

I am getting the following for Delete:

{"before":null,"after":null,"updateDescription":null,"source":{"version":"2.6.0.Final","connector":"mongodb","name":"doc_stream","ts_ms":1718005880000,"snapshot":"false","db":"snapmode","sequence":null,"ts_us":1718005880000000,"ts_ns":1718005880000000000,"collection":"snap","ord":65,"lsid":null,"txnNumber":null,"wallTime":null},"op":"d","ts_ms":1718005881283,"transaction":null}

For Update:

{"before":null,"after":"{\"_id\": {\"$oid\": \"6666ca08b584ad751da26a23\"},\"name\": \"firestore-demo\"}","updateDescription":{"removedFields":null,"updatedFields":"{\"name\": \"firestore-demo\"}","truncatedArrays":null},"source":{"version":"2.6.0.Final","connector":"mongodb","name":"doc_stream","ts_ms":1718012476000,"snapshot":"false","db":"snapmode","sequence":null,"ts_us":1718012476000000,"ts_ns":1718012476000000000,"collection":"snap","ord":1,"lsid":null,"txnNumber":null,"wallTime":null},"op":"u","ts_ms":1718012477442,"transaction":null}

Any Help will be appreciated :)

Upvotes: 1

Views: 86

Answers (0)

Related Questions