如何使用 Apache Camel 接收 PostgreSQL LISTEN/NOTIFY? [英] How to receive PostgreSQL LISTEN/NOTIFY with Apache Camel?
问题描述
我有一个 PostgreSQL 数据库,当插入表中的行时,它会触发 NOTIFY mychannel
.
I have a PostgreSQL database that fires a NOTIFY mychannel
when rows in a table are inserted.
我想使用 Apache Camel 将此信息发送给各种来源(Twitter 等).
I would like to send this info out to a variety of sources (Twitter, etc) using Apache Camel.
我知道可以使用 JDBC 并调用 LISTEN mychannel
来接收这些通知,但可能需要使用轮询.
I understand that one can use JDBC and call LISTEN mychannel
to receive those notifications, but may need to use polling.
我对 Camel 很陌生,所以不确定从哪里开始.这是我会用 SQL、JDBC 或轮询消费者连接器做的事情吗?
I'm pretty new to Camel, so not sure where to start. Is this something I would do with the SQL, JDBC, or Polling Consumer connectors?
在 Camel 中是否有内置方法可以有效地执行此操作?
Is there a built-in method to do this in Camel efficiently?
推荐答案
用更新的答案更新这个问题.这个骆驼组件已经创建:
Updating this question with a more recent answer. This camel component has been created:
http://camel.apache.org/pgevent.html
这篇关于如何使用 Apache Camel 接收 PostgreSQL LISTEN/NOTIFY?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!