diff --git a/core/build.gradle b/core/build.gradle index ed92d21..f8ebc25 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -9,7 +9,7 @@ compileJava { } group = 'com.p14n' -version = '1.2.0-SNAPSHOT' +version = '1.2.0' repositories { mavenCentral() diff --git a/debezium/build.gradle b/debezium/build.gradle index 0c0d708..ace4429 100644 --- a/debezium/build.gradle +++ b/debezium/build.gradle @@ -9,7 +9,7 @@ compileJava { } group = 'com.p14n' -version = '1.2.0-SNAPSHOT' +version = '1.2.0' repositories { mavenCentral() diff --git a/grpc/build.gradle b/grpc/build.gradle index c5fa77f..dd099c3 100644 --- a/grpc/build.gradle +++ b/grpc/build.gradle @@ -15,7 +15,7 @@ compileJava { } group = 'com.p14n' -version = '1.2.0-SNAPSHOT' +version = '1.2.0' repositories { mavenCentral() diff --git a/vertx/build.gradle b/vertx/build.gradle index 88b247a..63e7b92 100644 --- a/vertx/build.gradle +++ b/vertx/build.gradle @@ -1,6 +1,12 @@ + +import com.vanniktech.maven.publish.SonatypeHost +import com.vanniktech.maven.publish.JavaLibrary +import com.vanniktech.maven.publish.JavadocJar + plugins { id 'java' id 'com.adarshr.test-logger' version '4.0.0' + id "com.vanniktech.maven.publish" version "0.31.0" } compileJava { @@ -9,7 +15,7 @@ compileJava { } group = 'com.p14n' -version = '1.2.0-SNAPSHOT' +version = '1.2.0' repositories { mavenCentral() @@ -80,18 +86,17 @@ tasks.withType(Jar) { } mavenPublishing { - + configure(new JavaLibrary(new JavadocJar.Javadoc(), true)) publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL, true) - signAllPublications() coordinates("com.p14n", "postevent-vertx", version) - + pom { name = "Postevent Vert.x" - description = 'A reliable event publishing and consumption system using PostgreSQL and vert.x' + description = 'A reliable event publishing and consumption system using PostgreSQL and Vert.x EventBus' inceptionYear = "2025" url = "https://github.com/p14n/postevent/" licenses { @@ -113,4 +118,4 @@ mavenPublishing { url = 'https://github.com/p14n/postevent' } } -} \ No newline at end of file +} diff --git a/vertx/src/main/java/com/p14n/postevent/vertx/VertxConsumerServer.java b/vertx/src/main/java/com/p14n/postevent/vertx/VertxConsumerServer.java index 7740aac..53a64e5 100644 --- a/vertx/src/main/java/com/p14n/postevent/vertx/VertxConsumerServer.java +++ b/vertx/src/main/java/com/p14n/postevent/vertx/VertxConsumerServer.java @@ -15,28 +15,53 @@ import java.util.List; import java.util.Set; +/** + * Vert.x-based consumer server that provides event consumption capabilities + * using the EventBus for communication and coordination. + * + *
+ * This server sets up the necessary infrastructure for event processing + * including database setup, message brokers, and catchup services. + *
+ */ public class VertxConsumerServer implements AutoCloseable { private static final Logger logger = LoggerFactory.getLogger(VertxConsumerServer.class); - private DataSource ds; - //private ConfigData cfg; + private final DataSource ds; private List+ * This consumer handles persistent event processing with transactional + * guarantees + * and integrates with the Vert.x EventBus for distributed coordination. + *
+ */ public class VertxPersistentConsumer implements AutoCloseable, MessageBroker
* Example usage:
@@ -53,7 +52,10 @@
public class EventBusCatchupService implements AutoCloseable {
private static final Logger logger = LoggerFactory.getLogger(EventBusCatchupService.class);
+ /** EventBus address prefix for fetch events requests. */
public static final String FETCH_EVENTS_ADDRESS = "catchup.fetch_events.";
+
+ /** EventBus address prefix for get latest message ID requests. */
public static final String GET_LATEST_MESSAGE_ID_ADDRESS = "catchup.get_latest.";
private final CatchupServerInterface catchupServer;
@@ -68,11 +70,13 @@ public class EventBusCatchupService implements AutoCloseable {
*
* @param catchupServer The underlying catchup server implementation
* @param eventBus The Vert.x EventBus to use for messaging
+ * @param topics The set of topics to handle catchup requests for
+ * @param executor The async executor for handling requests
*/
public EventBusCatchupService(CatchupServerInterface catchupServer,
- EventBus eventBus,
- Set
* Subscribers receive events from the EventBus, providing low-latency
@@ -187,8 +186,8 @@ public void subscribeToEventBus(String topic, MessageSubscriber
* The codec uses JSON serialization for simplicity and debugging ease.
- * Events are encoded as JSON strings with a length prefix for efficient parsing.
+ * Events are encoded as JSON strings with a length prefix for efficient
+ * parsing.
*
@@ -24,6 +25,14 @@
*/
public class EventCodec implements MessageCodec