commit cb2c34cf67ef46c8b6cb035faba9c9eeb822c04e Author: Iurii Mednikov Date: Sat Jan 10 21:09:35 2026 +0100 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c6a1705 --- /dev/null +++ b/.gitignore @@ -0,0 +1,37 @@ +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### IntelliJ IDEA ### +.idea/ +*.iws +*.iml +*.ipr + +### Eclipse ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ + +### Mac OS ### +.DS_Store + +*.env \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..b2c78b6 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025-2026 Iurii Mednikov + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..aec3934 --- /dev/null +++ b/pom.xml @@ -0,0 +1,82 @@ + + + 4.0.0 + + dev.mednikov.social.collector + social-collector + 0.1 + + + 24 + 24 + UTF-8 + 5.0.6 + 1.5.23 + + + + + Iurii Mednikov + iurii.mednikov@iu-study.org + + + + + + io.vertx + vertx-core + ${version.vertx} + + + io.vertx + vertx-config + ${version.vertx} + + + io.vertx + vertx-rabbitmq-client + ${version.vertx} + + + ch.qos.logback + logback-classic + ${version.logging} + + + + + + + org.apache.maven.plugins + maven-assembly-plugin + 3.8.0 + + + + jar-with-dependencies + + + + true + dev.mednikov.social.collector.ApplicationVerticle + + + + + + + make-assembly + package + + single + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/dev/mednikov/social/collector/ApplicationVerticle.java b/src/main/java/dev/mednikov/social/collector/ApplicationVerticle.java new file mode 100644 index 0000000..118fe2b --- /dev/null +++ b/src/main/java/dev/mednikov/social/collector/ApplicationVerticle.java @@ -0,0 +1,41 @@ +package dev.mednikov.social.collector; + +import io.vertx.config.ConfigRetriever; +import io.vertx.core.AbstractVerticle; +import io.vertx.core.Promise; +import io.vertx.core.Vertx; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public final class ApplicationVerticle extends AbstractVerticle { + + private final static Logger logger = LoggerFactory.getLogger(ApplicationVerticle.class); + + @Override + public void start(Promise startPromise) { + ConfigRetriever configRetriever = ConfigRetriever.create(vertx); + configRetriever.getConfig().onComplete(result -> { + if (result.succeeded()) { + logger.info("Application verticle was started"); + startPromise.complete(); + } else { + logger.error("Application verticle was unable to start"); + startPromise.fail(result.cause()); + } + }); + } + + public static void main(String[] args) { + Vertx vertx = Vertx.vertx(); + ApplicationVerticle applicationVerticle = new ApplicationVerticle(); + vertx.deployVerticle(applicationVerticle).onComplete(result -> { + if (result.succeeded()) { + logger.info("Application started"); + } else { + logger.error("Application failed to start", result.cause()); + vertx.undeploy(result.result()).onComplete(_ -> vertx.close()); + } + }); + } + +}