vert-x3 / issues

Apache License 2.0
36 stars 7 forks source link

java.lang.IllegalArgumentException: Invalid type: class com.codahale.metrics.Timer$Context to put in async map #532

Closed SubhamSinghal closed 4 years ago

SubhamSinghal commented 4 years ago

I have created a vertx AsyncMap< Long, Context > where I store dropwizard timer for a specific jobId. But when I put any value to map I am getting "java.lang.IllegalArgumentException: Invalid type: class com.codahale.metrics.Timer$Context to put in async map" error.

Code for map initialization:

vertxService.getVertx().sharedData().<Long,Context>getClusterWideMap("mapName", ar -> {
            if(ar.succeeded()){
                tempAsyncMap = ar.result();
            }else{
                log.error("Not able to get cluster wide map with name due to {}:",ar.cause());
            }
        });

code for putting timer to map: tempAsyncMap.put(jobId, jobWaitTimer.time(), completionHandler -> {});

tsegismont commented 4 years ago

Answered on SO https://stackoverflow.com/a/62429735/2133695