Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Johannes Schüth
    @Jotschi
    I have a similar system in place to generate RAML from vert.x routes but I want to transition to openapi at some point.
    @EfraimLA Sharing things between verticles can cause problems. Especially handlers should in general not be shared since most of them are only designed to be used on a per-verticle basis. You may run into threading issues.
    I'm not sure whether this is the case for the postgres pool / jwt instance.
    Paulo Lopes
    @pmlopes
    Jwt tries to be thread safe by synchronizing on the crypto functions but as @Jotschi wrote it's probably a bad idea as we can assure that just one thread is accessing the object state
    rodolfodpk
    @rodolfodpk
    I have been replacing Future with Promise and have a question: this compose last call is now deprecated. What should I use instead? Thanks.
    Stephan H. Wissel
    @Stwissel

    Replicating JSF state?
    I’m working on a prototype that might replace a JSF application. We moved rendering to WebComponents and now are looking at state. Our app has: requestState, viewState, sessionState, applicationState and server/cluster state. (All server side) I was wondering how to model that in the stateless world of vert.x. My considerations so far:

    • requestState: easy. Use RoutingContext
    • severState: easy. SharedData API
    • appState: medium. SharedData API, Ensure 2 apps don’t use the same keys
    • sessionState: probably easy. Use sessionSupport in vert.x
    • viewState: tricky. How to identify what belongs to a view. Potential solution: use a header or query parameter and a generic handler extracting it

    Any feedback/questions/ideas?

    Joe Sweeney
    @jswny
    What is the difference between the two Postgres drivers mentioned on the Vert.x website under "data access"? https://vertx.io/docs/vertx-pg-client/java/ and https://vertx.io/docs/vertx-mysql-postgresql-client/java/
    Julien Viet
    @vietj
    @jswny the former is the state of the art implementation for the Postgres driver whereas the later is the previous implementation based on another driver that is not maintained anymore written in Scala. There is also an implementation written in Kotlin which is a port of the Scala version though. However the former provides much better performance and can actually be supported by the vertx project more easily. Bottom line try use the vertx-pg-client although it is still in tech preview because the API might change a little until it is finalised (for the greater good)
    @rodolfodpk you should use the compose version that uses a Function instead
    Joe Sweeney
    @jswny
    @vietj I see you are the author too! Appreciate the feedback, that makes sense. Glad to see that I don't have to bundle scala to access Postgres with Vert.x!
    Julien Viet
    @vietj
    This message was deleted
    @jswny I implemented the postgres, @BillyYccc is contributing all the hard work for MySQL and soon SQL Server :-)
    Andreas Kluth
    @AndreasKl
    @aesteve As promised, the cause was a memory leak in bytea: eclipse-vertx/vertx-sql-client#416
    Julien Viet
    @vietj
    @AndreasKl thanks again for your contribution, it's lot of time saved for us that we can spend on other stuff :-)
    Arnaud Esteve
    @aesteve
    thanks a lot @AndreasKl !!
    Efraim
    @EfraimLA
    Thanks for answering, well i'm using only one instance of JWT per verticle and pooling postgres for each one too, think shouldn't cause problems
    Matteo Restelli
    @reste85
    @vietj I was trying to contribute to fix the problem about watch reconnection of ServiceImporter (vert-x3/vertx-service-discovery#113), but i haven't found how to add a sort of exceptionHandler or connectionHandler to the WebClient. Do you have any suggestions on that? thank you!
    Julien Viet
    @vietj
    @reste85 hi
    you can get the underlying HttpClient which provides a connectionHandler for HttpClientRequest
    Matteo Restelli
    @reste85
    @vietj currently i can't see a method which returns an HttpClient sorry...
    Julien Viet
    @vietj
    ah
    @reste85 it is because the WebClient needs to wrap an actual HttpClient
    is that something you can do ?
    another option would be to use the internal interceptor stuff of the WebClient
    if you case to WebClientInternal then you do have an addInterceptor method that allows you to interact with the request/response lifecycle
    Jorge Simon Gil
    @SGjorge

    Hi everyone, I'm develop an app using vertx and I've got next issue:
    I'm trying to connect with Azure Repo to externalize vertx config (based on https://vertx.io/docs/vertx-config/java/#_extending_the_config_retriever) and when execute it throw this exception:

    • Authentication is required but no CredentialsProvider has been registered
      Git config is:
      ConfigStoreOptions git = new ConfigStoreOptions().
             setType("git").
             setFormat("properties").
             setConfig(new JsonObject().
                     put("url", <Repo URL>).
                     put("path", "local").
                     put("user", <Repo User>).
                     put("password",<User Pass>)

    Have any idea about solve it? Thanks :)

    Matteo Restelli
    @reste85
    @vietj i've to see the code. At first sight, i'm thinkin' about creating an HttpClient (instead of a WebClient), setup the connection handler and then wrap into a WebClient
    and in the connection handler i'll handle the reconnection case... or something like that
    another thing i was seeing in the past days is how to reach the ability to test the disconnection/reconnection case... it seems that the KubernetesServerMock doesn't provide those specific methods, so probably i'll need to call the destroy method on that and then reinit a new server
    steve
    @ngosti2000_twitter

    am trying to protect a route using Basic Auth... but upon doing that and trying to access the getRoute("/imt/v1/simbapay/gettransaction"), i get resource not found... what could be the issue

    AuthProvider ap = new IMTUserAuthenticator();
             AuthHandler ah = BasicAuthHandler.create(ap);
             ah.addAuthority("role:listtransactions");
             router.route().handler(SessionHandler.create(LocalSessionStore.create(vertx)));
             router.route().handler(UserSessionHandler.create(ap));          
             getRoute("/imt/v1/simbapay/*").handler(ah);
             getRoute("/imt/v1/simbapay/gettransaction")
                   .handler(BodyHandler.create())              
                   .handler(rc -> {
                      System.out.println(rc.user() != null);
                      getRecords(rc, EventBusChannel.SP_GET_TRANSACTION);
                   });

    ........

    public Route getRoute(String path) {
    
          Route route = router.route(path);
    
          return route;
       }
    Paulo Lopes
    @pmlopes
    @ngosti2000_twitter can you show the response of a curl request? It's hard to tell what it is going on without a more detailed example...
    Julien Viet
    @vietj
    @/all 4.0.0-milestone3 has been released today https://vertx.io/blog/eclipse-vert-x-4-milestone-3-released/
    steve
    @ngosti2000_twitter
    @pmlopes here is the output
    curl --noproxy "*" --header "Authorization:Basic c3RldmU6c3RldmU=" -v http://localhost:8092/imt/v1/simbapay/gettransaction -d '{}'
    *   Trying 127.0.0.1...
    * TCP_NODELAY set
    * Connected to localhost (127.0.0.1) port 8092 (#0)
    > POST /imt/v1/simbapay/gettransaction HTTP/1.1
    > Host: localhost:8092
    > User-Agent: curl/7.58.0
    > Accept: */*
    > Authorization:Basic c3RldmU6c3RldmU=
    > Content-Length: 2
    > Content-Type: application/x-www-form-urlencoded
    > 
    * upload completely sent off: 2 out of 2 bytes
    < HTTP/1.1 404 Not Found
    < content-type: text/html; charset=utf-8
    < content-length: 53
    < 
    * Connection #0 to host localhost left intact
    <html><body><h1>Resource not found</h1></body></html>
    Paulo Lopes
    @pmlopes
    @ngosti2000_twitter can you share a small example showing the problem. A gist, a unit test. If feels like it can be something wrong with the config or a bug.
    Joe Sweeney
    @jswny
    I'm trying to start multiple verticles. The guides I've found say to use CompositeFuture.all, but verticles now use Promises not Futures. How can I do a similar thing with a composite promise instead?
    Joe Sweeney
    @jswny
    Is it appropriate to just get the future from each start verticle promise with startPromise.future() and then use those for the composite future call?
    JeffSG
    @JeffSG
    Got "Handling failure" with detailed message "io.vertx.core.file.FileSystemException: java.nio.file.NoSuchFileException: io\vertx\ext\web\handler\graphiql\index.html" when I'm trying to visit GraphiQL with vertx-web-graphql 3.8.1. Any idea?
    Stephane Bastian
    @stephanebastian
    @pmlopes : We're working full speed on improving Vertx-Auth as discussed previously -> https://groups.google.com/forum/#!topic/vertx-dev/TQTlzGq9HlY
    We are wondering how we could move forward with the RFC https://github.com/assembloo/vertx-auth/wiki/RFC_Auth_Improvements.
    Since you seem pretty busy with Es4x, do you have some sort of 'backup' committer on Vertx-Auth that we can include in the discussion to target this for 4.0 ? Thank you
    Paulo Lopes
    @pmlopes

    Hi @stephanebastian I'm busy with many modules at the same time, that's more it :) Regarding the RFC I agree mostly with everything, however we have committed to introduce as less breakages as possible for 4.0. Having that said I think we can start doing small parts of the RFC. For example:

    • the Authorization interface + common implementations could be already added as a pull request (no breaks there).
    • the User interface changes (as they are additions) can also be added which would already allow the basic authorization code to work

    From there we can start planning updating Oauth2, JDBC, mongo, etc as they need to be verified on a case by case basis

    Would that be fine with you?

    Once the basic stuff lands on auth we can start updating the web handlers to support the new interfaces as those are on the impl packages, changes there are easier to manage as they are not user facing interfaces
    Stephane Bastian
    @stephanebastian
    @pmlopes sounds good to me
    Stephane Bastian
    @stephanebastian
    @pmlopes @francoisprunier or myself will send you a PR mid-week, next week and we'll take it from there.
    BTW kudos on your work on ES4X, pretty impressive !
    Paulo Lopes
    @pmlopes
    Thanks!
    Kristian Kraljic
    @kristian
    Hi. I have a general question in regards to shared locks in clustered environments. How to generally deal with the situation in case any one cluster node aquires a lock and during the execution, while still holding the lock, the said cluster node fatally fails? As the lock.release() method was never called, the lock is lost and there is no possibility of retrieving another copy of the lock to release it. Is this somehow handled in the clustered implementation of locks already (e.g. will the cluster manager regognize the node failed and automatically release all associated locks)? Additional question, if we just want to check whether a lock is currently available, will calling sharedData.getLockWithTimeout("name", 0, handler) be sufficient? Thanks so much!
    Thomas Segismont
    @tsegismont
    Hi @kristian . Yes, the cluster manager (Hazelcast, or Infinispan, ...etc) should release any lock acquired by a node when it crashes.
    Kristian Kraljic
    @kristian
    @tsegismont very nice! That was my assumtion in the first place! Great to hear! =) Thanks so much!
    Thomas Segismont
    @tsegismont
    @kristian and yes you can check if a lock is available with this method call, provided you release it in case you acquired it :wink:
    Kristian Kraljic
    @kristian
    @tsegismont Okay, sure! Thanks a lot. This means the timeout is only taken into account if the lock is actually locked, and not for stuff like network delay to the cluster manager etc. right? So a timeout of 0, will simply cause Vert.x to not wait for any time for the lock possibly beeing released?
    Thomas Segismont
    @tsegismont
    @kristian The timeout is provided as-is to the underlying cluster manager. So behavior with timeout 0 is cluster manager specific
    Kristian Kraljic
    @kristian
    @tsegismont Thanks Thomas! That explains it. I also figured out 0 doesn‘t work well for local locks either. I‘ll choose a more appropriate timeout for my use case! Thanks again!