Each sender and receiver creates its own connection pool.
On /init endpoint client prepares the whole insert query because r2dbc does not support inserting many values in one insert. R2dbc batching will add each value with dedicated insert.
Spring DatabaseClient is used because native r2dbc does not support in condition clause. Additionally it simplifies transaction management and r2dbc usage. There is more recent version of spring-data-r2dbc project but it requires jdk-17 to work.
Implementation of PostgresMq client
Client uses r2dbc-postgres driver, implenetation of r2dbc-spi. SQL queries are executed using Spring
DatabaseClient
from spring-data-r2dbc project.Each sender and receiver creates its own connection pool.
On
/init
endpoint client prepares the whole insert query because r2dbc does not support inserting many values in one insert. R2dbc batching will add each value with dedicated insert.Spring
DatabaseClient
is used because native r2dbc does not supportin
condition clause. Additionally it simplifies transaction management and r2dbc usage. There is more recent version of spring-data-r2dbc project but it requires jdk-17 to work.Required fields in mqConfig section:
/init
endpoint:/sender
endpoint:/receiver
endpoint:/cleanup
endpoint:Full examples are in
postgreMq.http
file.