在这个教程中,我们将展示如何使用基于Spring Integration的应用程序与PostgreSQL的_NOTIFY/LISTEN_特性。PostgreSQL提供了一种轻量级的消息通知机制,允许客户端使用常规数据库连接相互发送通知。这种机制使用两个非标准SQL语句,NOTIFY_和_LISTEN,因此得名。
我们将基于Spring Integration核心库和PostgreSQL JDBC驱动进行操作:
``<dependency>``
``<groupId>``org.springframework.integration``</groupId>``
``<artifactId>``spring-integration-core``</artifactId>``
``<version>``6.0.0``</version>``
``</dependency>``
``<dependency>``
``<groupId>``org.postgresql``</groupId>``
``<artifactId>``postgresql``</artifactId>``
``<version>``42.3.8``</version>``
``</dependency>``
大约 6 分钟