davyam edited a comment on pull request #4065:
URL: https://github.com/apache/nifi/pull/4065#issuecomment-671375800
> > > > With the replacement from JSON Simple to Jackson, the output
(content) changed too.
> > > > Example:
> > > > ```
> > > > {
> > > > "tupleData" : {
> > > > "codigo" : 4,
> > > > "nome" : "CDC",
> > > > "data_fund" : "1929-10-19"
> > > > },
> > > > "relationName" : "public.cidade",
> > > > "type" : "insert"
> > > > }
> > > > ```
> > >
> > >
> > > @davyam could you please possibly explain how to use Jackson JSON
format for a CDC event? Or maybe it is documented somewhere.
> > > Thanks!
> >
> >
> > > > With the replacement from JSON Simple to Jackson, the output
(content) changed too.
> > > > Example:
> > > > ```
> > > > {
> > > > "tupleData" : {
> > > > "codigo" : 4,
> > > > "nome" : "CDC",
> > > > "data_fund" : "1929-10-19"
> > > > },
> > > > "relationName" : "public.cidade",
> > > > "type" : "insert"
> > > > }
> > > > ```
> > >
> > >
> > > @davyam could you please possibly explain how to use Jackson JSON
format for a CDC event? Or maybe it is documented somewhere.
> > > Thanks!
> >
> >
> > @energy2522 if I understood your question, you are asking for more
detail about the CDC event that is returned in flowfile content in JSON type.
> > So, for each row in an event (INSERT, UPDATE, DELETE) we have a JSON in
this format:
> > ```
> > {
> > "tupleData" : { _JSON object with all of the fields and their values_
},
> > "relationName" : _Table's name_,
> > "type" : _Event type (INSERT, UPDATE, DELTE, BEGIN*, COMMIT*)_
> > }
> > ```
> >
> >
> > *BEGIN and COMMIT events are included if the "Include Begin/Commit
Events" property are checked.
> > More info here: [https://github.com/davyam/pgEasyReplication](url)
>
> @davyam I tried to use this processor in my local task. For now the
processor returns flowFiles with content in such JSON format
{"insert":{"cidade":{"codigo":4,"nome":"New York","data_fund":"2020-02-24"}}}
>
> But, as you wrote after replacement from JSON Simple to Jackson it should
be in another format. So, my question is should I somehow configure this
processor to get output in Jackson format?
>
> Thanks!
You are using the old version.
To build the last version of this NiFi processor follow these steps:
```
### Download repo
git clone https://github.com/gerdansantos/nifi.git
cd nifi
### Export MAVEN options
export MAVEN_OPTS="-Xms1024m -Xmx3076m -XX:MaxPermSize=256m"
### Export JAVA_HOME
# On MacOS
export JAVA_HOME=$(/usr/libexec/java_home)
# On Linux
# export JAVA_HOME=/usr/jdk64/jdk1.8.0_112
### Build bundle
cd nifi-nar-bundles/nifi-cdc/nifi-cdc-postgresql-bundle
# You can omit the -Pinclude-grpc if you're not on a platform that it
supports. Include -DskipTests to compile tests, but skip running them.
mvn -T C2.0 clean install -Pinclude-grpc -DskipTests
### Move NAR to NiFi libs dir
cp
nifi-cdc-postgresql-nar/target/nifi-cdc-postgresql-nar-1.12.0-SNAPSHOT.nar
/Users/davyam/Documents/PROGRAMS/nifi-1.12.0-SNAPSHOT/lib/
### Check processor in NiFi Canvas
cd /Users/davyam/Documents/PROGRAMS/nifi-1.12.0-SNAPSHOT
sh bin/nifi.sh run
# Wait a few minutes to access http page
http://localhost:8080/nifi/
# CNTRL+C to shuts down NiFi
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]