سؤال

I have a PostgreSQL database that fires a NOTIFY mychannel when rows in a table are inserted.

I would like to send this info out to a variety of sources (Twitter, etc) using Apache Camel.

I understand that one can use JDBC and call LISTEN mychannel to receive those notifications, but may need to use polling.

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?

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

نصائح أخرى

Use the pgjdbc-ng driver. It supports async notifications without polling.

Write a Camel Component to use it. See the Guava Eventbus Component source code for inspiration.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top