Uploaded image for project: 'Debezium'
  1. Debezium
  2. DBZ-4457

JSON Payload not expanding when enabling it

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • 1.9.0.Alpha1
    • 1.7.0.Final
    • outbox
    • None
    • False
    • False
    • Hide

      The only change that was made was in the register-postgres.json file to enable the json expan functionality:

      {
        "connector.class": "io.debezium.connector.postgresql.PostgresConnector",
        "tasks.max": "1",
        "database.hostname": "service-db",
        "database.port": "5432",
        "database.user": "servicedb",
        "database.password": "servicedb",
        "database.dbname" : "servicedb",
        "database.server.name": "servicedb",
        "schema.include.list": "public",
        "table.include.list" : "public.outbox",
        "tombstones.on.delete" : "false",
        "transforms" : "outbox",
        "transforms.outbox.type" : "io.debezium.transforms.outbox.EventRouter",
        "transforms.outbox.table.expand.json.payload": "true",
        "transforms.outbox.route.topic.replacement" : "${routedByValue}.events"
      } 

       

      Show
      The only change that was made was in the register-postgres.json file to enable the json expan functionality: { "connector.class" : "io.debezium.connector.postgresql.PostgresConnector" , "tasks.max" : "1" , "database.hostname" : "service-db" , "database.port" : "5432" , "database.user" : "servicedb" , "database.password" : "servicedb" , "database.dbname" : "servicedb" , "database.server.name" : "servicedb" , "schema.include.list" : " public " , "table.include.list" : " public .outbox" , "tombstones.on.delete" : " false " , "transforms" : "outbox" , "transforms.outbox.type" : "io.debezium.transforms.outbox.EventRouter" , "transforms.outbox.table.expand.json.payload" : " true " , "transforms.outbox.route.topic.replacement" : "${routedByValue}.events" }  

      After enabling the json payload expanding in the register-postgres.json file via 

      { ..., "transforms.outbox.table.expand.json.payload": "true", ... }

      and running the outbox demo, the json event payload is still escaped when reading from the kafka stream:

      {
        "key": "1",
        "headers": "id=a019508e-9d3c-411e-bdbb-2196be2a03cb,eventType=OrderCreated,uber-trace-id=ca106f691b4a9925:ca106f691b4a9925:0:1"
      }
      "{\"id\":1,\"customerId\":123,\"orderDate\":\"2019-01-31T12:13:01\",\"lineItems\":[{\"id\":1,\"item\":\"Debezium in Action\",\"quantity\":2,\"totalPrice\":39.98,\"status\":\"ENTERED\"},{\"id\":2,\"item\":\"Debezium for Dummies\",\"quantity\":1,\"totalPrice\":29.99,\"status\":\"ENTERED\"}]}" 

              ccranfor@redhat.com Chris Cranford
              mail@simonbuettner.de Simon Buettner (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: