How can I monitor pg_notify data?

679 Views Asked by At

I am handling the application which use pg_notify to capture any data based on event insert, update, and delete. The problem is some of data were not synced properly. Now with this regard, I would like to monitor every single data notified by pg_notify function to ensure that it is successfully sent to client/subscriber who listen. The reason is I would like to point out the failure point is not caused by pg_notify which means it is the application who can't process the data accordingly or some other factors. Is it possible to do the monitoring ?

1

There are 1 best solutions below

2
Laurenz Albe On

Sure, no problem. Write a process that listens on all available channels and writes every notification it gets into a log file. Then you know which notifications were sent. If any client did not react to an event, the client was either not connected at the time or ignored the message.