Skip to content

Instantly share code, notes, and snippets.

View tsegismont's full-sized avatar

Thomas Segismont tsegismont

View GitHub Profile
@tsegismont
tsegismont / bench.out
Created September 15, 2022 07:09
JMH results accumulator benchmarks
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.openjdk.jmh.util.Utils (file:/home/tsegismont/Projects/eclipse-vertx/vertx-sql-client/vertx-sql-client/target/vertx-sql-client-4.2.7-SQL1225-benchmarks.jar) to field java.io.PrintStream.charOut
WARNING: Please consider reporting this to the maintainers of org.openjdk.jmh.util.Utils
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
# JMH version: 1.19
# VM version: JDK 11.0.14, VM 11.0.14+9
# VM invoker: /home/tsegismont/Tools/sdkman/candidates/java/11.0.14-tem/bin/java
# VM options: -Xms8g -Xmx8g -Xmn7g
# Warmup: 20 iterations, 1 s each
@tsegismont
tsegismont / MainVerticle.java
Last active July 4, 2022 19:53
Vert.x Reactive Oracle Client with Oracle Cloud
package com.example.oracle_cloud_test;
import io.vertx.core.AbstractVerticle;
import io.vertx.oracleclient.OracleConnectOptions;
import io.vertx.oracleclient.OraclePool;
import io.vertx.sqlclient.PoolOptions;
import io.vertx.sqlclient.Row;
public class MainVerticle extends AbstractVerticle {
@tsegismont
tsegismont / MainVerticle.java
Created October 13, 2020 14:31
vertx-cassandra-micrometer vertx-cassandra-micrometer
package com.example.starter;
import io.vertx.cassandra.CassandraClient;
import io.vertx.cassandra.CassandraClientOptions;
import io.vertx.core.AbstractVerticle;
import io.vertx.core.Vertx;
import io.vertx.core.VertxOptions;
import io.vertx.core.http.HttpServerOptions;
import io.vertx.micrometer.MicrometerMetricsOptions;
import io.vertx.micrometer.VertxPrometheusOptions;
@tsegismont
tsegismont / gist:f0415403478f501a0d788f5b264d3eb8
Created February 17, 2020 16:41
ClassCastException: class io.quarkus.bootstrap.app.CuratedApplication cannot be cast to class io.quarkus.bootstrap.app.CuratedApplication
[INFO] Running io.quarkus.vertx.devmode.VerticleClassnameHotReloadTest
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.136 s <<< FAILURE! - in io.quarkus.vertx.devmode.VerticleClassnameHotReloadTest
[ERROR] testDeploymentOfVerticleClass Time elapsed: 0.135 s <<< ERROR!
java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.ClassCastException: class io.quarkus.bootstrap.app.CuratedApplication cannot be cast to class io.quarkus.bootstrap.app.CuratedApplication (io.quarkus.bootstrap.app.CuratedApplication is in unnamed module of loader 'app'; io.quarkus.bootstrap.app.CuratedApplication is in unnamed module of loader io.quarkus.bootstrap.classloading.QuarkusClassLoader @2e7a9db7)
at io.quarkus.test.QuarkusDevModeTest.beforeEach(QuarkusDevModeTest.java:156)
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeBeforeEachCallbacks$1(TestMethodTestDescriptor.java:154)
at org.junit.jupiter.engine.descriptor.TestMethodTestDesc
Router router = Router.router(vertx);
router.route()
.handler(ResponseContentTypeHandler.create())
.handler(BodyHandler.create());
router
.get("/beer")
.handler(beersHandlers::handleGetBeers);
router
.post("/beer")
.handler(beersHandlers::handlePostBeer);
Router router = Router.router(vertx);
router
.get("/beer")
.handler(BodyHandler.create())
.handler(beersHandlers::handleGetBeers);
router
.post("/beer")
.handler(BodyHandler.create())
.handler(beersHandlers::handlePostBeer);
[tsegismont@sombrero web-realtime-viewer]$ npm start
> web-realtime-viewer@0.1.0 start /home/tsegismont/Temp/swiss-transport-realtime-t_local/components/web-realtime-viewer
> DEBUG=true node server.js
{ frontend:
{ url:
{ train_position_snapshot: 'http://-:9000/position',
station_board: 'http://-:9000/stationboard' },
delay: { stationBoard: 10000, trainPosition: 3000 } },
@tsegismont
tsegismont / AsyncHandlerAdpater.java
Created September 7, 2017 08:55
AWS AsyncHandlerAdpater
import com.amazonaws.AmazonWebServiceRequest;
import com.amazonaws.handlers.AsyncHandler;
import com.amazonaws.services.dynamodbv2.AmazonDynamoDBAsync;
import com.amazonaws.services.dynamodbv2.AmazonDynamoDBAsyncClientBuilder;
import com.amazonaws.services.dynamodbv2.model.DescribeTableRequest;
import com.amazonaws.services.dynamodbv2.model.DescribeTableResult;
import io.vertx.core.AsyncResult;
import io.vertx.core.Context;
import io.vertx.core.Future;
import io.vertx.core.Handler;
public <R> void send(BodyCodec<R> responseCodec, Handler<AsyncResult<HttpResponse<R>>> handler) {
delegate.send(responseCodec.getDelegate(), new Handler<AsyncResult<io.vertx.webclient.HttpResponse<R>>>() {
public void handle(AsyncResult<io.vertx.webclient.HttpResponse<R>> ar) {
if (ar.succeeded()) {
handler.handle(io.vertx.core.Future.succeededFuture(HttpResponse.newInstance(ar.result(), io.vertx.lang.rxjava.TypeArg.unknown())));
} else {
handler.handle(io.vertx.core.Future.failedFuture(ar.cause()));
}
}
});
### Keybase proof
I hereby claim:
* I am tsegismont on github.
* I am tsegismont (https://keybase.io/tsegismont) on keybase.
* I have a public key whose fingerprint is 7DF7 52F9 B379 8678 26BD B2D8 6F71 1514 CA3E 27A0
To claim this, I am signing this object: