PostgreSQL and JMS (or another Pub-Sub / Callback mechanism)

I want my PostgreSQL server to send notifications when some of the data has changed, preferably over JMS, but also consider any other Pub-Sub or Callback mechanism.

Any ideas if possible?

Are there any Java add-in packages available that replicate this feature?

+3
source share
5 answers

EDIT: I was informed that PostgreSQL supports Java stored procedures. This means that the following approach becomes feasible:

, , , - , , . ; - SP, Java, , . , - imon , exec()... - .

+8

- LISTEN/NOTIFY, , , , , , , JMS, , , .

+3

Java- PostgreSQL. , , ? ( - ) , .

(1) " " JMS. timestamp .

(2) , . " ".

(3) unit test (1) (2), , , .

(4) , Java JDBC, , JMS- . , . , PreparedStatement .

(5) unit test (4), , .

(6) (6) JDBC-. , .

(7) .

(8) , Java- crontab script.

, /, . , , , , Java-. , , Java .

, PERL , Apache ActiveMQ, , , , .

: postgreSQL, .

.

+3

PL/Java Postgres , , , JMS . PL/Java + .

JMS , , , , Java-, " t - .

- JMS -, perl, python, , postgres. , JMS , -, .

+2

LISTEN/NOTIFY JDBC, , - HTTP LOCK "SELECT... FOR UPDATE" "SELECT... FOR SHARE" , .

, , , , , "SELECT... FOR UPDATE" , (java-), , (, 30 ), , , ( ?) , . "SELECT... FOR UPDATE" .

, , "... ", , "... ", . , .

Hopefully PostgreSQL will host the parties honestly, so there is no risk of blocking the message reader group in real time.

0
source

Source: https://habr.com/ru/post/1723474/


All Articles