A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/vdsirotkin/pgmq-kotlin-jvm below:

vdsirotkin/pgmq-kotlin-jvm: A Kotlin client, based on pure JDBC, for Postgres Message Queue (PGMQ).

A Kotlin client, based on pure JDBC, for Postgres Message Queue (PGMQ).

This library currently supports following PGMQ API:

First of all - you need to set up PgmqConnectionFactory and PgmqSerializationProvider

You are free to implement it either way you wish :)

Example implementation for Spring, which acquires current connection inside of @Transactional method (may be useful if you need PGMQ to be transational):

@Bean
fun pgmqConnectionFactory(dataSource: DataSource) = PgmqConnectionFactory {
    DataSourceUtils.getConnection(dataSource)
} 

Please refer to Spring's DataSourceUtils docs for explanations

PgmqSerializationProvider

This library provides 2 implementations - GsonPgmqSerializationProvider and JacksonPgmqSerializationProvider

If you use some other serialization library - feel free to implement PgmqSerializationProvider interface, it's simple! :)

Next step should be defining PgmqConfiguration. You can also implement it either way you want.

Here's an example for Spring's Configuration Properties:

@ConfigurationProperties(prefix = "pgmq")
data class PgmqConfigurationProps(
    override val defaultVisibilityTimeout: java.time.Duration = 30.seconds.toJavaDuration()
) : PgmqConfiguration

If you have set up connection factory and serializer - you're free to build the client!

Here's complete example of Spring setup for PgmqClient - SpringPgmqApplication.kt.

Contributions are always welcomed!


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4