{"id":14519762,"url":"https://github.com/imrafaelmerino/vertx-mongo-effect","last_synced_at":"2026-04-30T11:36:02.873Z","repository":{"id":263684079,"uuid":"891155400","full_name":"imrafaelmerino/vertx-mongo-effect","owner":"imrafaelmerino","description":"Vertx-MongoDB-Effect enables interaction with MongoDB in a purely functional and reactive style, seamlessly integrating with Vertx-effect. This library requires familiarity with Vertx-effect, as both frameworks share a foundational reliance on immutability and persistent data structures provided by json-values. ","archived":false,"fork":false,"pushed_at":"2024-11-23T22:04:39.000Z","size":5360,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-22T21:00:01.141Z","etag":null,"topics":["functional-programming","javascript","json-values","mongodb","persistent-data-structure","reactive-programming","vertx","vertx-effect"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/imrafaelmerino.png","metadata":{"files":{"readme":"docs/README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-19T20:32:51.000Z","updated_at":"2024-11-23T22:04:42.000Z","dependencies_parsed_at":"2024-11-23T22:26:40.137Z","dependency_job_id":"e42c1a12-2c26-4478-b3ad-f509fb741c71","html_url":"https://github.com/imrafaelmerino/vertx-mongo-effect","commit_stats":{"total_commits":74,"total_committers":2,"mean_commits":37.0,"dds":0.05405405405405406,"last_synced_commit":"b90003ecde0c80ef394cd4d3d659af821de47056"},"previous_names":["imrafaelmerino/vertx-mongodb-effect","imrafaelmerino/vertx-mongo-effect"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/imrafaelmerino/vertx-mongo-effect","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imrafaelmerino%2Fvertx-mongo-effect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imrafaelmerino%2Fvertx-mongo-effect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imrafaelmerino%2Fvertx-mongo-effect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imrafaelmerino%2Fvertx-mongo-effect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imrafaelmerino","download_url":"https://codeload.github.com/imrafaelmerino/vertx-mongo-effect/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imrafaelmerino%2Fvertx-mongo-effect/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32463892,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T22:27:22.272Z","status":"online","status_checked_at":"2026-04-30T02:00:05.929Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["functional-programming","javascript","json-values","mongodb","persistent-data-structure","reactive-programming","vertx","vertx-effect"],"created_at":"2024-09-04T04:01:18.104Z","updated_at":"2026-04-30T11:36:02.857Z","avatar_url":"https://github.com/imrafaelmerino.png","language":"Java","funding_links":["https://www.buymeacoffee.com/imrafaelmerino"],"categories":["Database Clients"],"sub_categories":[],"readme":"\u003cimg src=\"./logo/package_twitter_swe2n4mg/black/full/coverphoto/black_logo_white_background.png\" alt=\"vertx-mongodb-effect\"/\u003e\n\n[![Buy Me a Coffee](https://img.shields.io/badge/Buy%20Me%20a%20Coffee-%E2%98%95%20Support-yellow)](https://www.buymeacoffee.com/imrafaelmerino)\n\n[![Maven](https://img.shields.io/maven-central/v/com.github.imrafaelmerino/vertx-mongodb-effect/3.0.0)](https://search.maven.org/artifact/com.github.imrafaelmerino/vertx-mongodb-effect/3.0.0/jar)\n\n- [Introduction](#introduction)\n- [Supported types](#types)\n- [Supported operations](#operations)\n- [Defining modules](#defmodules)\n- [Deploying modules](#depmodules)\n- [Publishing events](#events)\n- [Java Flight Recorder support](#jfr)\n- [Requirements](#requirements)\n- [Installation](#installation)\n- [Running Integration Test](#rit)\n\n\n\n## \u003ca name=\"introduction\"\u003e\u003ca/\u003e Introduction\n\n**vertx-mongodb-effect** allows us to work with **MongoDB** following a purely functional and reactive style.\nIt requires to be familiar with [vertx-effect](https://github.com/imrafaelmerino/vertx-effect). Both\n**vertx-effect** and **vertx-mongo-effect** use the immutable and persistent Json from \n[json-values](https://github.com/imrafaelmerino/json-values). **Jsons travel across the event bus, \nfrom verticle to verticle, back and forth, without being neither copied nor converted to BSON**.\nThe vertx codecs to send the Json from json-values to the event bus are in [vertx-values](https://github.com/imrafaelmerino/vertx-values),\nwhich is a dependency of vertx-effect. \n \n## \u003ca name=\"types\"\u003e\u003ca/\u003e Supported types\n**json-values** supports the standard Json types: string, number, null, object, array; \nThere are five number specializations: int, long, double, decimal, and BigInteger. \n**json-values adds support for instants and binary data**. It serializes Instants into \nits string representation according to ISO-8601, and the binary type into a string encoded in base 64. \n\n**vertx-mongodb-effect** uses [mongo-values](https://github.com/imrafaelmerino/mongo-values). \nIt abstracts the processes of encoding to BSON and decoding from BSON. \t\nPlease find below the BSON types supported and their equivalent types in json-values.\n\n```code    \n\nMap\u003cBsonType, Class\u003c?\u003e\u003e map = new HashMap\u003c\u003e();\nmap.put(BsonType.NULL, JsNull.class);\nmap.put(BsonType.ARRAY, JsArray.class);\nmap.put(BsonType.BINARY, JsBinary.class);\nmap.put(BsonType.BOOLEAN, JsBool.class);\nmap.put(BsonType.DATE_TIME, JsInstant.class);\nmap.put(BsonType.DOCUMENT, JsObj.class);\nmap.put(BsonType.DOUBLE, JsDouble.class);\nmap.put(BsonType.INT32, JsInt.class);\nmap.put(BsonType.INT64, JsLong.class);\nmap.put(BsonType.DECIMAL128, JsBigDec.class);\nmap.put(BsonType.STRING, JsStr.class);\n\n```\n\nWhen defining the mongodb settings, **you have to specify the codec registry _JsValuesRegistry_ from mongo-values**:\n\n```code\nimport com.mongodb.ConnectionString;\nimport com.mongodb.MongoClientSettings;\nimport mongovalues.JsValuesRegistry;\n\nMongoClientSettings  settings =\n             MongoClientSettings.builder()\n                                .applyConnectionString(connString)\n                                .codecRegistry(JsValuesRegistry.INSTANCE)\n                                .build();\n\n``` \n\n\n\n## \u003ca name=\"operations\"\u003e\u003ca/\u003e Supported operations \n**Every method of the MongoDB driver has an associated lambda**.  \n\nSince **vertx-mongodb-effect** uses the driver API directly, it can benefit from all its features and methods. \n**It's an advantage over the official vertx-mongodb-client**.\n\nPlease find below the types and constructors of the most essentials operations:\n\n**Count :: Lambdac\u003cJsObj, Long\u003e**\n\n```code\nimport com.mongodb.client.MongoCollection;\nimport com.mongodb.client.model.CountOptions;\n\npublic Count(Supplier\u003cMongoCollection\u003cJsObj\u003e\u003e collectionSupplier,\n             CountOptions options\n            )\n```\n\n**DeleteMany :: Lambdac\u003cJsObj, O\u003e**\n \n```code\nimport com.mongodb.client.MongoCollection;\nimport com.mongodb.client.model.DeleteOptions;\nimport com.mongodb.client.result.DeleteResult;\n\npublic DeleteMany(Supplier\u003cMongoCollection\u003cJsObj\u003e\u003e collectionSupplier,\n                  Function\u003cDeleteResult, O\u003e resultConverter,\n                  DeleteOptions options \n                 )\n                      \n```   \n    \n**DeleteOne :: Lambdac\u003cJsObj, O\u003e**\n    \n```code\nimport com.mongodb.client.MongoCollection;\nimport com.mongodb.client.model.DeleteOptions;\nimport com.mongodb.client.result.DeleteResult;\n\npublic DeleteOne(Supplier\u003cMongoCollection\u003cJsObj\u003e\u003e collectionSupplier,\n                 Function\u003cDeleteResult, O\u003e resultConverter,\n                 DeleteOptions options \n                )\n                      \n```\n\n**FindAll :: Lambdac\u003cFindMessage, JsArray\u003e**\n\n    \n```code\nimport com.mongodb.client.MongoCollection;\nimport com.mongodb.client.FindIterable;\n\npublic FindAll(Supplier\u003cMongoCollection\u003cJsObj\u003e\u003e collectionSupplier,\n               Function\u003cFindIterable\u003cJsObj\u003e, JsArray\u003e converter \n              )\n```    \n\n**FindOne :: Lambdac\u003cFindMessage, JsObj\u003e**\n    \n```code\nimport com.mongodb.client.MongoCollection;\nimport com.mongodb.client.FindIterable;\n\npublic FindOne(Supplier\u003cMongoCollection\u003cJsObj\u003e\u003e collectionSupplier,\n               Function\u003cFindIterable\u003cJsObj\u003e, JsObj\u003e converter \n              )                 \n```    \n\n**FindOneAndDelete :: Lambdac\u003cJsObj, JsObj\u003e**\n    \n```code\nimport com.mongodb.client.MongoCollection;\nimport com.mongodb.client.model.FindOneAndDeleteOptions;\n\npublic FindOneAndDelete(Supplier\u003cMongoCollection\u003cJsObj\u003e\u003e collectionSupplier,\n                        FindOneAndDeleteOptions options\n                       ) \n```   \n\n**FindOneAndReplace :: Lambdac\u003cUpdateMessage, JsObj\u003e**\n    \n```code\nimport com.mongodb.client.MongoCollection;\nimport com.mongodb.client.model.FindOneAndReplaceOptions;\n\npublic FindOneAndReplace(Supplier\u003cMongoCollection\u003cJsObj\u003e\u003e collectionSupplier,\n                         FindOneAndReplaceOptions options\n                        )   \n```    \n\n**FindOneAndUpdate :: Lambdac\u003cUpdateMessage, JsObj\u003e**\n\n```code\nimport com.mongodb.client.MongoCollection;\nimport com.mongodb.client.model.FindOneAndUpdateOptions;\n\npublic FindOneAndUpdate(Supplier\u003cMongoCollection\u003cJsObj\u003e\u003e collectionSupplier,\n                        FindOneAndUpdateOptions options\n                       )\n```    \n\n**InsertMany :: Lambdac\u003cJsArray, R\u003e**\n\n```code\nimport com.mongodb.client.MongoCollection;\nimport com.mongodb.client.result.InsertManyResult;\nimport com.mongodb.client.model.InsertManyOptions;\n\npublic InsertMany(Supplier\u003cMongoCollection\u003cJsObj\u003e\u003e collectionSupplier,\n                  Function\u003cInsertManyResult, R\u003e resultConverter,\n                  InsertManyOptions options\n                 )   \n```    \n\n**InsertOne :: Lambdac\u003cJsObj, R\u003e**\n\n```code\nimport com.mongodb.client.MongoCollection;\nimport com.mongodb.client.result.InsertOneResult;\nimport com.mongodb.client.model.InsertOneOptions;\n\npublic InsertOne(Supplier\u003cMongoCollection\u003cJsObj\u003e\u003e collectionSupplier,\n                 Function\u003cInsertOneResult, R\u003e resultConverter,\n                 InsertOneOptions options\n                )    \n```    \n\n**ReplaceOne :: Lambdac\u003cUpdateMessage, O\u003e**\n\n```code\nimport com.mongodb.client.MongoCollection;\nimport com.mongodb.client.result.UpdateResult;\nimport com.mongodb.client.model.ReplaceOptions;\n\npublic ReplaceOne(Supplier\u003cMongoCollection\u003cJsObj\u003e\u003e collectionSupplier,\n                  Function\u003cUpdateResult, O\u003e resultConverter,\n                  ReplaceOptions options\n                 )   \n```    \n**UpdateMany :: Lambdac\u003cUpdateMessage, O\u003e**\n\n```code\nimport com.mongodb.client.MongoCollection;\nimport com.mongodb.client.result.UpdateResult;\nimport com.mongodb.client.model.UpdateOptions\n\npublic UpdateMany(Supplier\u003cMongoCollection\u003cJsObj\u003e\u003e collectionSupplier,\n                  Function\u003cUpdateResult, O\u003e resultConverter,\n                  UpdateOptions options\n                 )\n```    \n\n**UpdateOne :: Lambdac\u003cUpdateMessage, O\u003e**\n\n```code\nimport com.mongodb.client.MongoCollection;\nimport com.mongodb.client.result.UpdateResult;\nimport com.mongodb.client.model.UpdateOptions\n\npublic UpdateOne(Supplier\u003cMongoCollection\u003cJsObj\u003e\u003e collectionSupplier,\n                 Function\u003cUpdateResult, O\u003e resultConverter,\n                 UpdateOptions options\n                )\n```    \n\n\n## \u003ca name=\"defmodules\"\u003e\u003ca/\u003e Defining modules\nLike with vertx-effect, [modules](https://vertx.effect.imrafaelmerino.dev/#modules) deploys\nverticles and expose lambdas to communicate with them.\nThe typical scenario is to create a module per collection. We can deploy or spawn verticles. \n\nThe following modules are just a couple of examples.\n\n\nWe create a module where all the lambdas make read operations and spawn verticles to reach a significant level of parallelization:\n\n```code\nimport vertx.mongodb.effect.MongoModule;\nimport vertx.effect.Lambdac;\nimport io.vertx.core.DeploymentOptions;\nimport io.vertx.core.ThreadingModel;\n\npublic class ReadModule extends MongoModule {\n\n    public MyCollectionModule(final Supplier\u003cMongoCollection\u003cJsObj\u003e\u003e collection) {\n        super(collection,\n              new DeploymentOptions().setThreadingModel(ThreadingModel.VIRTUAL_THREAD)\n             );\n    }\n\n    public static Lambdac\u003cFindMessage, Optional\u003cJsObj\u003e\u003e findOne;\n    public static Lambdac\u003cFindMessage, JsArray\u003e findAll;\n    public static Lambdac\u003cJsObj, Long\u003e count;\n    public static Lambdac\u003cJsArray, JsArray\u003e aggregate;\n\n    @Override\n    protected void deploy() {}  \n\n    @Override\n    protected void initialize() {\n        Lambdac\u003cFindMessage, JsObj\u003e findOneLambda = vertxRef.spawn(\"find_one\",\n                                                                   new FindOne(collection)\n                                                                  );\n        this.findOne = (context,message) -\u003e findOneLambda.apply(context,message)\n                                                         .map(Optional::ofNullable);\n        this.findAll = vertxRef.spawn(\"find_all\",\n                                      new FindAll(collection)\n                                     );\n        this.count = vertxRef.spawn(\"count\",\n                                    new Count(collection)\n                                   );\n\n        this.aggregate = vertxRef.spawn(\"aggregate\",\n                                        new Aggregate\u003c\u003e(collection,\n                                                        Converters.aggregateResult2JsArray\n                                                       )\n                                       );\n    }\n}\n```\n\nWe create a module where all the lambdas make delete, insert and update operations, and deploy only one\ninstance per verticle. \n\n\n```code\nimport vertx.mongodb.effect.MongoModule;\nimport vertx.effect.Lambdac;\n\npublic class MyCollectionModule extends MongoModule {\n\n    public MyCollectionModule(final Supplier\u003cMongoCollection\u003cJsObj\u003e\u003e collection) {\n        super(collection);\n    }\n\n    public static Lambdac\u003cJsObj, String\u003e insertOne;\n    public static Lambdac\u003cJsObj, JsObj\u003e deleteOne;\n    public static Lambdac\u003cUpdateMessage, JsObj\u003e replaceOne;\n    public static Lambdac\u003cUpdateMessage, JsObj\u003e updateOne;\n\n    @Override\n    protected void deploy() {\n        this.deploy(INSERT_ONE_ADDRESS,\n                    new InsertOne\u003c\u003e(collection,\n                                    Converters.insertOneResult2HexId\n                                   ),\n                   );\n        this.deploy(DELETE_ONE_ADDRESS,\n                    new DeleteOne\u003c\u003e(collection,\n                                    Converters.deleteResult2JsObj\n                                   )\n                   );\n\n        this.deploy(REPLACE_ONE_ADDRESS,\n                    new ReplaceOne\u003c\u003e(collection,\n                                     Converters.updateResult2JsObj\n                                    )\n                   );\n        this.deploy(UPDATE_ONE_ADDRESS,\n                    new UpdateOne\u003c\u003e(collection,\n                                    Converters.updateResult2JsObj\n                                   )\n                   );\n    }  \n\n    @Override\n    protected void initialize() {\n        this.insertOne = this.trace(INSERT_ONE_ADDRESS);\n        this.deleteOne = this.trace(DELETE_ONE_ADDRESS);\n        this.replaceOne = this.trace(REPLACE_ONE_ADDRESS);\n        this.updateOne = this.trace(UPDATE_ONE_ADDRESS);\n    }\n\n    private static final String DELETE_ONE_ADDRESS = \"delete_one\";   \n    private static final String UPDATE_ONE_ADDRESS = \"update_one\";\n    private static final String REPLACE_ONE_ADDRESS = \"replace_one\";\n    private static final String INSERT_ONE_ADDRESS = \"insert_one\";\n    private static final String INSERT_MANY_ADDRESS = \"insert_all\";\n    private static final String DELETE_MANY_ADDRESS = \"delete_all\";\n\n}\n\n``` \n## \u003ca name=\"depmodules\"\u003e\u003ca/\u003e Deploying modules \n\nThe verticles _RegisterMongoEffectCodecs_ and _RegisterJsValuesCodecs_ need to be deployed to register the vertx message codecs.\nRemember that you can't send any message to the event bus. If a message is not supported by Vertx you have to\ncreate a _MessageCodec_.\n\n\n```code\nimport com.mongodb.ConnectionString;\nimport com.mongodb.MongoClientSettings;\nimport vertx.mongodb.effect.MongoVertxClient;\nimport vertx.effect.VertxRef;\n\n// define every timeout if you wanna be reactive\nint connectTimeoutMS =  ???;\nint socketTimeoutMS = ???;\nint serverSelectionTimeoutMS = ???;\n\nString connectionUrl = \n     String.format(\"mongodb://localhost:27017/?connectTimeoutMS=%s\u0026socketTimeoutMS=%s\u0026serverSelectionTimeoutMS=%s\",\n                   connectTimeoutMS,\n                   socketTimeoutMS,\n                   serverSelectionTimeoutMS \n                  );\n \nConnectionString connString = new ConnectionString(connectionUrl);\n\nMongoClientSettings  settings =\n             MongoClientSettings.builder()\n                                .applyConnectionString(connString)\n                                .codecRegistry(JsValuesRegistry.INSTANCE)\n                                .build();\n\n// one vertx client per database connection \nMongoVertxClient mongoClient = new MongoVertxClient(settings);\n\nString database = ???;\nString collection = ???; \nMyCollectionModule collectionModule = \n          new MyCollectionModule(mongoClient.getCollection(database,\n                                                           collection\n                                                          )\n                                );\n\nVertxRef vertxRef = new VertxRef(vertx);\n\nQuadruple.sequential(vertxRef.deployVerticle(new RegisterJsValuesCodecs()),\n                     vertxRef.deployVerticle(new RegisterMongoEffectCodecs()),\n                     vertxRef.deployVerticle(mongoClient),\n                     vertxRef.deployVerticle(collectionModule)\n                     ) \n         .get();\n```\n\n\nOnce everything is up and running, enjoy your lambdas!\n\n```code\n\nBiFunction\u003cInteger,String,Val\u003cOptional\u003cJsObj\u003e\u003e\u003e findByCode = (attempts,code) -\u003e\n          MyCollectionModule.findOne\n                            .apply(FindMessage.ofFilter(JsObj.of(\"code\",\n                                                                 JsStr.of(code)\n                                                                )\n                                                        ) \n                                   )                    \n                            .retry(e -\u003e Failures.anyOf(MONGO_CONNECT_TIMEOUT_CODE,\n                                                       MONGO_READ_TIMEOUT_CODE\n                                                      ),\n                                   attempts\n                                  )\n                            .recoverWith(e -\u003e Val.succeed(Optional.empty()));\n```\n## \u003ca name=\"events\"\u003e\u003ca/\u003e Publishing events\n\nSince **vertx-effect** publishes the most critical events into the address **vertx-effect-events**, \nit' possible to register consumers to explode that information. You can disable this feature \nwith the Java system property **-Dpublish.events=false**. Thanks to Lambdac, it's possible to correlate\ndifferent events that belongs to the same transaction.\nGo to the [vertx-effect doc](https://vertx.effect.imrafaelmerino.dev/#events) for further details.\n\n## \u003ca name=\"jfr\"\u003e\u003ca/\u003e JFR support\nSince vertx-effect supports JFR, all the verticle messages have an associated event and can be visualized using\nJava Mission Control. \n\nFields of a verticle message event:\n\n    - address: Address of the Verticle where the message is sent to\n    - result: SUCCESS OR FAILURE, dependening on what the caller receives\n    - failure code: In case the failure is a ReplyException, it's the failure code\n    - failure type: In case the failure is a ReplyException, it's the failure type\n    - failure message: In case the failure is a ReplyException, it's the failure message\n    - exception class: In case the failure is not a ReplyException, it's the exception class name\n    - exception message: In case the failure is not a ReplyException, it's the exception message\n    - duration: time since the message is sent until the response is received\n\n## \u003ca name=\"requirements\"\u003e\u003ca/\u003e Requirements \n\n   -  Java 17 or greater\n   -  [vertx-effect](https://github.com/imrafaelmerino/vertx-effect)\n   -  [mongo driver sync](https://mongodb.github.io/mongo-java-driver/4.1/whats-new/)\n   -  [Mongo values](https://github.com/imrafaelmerino/mongo-values)\n\n## \u003ca name=\"installation\"\u003e\u003ca/\u003e Installation \n\nFor Java 17 or higher:\n\n\n```xml\n\n\u003cdependency\u003e\n   \u003cgroupId\u003ecom.github.imrafaelmerino\u003c/groupId\u003e\n   \u003cartifactId\u003evertx-mongodb-effect\u003c/artifactId\u003e\n   \u003cversion\u003e2.0.0\u003c/version\u003e\n\u003c/dependency\u003e\n\n```\n\nFor Java 21 or higher:\n\n```xml\n\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.github.imrafaelmerino\u003c/groupId\u003e\n  \u003cartifactId\u003evertx-mongodb-effect\u003c/artifactId\u003e\n  \u003cversion\u003e3.0.0\u003c/version\u003e\n\u003c/dependency\u003e\n\n```\n\n## \u003ca name=\"rit\"\u003e\u003ca/\u003e Running Integration Tests\n\nBefore executing the integration tests, ensure that a Mongo replica set is up and running.\n\n```shell\n\n#Edit this path to your particular case\nPROJECT_HOME=\"/Users/rmerino/Projects/vertx-mongodb-effect\"\n\nCONFIGURATION_FILE_PATH=\"${PROJECT_HOME}/src/test/resources/conf.yml\"\n\nif [ ! -f \"$CONFIGURATION_FILE_PATH\" ]; then\n    echo \"The configuration file ${CONFIGURATION_FILE_PATH} does not exist.\"\nfi\n\ndocker run -d -p 27017:27017 \\\n-v ${CONFIGURATION_FILE_PATH}:/etc/conf.yml \\\n--name mongo1 mongo --config \"/etc/conf.yml\"\n\ndocker run -d -p 27018:27017 \\\n-v ${CONFIGURATION_FILE_PATH}:/etc/conf.yml \\\n--name mongo2 mongo --config \"/etc/conf.yml\"\n\ndocker run -d -p 27019:27017 \\\n-v ${CONFIGURATION_FILE_PATH}:/etc/conf.yml \\\n--name mongo3 mongo --config \"/etc/conf.yml\" \n\n\n#let's configure the replica opening the Mongo console\ndocker exec -it mongo1 mongosh\n```\n\nand execute the following command, where 192.168.1.64 is my IP (don't use localhost):\n\n```javascript\nrs.initiate(\n       {\n         _id: \"rs0\",\n         members: [\n           { _id: 0, host: \"192.168.1.64:27017\" },\n           { _id: 1, host: \"192.168.1.64:27018\" },\n           { _id: 2, host: \"192.168.1.64:27019\" }\n         ]\n       }\n     )\n```\n\nOnce the Mongo replica set is up and running, you're ready to run the integration tests.\n\nTo run the tests, use one of the following Maven commands:\n\n- `mvn failsafe:integration-test` — To run integration tests only.\n- `mvn verify` — To run both unit and integration tests.\n\n---\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimrafaelmerino%2Fvertx-mongo-effect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimrafaelmerino%2Fvertx-mongo-effect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimrafaelmerino%2Fvertx-mongo-effect/lists"}