Matthias247 / jawampa

Web Application Messaging Protocol (WAMP v2) support for Java
Apache License 2.0
148 stars 56 forks source link

Customize object mapper for WampClient #79

Closed programmerr47 closed 8 years ago

programmerr47 commented 8 years ago

Hello, I'm using this library in my project for retrieve data by WebSocket. I have Pojos and use Jackson to convert results of rest calls (I also have rest calls) to them. One of the objects came also from WebSocket, and jawampa has it's own objectMapper (default object mapper) to provide converting from json to Pojo.

The problem is, that I have to setup my objectMapper by introducing CAMEL_CASE_NAMING_STRATEGY and also setting FAIL_ON_UNKNOWN_PROPERTIES to false, to provide not full mapping from json to objects (my objects are far less, than response json from server). So it would be nice If I could configure objectMapper in jawampa.

For example, It would be greate if WampClientBuilder had method objectMapper(ObjectMapper objectMapper) or something like that.

Thank you.

the20login commented 8 years ago

I had implemented customizable object mapper, see pull requests.

programmerr47 commented 8 years ago

@the20login Perfect, thank you. But I'm aware of 9month long silence (I mean last commit in library was made 9month ago). :(

the20login commented 8 years ago

Yeah, I'm worried about it too, but it's pull request, ready for merge, so lets hope for the best.

In my case, I would like to skip empty fields and have a support of Java 8 Datetime. At first, I've tried to extract ObjectMapper via reflection, but it doesn't seems possible (because of private final modifiers).

Of cource, there is always an option to make a fork, but I really don't want to do this.

darkl commented 8 years ago

Hi @Matthias247, what about adding another collaborator to the project so he can help with these kind of pull requests? (I'm not suggesting anyone specific, just suggesting the idea)

Elad

Matthias247 commented 8 years ago

Hi everyone, sorry for the delayed response. I have checked and merge the PR. I can totally understand that the reaction time wasn't good. But unfortunately I currently neither use WAMP professionally nor privately and have to take care of some other projects - so therefore it is not high on my priority list. However I think the suggestion from @darkl is good - but the question is how to find a good maintainer :) Maybe @santhosh-tekuri has interest, since he contributed quite a lot?

the20login commented 8 years ago

BTW, what about maven central? Are you plannning to release updated version?

programmerr47 commented 8 years ago

Hi @Matthias247 Could you please promt to me, when will be released new version

Matthias247 commented 8 years ago

@the20login @programmerr47 new version should now be on maven central.

the20login commented 8 years ago

Awesome, thanks!

programmerr47 commented 8 years ago

@Matthias247 thank you ;) @the20login thank you for your contribution