-
Notifications
You must be signed in to change notification settings - Fork 1
Vertx #54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Vertx #54
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
28f9e5a
Augment - create vertx submodule
p14n 3979e34
Create new example
p14n d70f5ee
Vertx example working
p14n 295cc62
Implement Autoclosable on new classes
p14n 51ac039
Don't block the event loop
p14n 9883ccd
Refactor dependencies
p14n 1075f31
Upgrade to vertx 5
p14n c97c920
Update core/src/main/java/com/p14n/postevent/db/DatabaseSetup.java
p14n ed6189a
Review feedback
p14n File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,178 @@ | ||
| 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.google.protobuf' version '0.9.2' | ||
| id "com.vanniktech.maven.publish" version "0.31.0" | ||
| } | ||
|
|
||
| compileJava { | ||
| sourceCompatibility = 21 | ||
| targetCompatibility = 21 | ||
| } | ||
|
|
||
| group = 'com.p14n' | ||
| version = '1.0.1-SNAPSHOT' | ||
|
|
||
| repositories { | ||
| mavenCentral() | ||
| } | ||
|
|
||
| dependencies { | ||
| implementation 'io.debezium:debezium-api:3.0.1.Final' | ||
| implementation ('io.debezium:debezium-embedded:3.0.1.Final') { | ||
| exclude group: 'org.glassfish.jersey.containers', module: 'jersey-container-servlet' | ||
| exclude group: 'org.glassfish.jersey.inject', module: 'jersey-hk2' | ||
| exclude group: 'org.eclipse.jetty' | ||
| } | ||
| implementation 'io.debezium:debezium-connector-postgres:3.0.1.Final' | ||
| implementation 'io.debezium:debezium-storage-jdbc:3.0.1.Final' | ||
| implementation 'org.slf4j:slf4j-api:2.0.9' | ||
| implementation 'com.zaxxer:HikariCP:6.2.1' | ||
|
|
||
| constraints { | ||
| implementation 'com.google.guava:guava:32.0.0-jre' | ||
| } | ||
|
|
||
| // gRPC dependencies | ||
| implementation 'io.grpc:grpc-netty-shaded:1.53.0' | ||
| implementation 'io.grpc:grpc-protobuf:1.53.0' | ||
| implementation 'io.grpc:grpc-stub:1.53.0' | ||
| implementation 'io.grpc:grpc-api:1.53.0' | ||
|
|
||
| implementation 'javax.annotation:javax.annotation-api:1.3.2' | ||
|
|
||
| // For code generation | ||
| implementation 'com.google.protobuf:protobuf-java:3.21.7' | ||
|
|
||
| testImplementation platform('io.zonky.test.postgres:embedded-postgres-binaries-bom:16.2.0') | ||
| testImplementation 'io.zonky.test:embedded-postgres:2.0.7' | ||
| testImplementation 'net.jqwik:jqwik:1.8.2' | ||
| testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.0' | ||
| testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.0' | ||
| testRuntimeOnly 'ch.qos.logback:logback-classic:1.4.11' | ||
| testImplementation 'org.mockito:mockito-core:3.12.4' | ||
|
|
||
| // OpenTelemetry core dependencies | ||
| implementation 'io.opentelemetry:opentelemetry-api:1.32.0' | ||
|
|
||
| // Instrumentation for GRPC | ||
| implementation 'io.opentelemetry.instrumentation:opentelemetry-grpc-1.6:1.32.0-alpha' | ||
|
|
||
| } | ||
|
|
||
| testlogger { | ||
| theme 'standard' | ||
| showExceptions true | ||
| showStackTraces true | ||
| showFullStackTraces false | ||
| showCauses true | ||
| slowThreshold 2000 | ||
| showSummary true | ||
| showSimpleNames false | ||
| showPassed true | ||
| showSkipped true | ||
| showFailed true | ||
| showStandardStreams false | ||
| showPassedStandardStreams true | ||
| showSkippedStandardStreams true | ||
| showFailedStandardStreams true | ||
| } | ||
|
|
||
| test { | ||
| useJUnitPlatform { | ||
| includeEngines 'jqwik', 'junit-jupiter' | ||
| } | ||
| maxHeapSize = "1G" | ||
| minHeapSize = "512M" | ||
| maxParallelForks = 1 | ||
| failFast = true | ||
| testLogging.showStandardStreams = true | ||
| } | ||
|
|
||
| task fastTest( type: Test ) { | ||
| useJUnitPlatform { | ||
| includeEngines 'junit-jupiter' | ||
| exclude '**/dst/**' | ||
|
|
||
| } | ||
| } | ||
|
|
||
| jar { | ||
| manifest { | ||
| } | ||
| } | ||
|
|
||
| // Configure Protobuf plugin | ||
| protobuf { | ||
| protoc { | ||
| artifact = 'com.google.protobuf:protoc:3.21.7' | ||
| } | ||
| plugins { | ||
| grpc { | ||
| artifact = 'io.grpc:protoc-gen-grpc-java:1.53.0' | ||
| } | ||
| } | ||
| generateProtoTasks { | ||
| all()*.plugins { | ||
| grpc {} | ||
| } | ||
| } | ||
| } | ||
|
|
||
| sourceSets { | ||
| main { | ||
| java { | ||
| srcDirs 'build/generated/source/proto/main/grpc' | ||
| srcDirs 'build/generated/source/proto/main/java' | ||
| } | ||
| } | ||
| } | ||
|
|
||
| tasks.withType(Jar) { | ||
| duplicatesStrategy = DuplicatesStrategy.EXCLUDE | ||
| } | ||
|
|
||
| javadoc { | ||
| exclude "**/grpc/**" | ||
| source = sourceSets.main.allJava | ||
| } | ||
|
|
||
| mavenPublishing { | ||
|
|
||
| configure(new JavaLibrary(new JavadocJar.Javadoc(), true)) | ||
|
|
||
| publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL, true) | ||
|
|
||
| signAllPublications() | ||
|
|
||
| coordinates("com.p14n", "postevent", version) | ||
|
|
||
| pom { | ||
| name = "Postevent" | ||
| description = 'A reliable event publishing and consumption system using PostgreSQL and gRPC' | ||
| inceptionYear = "2025" | ||
| url = "https://github.com/p14n/postevent/" | ||
| licenses { | ||
| license { | ||
| name = 'MIT License' | ||
| url = 'https://opensource.org/licenses/MIT' | ||
| } | ||
| } | ||
| developers { | ||
| developer { | ||
| id = 'p14n' | ||
| name = 'Dean Chapman' | ||
| email = 'dean@p14n.com' | ||
| } | ||
| } | ||
| scm { | ||
| connection = 'scm:git:git://github.com/p14n/postevent.git' | ||
| developerConnection = 'scm:git:ssh://github.com:p14n/postevent.git' | ||
| url = 'https://github.com/p14n/postevent' | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (complexity): Consider refactoring to centralize schema creation and unify constructors to eliminate duplication and null-checks.
Here are two small refactorings that will remove the duplication and the “null-check” complexity without changing any public API or behavior:
setupAll) so thatsetupClient/setupServerno longer need to each callcreateSchemaIfNotExists().DataSource(and drop the JDBC fields + null‐check ingetConnection()):This way you:
createSchemaIfNotExists()exactly once.if(ds!=null)…branch.