You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The underlying Java library supports LISTEN, and you can access it directly as the object returned by open-db is a Listenable.
However, this hasn't added to the clojure driver (or documented) as the LISTEN/NOTIFY support is not yet reliable in the sense that if the connection is broken/closed due to e.g. a network glitch, the listening stops. The listener has no reliable way of detecting this and resubscribing so the events stop flowing.
The current horrible workaround would be to create a pool with a single connection only, checking out that connection, adding a listener and then running healthchecks on the connection.
@alaisi Haha, I ended up discovering all that the hard way :) Ended up creating a dedicated LISTEN service that uses psycopg2 as it has more mature support for this feature and it replicates the PG mutations onto a Kafka topic which my Clojure service then consumes from. A bit of a wild work-around for the moment but my attempts to create a reliable LISTEN/NOTIFY setup using Java/Clojure proved fruitless. Anyway, appreciate you taking the time to confirm your experience and I look forward to future support. Thanks again.
Is it possible to
execute!
aLISTEN
statement and have the callback be invoked asynchronously for new values? Or anyway of doing this?Nice work by the way. Works well for everything else I'm doing.
The text was updated successfully, but these errors were encountered: