--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
Visit this group at http://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/0e086369-af29-404c-99bb-d0d0aba4638b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
showsMessages.putIfAbsent(showId, new HashSet<String>());
Set<String> specificShowMessages = showsMessages.get(showId);
and got the following exception :
java.lang.IllegalArgumentException: Invalid type for shareddata data structure: java.util.concurrent.HashSet
at io.vertx.core.shareddata.impl.Checker.checkType(Checker.java:45)
at io.vertx.core.shareddata.impl.LocalMapImpl.putIfAbsent(LocalMapImpl.java:80)
at com.vp.vertx.cluster.handler.managment.PublishEventBusHandler.updateShowMessages(PublishEventBusHandler.java:72)
at com.vp.vertx.cluster.handler.managment.PublishEventBusHandler.handle(PublishEventBusHandler.java:51)
at com.vp.vertx.cluster.handler.managment.PublishEventBusHandler.handle(PublishEventBusHandler.java:23)
at io.vertx.core.eventbus.impl.EventBusImpl$HandlerRegistration.handle(EventBusImpl.java:1108)
at io.vertx.core.eventbus.impl.EventBusImpl.lambda$doReceive$189(EventBusImpl.java:755)
at io.vertx.core.eventbus.impl.EventBusImpl$$Lambda$48/312707322.handle(Unknown Source)
at io.vertx.core.impl.ContextImpl.lambda$wrapTask$15(ContextImpl.java:314)
at io.vertx.core.impl.ContextImpl$$Lambda$12/1724924833.run(Unknown Source)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:357)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:357)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:111)
at java.lang.Thread.run(Thread.java:745)
Thanks,
Nimrod.
http://vertx.io/vertx2/api/java/org/vertx/java/core/shareddata/SharedData.html
Regards,
Assen
Sorry, I just noticed, that I have referred to the Vert.x 2 JavaDoc in my previous post.
I must admit, that I am quite suprised that the data type limitations for sharing data in Vertx 3 are nowhere documented. Digging into the code of LocalMap shows clearly that the same limitations, described in the old documentation still apply for Vertx 3 (plus JsonObject and JsonArray).
Maybe some Insider could explain us, why they are not documented.
Regards,
Assen
--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
Visit this group at http://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/a720c162-38f5-4358-a7b6-60137f734af1%40googlegroups.com.
Sure, We are in the process of upgrading our code to vertx 3.0. I came across a great post in vertx.io blog (http://vertx.io/blog/checklist-for-migrating-from-vert-x-2-1-x-to-vert-x-3-part-one/) which describes the process of upgrading to vertx 3.0 . In this post there is a section which talks about shared data, Quote :
"SharedData no longer has shared sets. It has a Map of SharedData, so an entry in that Map of shared data could be the name of the set as the key, and a Set as the value.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/0c05f0bb-6df8-4570-8747-e6d4dcf86b35%40googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/43cbd8d7-b91d-4882-9d65-478465d54ab0%40googlegroups.com.
"Even if you use a thread safe list/set you won't get the checks that the objects that you add to the set are thread safe --> race conditions.
This is exactly the situation that Shared Data was supposed to protect you against."
If i use a thread safe set and the objects that i add to the set are immutable you still don't recommend this approach ?
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/2e5f9888-0d54-4365-949f-566efb8b0f92%40googlegroups.com.