Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    boulderwebdev
    @boulderwebdev
    u6f6o
    @u6f6o
    hi, I would like to add a correlation id to my log messages in vertx. I read that, beginning with vetx 4.1., vertx supports tracing with opetracing and zipkin. I wonder though, if it is possible to only pass a single id without activating any of these frameworks (as we don't use them atm)?
    VinayKrishna
    @vg283
    I have a vertx based java microservice running on a k8 cluster. When a new pod is installed, during the init I get this exception intermittently. Upgraded the vertx core and vertx web version from 3.5.3 to 3.9.3 but it didnt help. The app continues to be alive and fine after these exceptions. I wanted to know the root cause for this.

    I am new to vertx and k8s so any help would be appreciated.

    SEVERE: Unhandled exception
    java.util.NoSuchElementException: handler
    at io.netty.channel.DefaultChannelPipeline.getContextOrDie(DefaultChannelPipeline.java:1073)
    at io.netty.channel.DefaultChannelPipeline.addBefore(DefaultChannelPipeline.java:248)
    at io.netty.channel.DefaultChannelPipeline.addBefore(DefaultChannelPipeline.java:237)
    at io.vertx.core.http.impl.HttpHandlers.initializeWebsocketExtensions(HttpHandlers.java:92)
    at io.vertx.core.http.impl.HttpHandlers.handle(HttpHandlers.java:69)
    at io.vertx.core.http.impl.HttpHandlers.handle(HttpHandlers.java:34)
    at io.vertx.core.impl.ContextImpl.executeTask(ContextImpl.java:366)
    at io.vertx.core.impl.WorkerContext.lambda$wrapTask$0(WorkerContext.java:35)
    at io.vertx.core.impl.TaskQueue.run(TaskQueue.java:76)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.base/java.lang.Thread.run(Thread.java:830)

    Oct 12, 2020 11:43:28 PM io.vertx.core.impl.ContextImpl
    SEVERE: Unhandled exception
    java.lang.NullPointerException
    at io.vertx.core.http.impl.Http1xServerConnection.handleMessage(Http1xServerConnection.java:136)
    at io.vertx.core.impl.ContextImpl.executeTask(ContextImpl.java:366)
    at io.vertx.core.impl.WorkerContext.lambda$wrapTask$0(WorkerContext.java:35)
    at io.vertx.core.impl.TaskQueue.run(TaskQueue.java:76)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.base/java.lang.Thread.run(Thread.java:830)
    boulderwebdev
    @boulderwebdev
    How can I share an instance of EHCache in a verticle across different threads?
    boulderwebdev
    @boulderwebdev
    It seems like I can create a class with a synchronized create method which implements Shareable, then expose an API for getting and creating data from the cache. If I used this approach, then would I have to call sharedData = vertx.sharedData(), cacheMap = sharedData.getLocalMap("cacheMap") and myCache = cacheMap.get("ehCache") only once on instantiation of the verticle?
    boulderwebdev
    @boulderwebdev
    Another alternative would be to create a singleton class and have it return the Cache object. Moreover, anytime the cache creation method create is called, this will be synchronized
    boulderwebdev
    @boulderwebdev
    Also, it looks Infinispan may be a better choice since there is direct documentation for the EmbeddedCacheManager
    Soheil Pourbafrani
    @ahoora08

    Hi everybody,
    In testing a VertX application including a clustered eventbus,
    After 10 minutes running with high load of data, I got the error:

    [2020-10-13 20:35:14,371] ERROR [vert.x-eventloop-thread-2]  io.vertx.core.impl.ContextImpl ? - Unhandled exception
    java.lang.StackOverflowError
        at io.vertx.core.impl.AbstractContext.setResultHandler(AbstractContext.java:330)
        at io.vertx.core.impl.AbstractContext.executeBlocking(AbstractContext.java:243)
        at io.vertx.core.impl.EventLoopContext.executeBlocking(EventLoopContext.java:26)
        at io.vertx.spi.cluster.hazelcast.impl.HazelcastAsyncMultiMap.dequeueGet(HazelcastAsyncMultiMap.java:134)
        at io.vertx.spi.cluster.hazelcast.impl.HazelcastAsyncMultiMap.lambda$dequeueGet$7(HazelcastAsyncMultiMap.java:160)
        at io.vertx.spi.cluster.hazelcast.impl.HazelcastAsyncMultiMap$$Lambda$461/0000000000000000.handle(Unknown Source)
        at io.vertx.core.impl.AbstractContext.emit(AbstractContext.java:183)
        at io.vertx.core.impl.EventLoopContext.dispatch(EventLoopContext.java:72)
        at io.vertx.core.impl.EventLoopContext.dispatch(EventLoopContext.java:65)
        at io.vertx.core.impl.FutureImpl.doDispatch(FutureImpl.java:125)
        at io.vertx.core.impl.FutureImpl.dispatch(FutureImpl.java:119)
        at io.vertx.core.impl.FutureImpl.onComplete(FutureImpl.java:97)
        at io.vertx.core.Future.setHandler(Future.java:109)

    This is while under the normal load of data, we had no error.
    I think that should be something related to VertX internal or the EventBus.

    So what can be the issue? How can I optimize some VertX configuration to solve that?

    Anuranjit maindola
    @anuranjit_gitlab
    How to prevent escaping quotes geojson string with prepared query, its going as select serviceability_area_id from geo_serviceability where ST_Intersects(geo_area, ST_GeomFromGeoJSON('{\"type\":\"Polygon\",\"coordinates\":[[[77.64943599700928,12.965667067762364],[77.6499080657959,12.961526734123455],[77.65849113464355,12.961610377908876],[77.65892028808594,12.967047163668873],[77.65793323516846,12.974031167978774],[77.64986515045166,12.97198198943582],[77.64943599700928,12.965667067762364]]]}')) > 0.
    boulderwebdev
    @boulderwebdev
    @ahoora08 have you tried increasing the stack size? https://stackoverflow.com/questions/214741/what-is-a-stackoverflowerror . Otherwise, we world need to see the relevant code to see if there’s any error. Can you reproduce the bug in a sample project and post it?
    @anuranjit_gitlab can you post up a snippet with pastebin?
    14 replies
    Soheil Pourbafrani
    @ahoora08

    @boulderwebdev Thanks for your answer

    I know that we can increase the Stack size with the -Xss flag but I was curious to find out the issue. Is there any possibility thank under the high load of data, the (HazelCast) Eventbus or other part of the VertX, face the java.lang.StackOverFlow error?

    boulderwebdev
    @boulderwebdev

    @ahoora08 I mean it's possible, maybe you found a bug, but in order to determine that we need to see a reproduction of the bug: that's the only way to tell. Otherwise the output you gave will remain somewhat opaque. The only other thing I can think of is to look at the line
    at io.vertx.spi.cluster.hazelcast.impl.HazelcastAsyncMultiMap$$Lambda$461/0000000000000000.handle(Unknown Source)

    is there a broken config? If you google HazelcastAsyncMultiMap unknown source you may be able to find your answer

    There are a bunch of possible problems, but identifying the correct one requires a bug reproduction
    Yaz
    @yazalulloa_twitter
    Hi, Is there a way to have a NetSocket pool or is it unnecesary?
    gustavo-maxmilhas
    @gustavo-maxmilhas
    Hi all! Is it possible to get, from a ReplyException the original exception that was thrown?
    All i can get is its message, what i want is to rethrow the original exception from the consumer, so i can use a response handler that know for example, that for a given exception X, i will throw a 404 and not a 500
    Anirudh
    @anirudh708

    Hello all,
    I have a two core system, Vertx creates 4 event-loop(e1, e2, e3, e4) threads.
    I have five verticals v1, v2, v3, v4, v5 with v1 having two instances and other having one each

    The allocation is as.
    e1 -> v1
    e2 -> v1, v5
    e3 -> v3, v2
    e4 -> v4

    The verticals v3, v4, v5 are low priority and cpu intensive and have blocking code.

    Is it possible to schedule a vertical in this case v1 on e1 and e2 and the other three on remaining two.
    I assume v1 performance would be impacted by having v1 and v5 on e2.

    Frank Lemanschik
    @frank-dspeed
    Interristing case
    Dan O'Reilly
    @dano
    @anirudh708 i have often wished for that kind of control, too
    1 reply
    Asad Awadia
    @asad-awadia
    @anirudh708 they shouldn't - since everything should be non blocking - if the performance is being impacted that means the thread is being hogged for too long - which means the code is blocking and should be offloaded onto a dedicated worker pool anyways
    1 reply
    Asad Awadia
    @asad-awadia
    but there is runOnContext that may help keeping things on the same event loop
    1 reply
    Frank Lemanschik
    @frank-dspeed
    eventLoop is maybe the wrong word for this kind maybe this can be done simply with streams
    i can code that really declarativ with rx for example
    you could create a stream inside a TH call it loop and then use it
    Java RX Streams are the best struct i can think of to express this kind of logic
    boulderwebdev
    @boulderwebdev
    Are there any annotations or other techniques I can use to silence vertx from complaining about a method making the event loop stall for too long? I have a synchronized method that runs once for each vertx instance on startup
    Fagbohungbe Ayomide
    @ayomide101

    Hi guys, while testing vertx4.0-beta zipkin trace implementation I discovered that "trace" headers aren't carried between the HTTP Context and Eventbus context, this would be a problem for application that depend heavily on EB for communication between services. Question therefore, is this by design or a bug?

    I'm new here go easy on me.

    Asad Awadia
    @asad-awadia
    https://vertx.io/docs/vertx-jdbc-client/kotlin/ why does this client not return futures? -- how do I - in an http request - do a looped insert and then return 200 once all the inserts are done [without using the batch api]
    there is no way of doing composition... the future.futere promise doesnt work since the client requires a handler for the async result
    Asad Awadia
    @asad-awadia
    hmm I can do this inside a future - and then create a list I guess...
    u6f6o
    @u6f6o
    Hi,
    I rose a question regards contextual logging (correlation id) some days ago. In the meantime I found this library https://github.com/tsegismont/vertx-contextual-logging by @tsegismont and wanted to ask if anybody has made experience with it? At first glance it looks like it could solve my issue with mdc like correlation id logging.
    Frank Lemanschik
    @frank-dspeed
    i do not like that logger at all but that personal preference i would go for systemd-cat
    u6f6o
    @u6f6o
    my main issues is, that I'd like to assign an id (correlationid) to the current request. In bad old one thread per request frameworks (spring and the like), you could easily attach it to the current thread using thread locals. In a reative fw like vertx it's not so easy though
    Frank Lemanschik
    @frank-dspeed
    hmmm i understand cant you use a self generated id ? or the vertx intance id?
    every verticle has its own id by default
    u6f6o
    @u6f6o
    the id comes with a request header, I just need to pass it to the logger every time I log sth. and make it "independet" from other request that run on the same thread at the same time. The library solves it by referring to vertx.currentContext: https://github.com/tsegismont/vertx-contextual-logging/blob/master/src/main/java/io/github/tsegismont/vertx/contextual/logging/ContextualData.java#L46 I am just not deep enough into vertx core functionalities to understand it completelly
    (or to know the bordes of a verx context)
    u6f6o
    @u6f6o
    ok, think I will simply try it :-)
    Julien Lehuraux
    @jlehuraux_twitter
    Hi folks, quick question (Vert.x 3.7.1): how can I still benefit from shared data over a clustered setup while event bus would be set as not clustered? I tried options.getEventBusOptions().setClustered(false) before calling Vertx.clusteredVertx but it won't work as it internally makes the event bus clustered anyway. Now, I'm not sure to understand what setClustered(false) should be used for.
    1 reply
    Frank Lemanschik
    @frank-dspeed
    static boolean DEFAULT_CLUSTERED
    Deprecated.
    as of 3.7, use EventBusOptions.DEFAULT_CLUSTERED instead
    eventbusoptions default clustered is already false and it is not talking about clustering in your application it talks about clustering with diffrent hosts where a compatible application runs vertx supports many clustering methods to scale
    lecogiteur
    @lecogiteur
    Hi, in a cluster environment, for vertx.sharedData what is the difference between getClusterWideMap and getAsyncMap? If it's the same, which to use?
    3 replies
    u6f6o
    @u6f6o
    the library I mentioned (https://github.com/tsegismont/vertx-contextual-logging) does only work with vertx >= 4.0.0, so I'll have to wait some more time
    coolma0516
    @coolma0516
    hi, there, I am searching document for the jsonify the row object from the rowSet from databases.
    but get no luck, anyone can help?
    client.query("select * from name")
    .execute { ar ->
    if (ar.succeeded()) {
    var result = ar.result()
    println("Got ${result.size()} rows")
            result.forEach { row ->
              ...
              response.end("Hello $first, $last")
            }
          } else {
            println("Failure")
          }
        }
    Vang
    @return_tweet_twitter
    Hi, is there any other way to wait on multiple events other than having compositeFuture on all those events? Like if I have > 100 events to wait on?
    leolux
    @leolux
    Hi, has anyone faced the issue that the response handler of an HttpClient GET request does NOT get invoked altough the server responds with 401?