Skip to content

Latest commit

 

History

History
171 lines (133 loc) · 5.99 KB

devnotes.adoc

File metadata and controls

171 lines (133 loc) · 5.99 KB

Development Notes

Verapi ®™

JDBC URL içinde db şema verilmesi

java code sample;

JsonObject jdbcClientConfig = new JsonObject()
                .put("url", "jdbc:postgresql://192.168.10.40:5432/abyssportal?currentSchema=portalschema")}

You can set the default search_path at the database level:

ALTER DATABASE <database_name> SET search_path TO schema1,schema2;

Or at the user or role level:

ALTER ROLE <role_name> SET search_path TO schema1,schema2;

Or add parameter to connection URL:


Service Discovery kullanımı

service discovery oluşturulması

private AbyssServiceDiscovery(Vertx vertx) {
    this.vertx = vertx;
    serviceDiscovery = ServiceDiscovery.create(vertx,
            new ServiceDiscoveryOptions()
                    .setAnnounceAddress("abyss-services-announce")
                    .setName("abyss-service-discovery"));
}
Warning
Verticle stop olurken Service Discovery kapatılması unutulmamalı!
AbyssServiceDiscovery.getInstance(vertx).getServiceDiscovery().close();

discovery record yaratılması

Record record = JDBCDataSource.createRecord(
        Constants.PORTAL_DATA_SOURCE_SERVICE,
        new JsonObject().put("url", Config.getInstance().getConfigJsonObject().getString(Constants.PORTAL_JDBC_URL)),
        new JsonObject().put("driver_class", Config.getInstance().getConfigJsonObject().getString(Constants.PORTAL_JDBC_DRIVER_CLASS))
                .put("user", Config.getInstance().getConfigJsonObject().getString(Constants.PORTAL_DBUSER_NAME))
                .put("password", Config.getInstance().getConfigJsonObject().getString(Constants.PORTAL_DBUSER_PASSWORD))
                .put("max_pool_size", Config.getInstance().getConfigJsonObject().getString(Constants.PORTAL_DBCONN_MAX_POOL_SIZE))
);

record publish edilmesi

AbyssServiceDiscovery.getInstance(vertx).getServiceDiscovery().publish(record, asyncResult -> {
    if (asyncResult.succeeded()) {
        logger.info("serviceDiscovery.publish OK..." + asyncResult.succeeded());
    } else {
        logger.error("serviceDiscovery.publish failed..." + asyncResult.cause());
        start.fail(asyncResult.cause());
    }
});

discovery’den record olarak service lookup yapılması

yöntem 1

AbyssServiceDiscovery.getInstance(vertx).getServiceDiscovery().getRecord(
        new JsonObject().put("name", Constants.PORTAL_DATA_SOURCE_SERVICE),
        asyncResult -> {
            if (asyncResult.succeeded() && asyncResult.result() != null) {
                // Retrieve the service reference
                ServiceReference serviceReference = AbyssServiceDiscovery.getInstance(vertx).getServiceDiscovery().getReference(asyncResult.result());

                // Retrieve the service object
                JDBCClient client = serviceReference.getAs(JDBCClient.class);


                //...

                serviceReference.release();
            }
        }
);

yöntem 2

JDBCDataSource.<JsonObject>getJDBCClient(AbyssServiceDiscovery.getInstance(vertx).getServiceDiscovery(),
        new JsonObject().put("name", Constants.PORTAL_DATA_SOURCE_SERVICE),
        ar -> {
            if (ar.succeeded()) {
                JDBCClient client = ar.result();
                //JDBCClient jdbcClient = JDBCClient.createShared(vertx, new JsonObject(),ar.toString());

                // ...

                // Dont' forget to release the service
                ServiceDiscovery.releaseServiceObject(AbyssServiceDiscovery.getInstance(vertx).getServiceDiscovery(), client);

            }
        });
Tip
Faik, please write it down here for the next tip!

Roadmap

The roadmap provides the current development direction and schedule for Abyss pipeline, CLI, and UI.

Getting Help

Abyss is designed to help you easily write and publish your documentation. However, we can’t fully realize this goal without your feedback! We encourage you to report issues, ask questions, share ideas, or discuss other aspects of this project using the communication tools provided below.

Social

If you want to share your experience with Verapi or help promote it, we encourage you to post about it on social media. When you talk about Verapi on Twitter, you can mention the official account for the project:

  • @Verapiyazilim (Twitter) — The official Verapi account on Twitter.

You can also use the #verapi hashtag to help promote the project or discover other people talking about it.

If you decide you want to get involved to help improve the project, then you’ll be interested in the information provided in the Contributing section.

Contributing

If you are interested in contributing to this project, please refer to the contributing guide. In this guide, you’ll learn how to:

Thanks in advance for helping to make this project a success!

Copyright © 2016-2018 Verapi Software Technologies AS and the Abyss Project.

Use of this software is granted under the terms of the Mozilla Public License Version 2.0 (MPL-2.0). See LICENSE to find the full license text.

Authors

Development of Antora is led and sponsored by Verapi Software Technologies AS.