// Do not edit directly!
// This file was generated by camel-quarkus-maven-plugin:update-extension-doc-page
[id="extensions-pgevent"]
= PostgresSQL Event
:linkattrs:
:cq-artifact-id: camel-quarkus-pgevent
:cq-native-supported: true
:cq-status: Stable
:cq-status-deprecation: Stable
:cq-description: Send and receive PostgreSQL events via LISTEN and NOTIFY commands.
:cq-deprecated: false
:cq-jvm-since: 1.1.0
:cq-native-since: 1.2.0

ifeval::[{doc-show-badges} == true]
[.badges]
[.badge-key]##JVM since##[.badge-supported]##1.1.0## [.badge-key]##Native since##[.badge-supported]##1.2.0##
endif::[]

Send and receive PostgreSQL events via LISTEN and NOTIFY commands.

[id="extensions-pgevent-whats-inside"]
== What's inside

* xref:{cq-camel-components}::pgevent-component.adoc[PostgresSQL Event component], URI syntax: `pgevent:host:port/database/channel`

Please refer to the above link for usage and configuration details.

[id="extensions-pgevent-maven-coordinates"]
== Maven coordinates

https://{link-quarkus-code-generator}/?extension-search=camel-quarkus-pgevent[Create a new project with this extension on {link-quarkus-code-generator}, window="_blank"]

Or add the coordinates to your existing project:

[source,xml]
----
<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-pgevent</artifactId>
</dependency>
----
ifeval::[{doc-show-user-guide-link} == true]
Check the xref:user-guide/index.adoc[User guide] for more information about writing Camel Quarkus applications.
endif::[]

[id="extensions-pgevent-additional-camel-quarkus-configuration"]
== Additional Camel Quarkus configuration

You can use pgevent extension with Agroal Datasource.

Add the quarkus-agroal dependency :
[source,xml]
------------------------------------------------------------
<dependency>
    <groupId>io.quarkus</groupId>
    <artifactId>quarkus-agroal</artifactId>
</dependency>
------------------------------------------------------------

Set Agroal properties, example for named DataSource `pgDatasource` :
-----------
quarkus.datasource.pgDatasource.db-kind=pgsql
quarkus.datasource.pgDatasource.jdbc.url=jdbc:pgsql://localhost:5432/myDB
quarkus.datasource.pgDatasource.username=postgres
quarkus.datasource.pgDatasource.password=mysecretpassword
quarkus.datasource.pgDatasource.jdbc.max-size=16
-----------

Inject the DataSource name in the camel Route, example :
-----------
pgevent:///postgres/testchannel?datasource=#pgDatasource
-----------

