pglogrepl icon indicating copy to clipboard operation
pglogrepl copied to clipboard

pglogrepl_demo: how to handle with wal2json plugin output

Open dungnh-bpp opened this issue 4 years ago • 2 comments

So my questions is: I wanna use wal2json instead of pgoutput or test_decoding output plugin, how to determine clientXLogPos when application consume message succeess. In your pglogrepl_demo example: you 're using clientXLogPos = xld.WALStart + pglogrepl.LSN(len(xld.WALData)) with pgoutput plugin to determixe client xlogpos, right? If I use wal2json, how to determine that? Can you help me for this Thanks

dungnh-bpp avatar Aug 28 '21 02:08 dungnh-bpp

Using PrimaryKeepaliveMessage.

ubombi avatar Apr 06 '22 20:04 ubombi

Sorry for digging into an old issue. I cannot even run it with wal2json as the output plugin in the demo example.

It panics since the pglogrepl.Message is Unknown

panic: interface conversion: interface is nil, not pglogrepl.Message 

goroutine 1 [running]:
github.com/jackc/pglogrepl.Parse({0xc0000f401e, 0xa8, 0xa8})
        /Users/visi/go/pkg/mod/github.com/jackc/[email protected]/message.go:649 +0x2b9
main.main()
        /Users/visi/Sourcecontrol/github.com/viggy28/pgsavior/main.go:136 +0xdda

viggy28 avatar Apr 24 '23 14:04 viggy28