Open the20login opened 8 years ago
There are problem with implementation. In geneneral case, client needs at least two ObjectMappers: one for json, and one for msgpack. There are several ways for obtaining configured instances, but all of them has drawbacks.
configure(ObjectMapper mapper)
method, ObjectMapppers itself created inside clientBuilder and passed to that instance. This option is verbose for Java 7 and below.Third option looks better then others. @programmerr47, please tell me if you have any particular preferences.
After closely look at the code, I realize that ObjectMapper could be customized right now, without any changes. Just appply configuration settings to static instances in WampSerialization
enum.
But using static non-constant fields is bad desing, it could be used as a quick hack, but not in general. For example, application need to receive(or send) messages with several excluding ObjectMapper propeties. It is impossinble in current implementation, but would be easy in case of per-client mappers. Of cource, it is extreamly rare case, but, since jawampa is a library, it is still possible.
Implementing per-client ObjectMappers require significant changes, and I would like to discuss it with @Matthias247 (or another mainteiner) first.
@the20login thank you for this information. I think I only need to configure objectMapper during "building" process though WampClientBuilder.
Some time ago I have implemented setter for object mapper for issue https://github.com/Matthias247/jawampa/issues/79
Unfortunately, I made a mistake, my commit is useless. Jawampa client use not one, not two, but THREE different instances of ObjectMapper, and I replace only one of them.
I will provide correct implementation in several days.