Skip to content

Conversation

@p14n
Copy link
Owner

@p14n p14n commented Sep 23, 2025

Summary by Sourcery

Prepare for v1.3.0 release by bumping module versions, adding Maven Central publishing configuration, improving documentation, and cleaning up Vert.x module code

Enhancements:

  • Refactor key fields to be final for better immutability
  • Extract event bus address prefixes into named constants
  • Apply minor whitespace and formatting cleanup across Vert.x adapters

Build:

  • Bump version to 1.3.0 in vertx, core, debezium, and grpc modules
  • Add and configure com.vanniktech.maven.publish plugin for publishing to Maven Central (Sonatype)

Documentation:

  • Add Javadoc to public Vert.x components (servers, consumers, codec, and adapters) and their constructors/methods for improved API documentation

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Sep 23, 2025

Reviewer's Guide

This PR prepares the v1.3.0 release by introducing extensive Javadoc documentation on public classes and methods, enforcing immutability and consistent constructor injection, applying uniform code formatting across Vert.x components, and updating Gradle build scripts to bump versions, add Maven publishing support, and refine POM metadata.

Class diagram for updated VertxConsumerServer and VertxPersistentConsumer

classDiagram
    class VertxConsumerServer {
        - DataSource ds
        - List<AutoCloseable> closeables
        - AsyncExecutor asyncExecutor
        - OpenTelemetry ot
        + VertxConsumerServer(DataSource ds, AsyncExecutor asyncExecutor, OpenTelemetry ot)
        + void start(EventBus eb, EventBusMessageBroker mb, Set<String> topics)
        + void close()
    }
    class VertxPersistentConsumer {
        - AsyncExecutor asyncExecutor
        - OpenTelemetry ot
        - int batchSize
        + VertxPersistentConsumer(OpenTelemetry ot, AsyncExecutor asyncExecutor, int batchSize)
        + void start(Set<String> topics, DataSource ds, EventBus eb, EventBusMessageBroker mb)
        + void close()
    }
    VertxConsumerServer --> AsyncExecutor
    VertxConsumerServer --> DataSource
    VertxConsumerServer --> OpenTelemetry
    VertxPersistentConsumer --> AsyncExecutor
    VertxPersistentConsumer --> OpenTelemetry
    VertxPersistentConsumer --> DataSource
Loading

Class diagram for updated EventBusCatchupService and EventCodec

classDiagram
    class EventBusCatchupService {
        + static String FETCH_EVENTS_ADDRESS
        + static String GET_LATEST_MESSAGE_ID_ADDRESS
        - CatchupServerInterface catchupServer
        - EventBus eventBus
        - Set<String> topics
        - AsyncExecutor executor
        + EventBusCatchupService(CatchupServerInterface catchupServer, EventBus eventBus, Set<String> topics, AsyncExecutor executor)
        + void start()
        + void close()
    }
    class EventCodec {
        + EventCodec()
        + void encodeToWire(Buffer buffer, Event event)
        + Event decodeFromWire(int pos, Buffer buffer)
    }
    EventBusCatchupService --> CatchupServerInterface
    EventBusCatchupService --> EventBus
    EventBusCatchupService --> AsyncExecutor
    EventCodec --> Event
Loading

Class diagram for updated EventBusMessageBroker

classDiagram
    class EventBusMessageBroker {
        - Map<String, List<MessageConsumer<Event>>> consumers
        + void subscribeToEventBus(String topic, MessageSubscriber<Event> subscriber)
        + void unsubscribe(String topic)
        + void close()
    }
    EventBusMessageBroker --> MessageConsumer
    EventBusMessageBroker --> MessageSubscriber
    EventBusMessageBroker --> Event
Loading

File-Level Changes

Change Details Files
Add Javadoc to public classes and methods for clearer API documentation
  • Documented class-level and method-level behavior in consumer server, persistent consumer, codec, and catchup service classes
  • Annotated constructor parameters and declared thrown exceptions on start methods
  • Explained serialization format and EventBus address prefixes in adapter classes
vertx/src/main/java/com/p14n/postevent/vertx/VertxConsumerServer.java
vertx/src/main/java/com/p14n/postevent/vertx/VertxPersistentConsumer.java
vertx/src/main/java/com/p14n/postevent/vertx/codec/EventCodec.java
vertx/src/main/java/com/p14n/postevent/vertx/adapter/EventBusCatchupService.java
vertx/src/main/java/com/p14n/postevent/vertx/adapter/EventBusMessageBroker.java
Enforce immutability and consistent constructor injection
  • Marked DataSource and AsyncExecutor fields as final in server and consumer implementations
  • Refactored initialization to rely exclusively on constructor parameters
  • Removed commented-out legacy declarations for cleaner code
vertx/src/main/java/com/p14n/postevent/vertx/VertxConsumerServer.java
vertx/src/main/java/com/p14n/postevent/vertx/VertxPersistentConsumer.java
Update build and publishing configuration for release
  • Bumped version from 1.2.0-SNAPSHOT to 1.3.0 across vertx, core, debezium, and grpc modules
  • Added and configured com.vanniktech.maven.publish plugin in vertx/build.gradle
  • Enhanced POM metadata: updated description, publishing coordinates, and signing settings
vertx/build.gradle
core/build.gradle
debezium/build.gradle
grpc/build.gradle

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there - I've reviewed your changes - here's some feedback:

  • Replace the System.out.println call with structured logging to keep output consistent and configurable.
  • Avoid swallowing exceptions in empty catch blocks during resource cleanup—at minimum log the exception to help diagnose potential shutdown issues.
  • Consider separating large formatting and Javadoc additions from functional changes into distinct commits or PRs to make reviews more focused and manageable.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Replace the System.out.println call with structured logging to keep output consistent and configurable.
- Avoid swallowing exceptions in empty catch blocks during resource cleanup—at minimum log the exception to help diagnose potential shutdown issues.
- Consider separating large formatting and Javadoc additions from functional changes into distinct commits or PRs to make reviews more focused and manageable.

## Individual Comments

### Comment 1
<location> `vertx/src/main/java/com/p14n/postevent/vertx/VertxConsumerServer.java:67` </location>
<code_context>
+        var catchupService = new EventBusCatchupService(catchupServer, eb, topics, this.asyncExecutor);

         closeables = List.of(catchupService, mb, asyncExecutor);
         System.out.println("🌐 Vert.x EventBus server started");
</code_context>

<issue_to_address>
**suggestion:** Replace System.out.println with structured logging.

Switch to logger.atInfo().log(...) for improved consistency and observability.

```suggestion
        logger.atInfo().log("🌐 Vert.x EventBus server started");
```
</issue_to_address>

### Comment 2
<location> `vertx/src/main/java/com/p14n/postevent/vertx/VertxConsumerServer.java:77` </location>
<code_context>
                 try {
                     c.close();
-                } catch (Exception e){
+                } catch (Exception e) {

                 }
</code_context>

<issue_to_address>
**issue (bug_risk):** Swallowing exceptions in close() may hide resource cleanup issues.

Logging exceptions in the catch block will help identify resource leaks and improve reliability.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

var catchupService = new EventBusCatchupService(catchupServer, eb, topics, this.asyncExecutor);

closeables = List.of(catchupService, mb, asyncExecutor);
System.out.println("🌐 Vert.x EventBus server started");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Replace System.out.println with structured logging.

Switch to logger.atInfo().log(...) for improved consistency and observability.

Suggested change
System.out.println("🌐 Vert.x EventBus server started");
logger.atInfo().log("🌐 Vert.x EventBus server started");

try {
c.close();
} catch (Exception e){
} catch (Exception e) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): Swallowing exceptions in close() may hide resource cleanup issues.

Logging exceptions in the catch block will help identify resource leaks and improve reliability.

@p14n p14n merged commit f35784f into main Sep 24, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants