cayenne-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Savva Kolbachev <s.kolbac...@gmail.com>
Subject Cayenne ROP Improvements
Date Thu, 05 May 2016 09:35:55 GMT
Hi All,

As you already may know, Dima did a lot of refactoring and made
connectivity layer/serialization pluggable after 4.0.M3 release. So now
ROPConnector and ROPSerializationService implementations responsible for
connectivity layer and serialization accordingly.
Also we moved from Hessian as a default implementation for connectivity
layer to the standard Java implementation. Although, Hessian is still used
for serialization by default.

I've been working on some ROP improvements recently and I want to hear your
opinion on these:

1. Jetty HTTP/2 Client for connectivity layer.
related source:
http://www.eclipse.org/jetty/documentation/current/http2.html
related JIRA: https://issues.apache.org/jira/browse/CAY-2076
related pull-request: https://github.com/apache/cayenne/pull/96

So if you want to use HTTP/2 in your ROP application all you need is just
add Http2ClientModule to Client Runtime and Jetty will take care of all
things related to HTTP/2. This is a deafult solution and it uses prior
knowledge about HTTP/2 on server-side so you could use it without providing
ALPN. If you want to handle some things related to HTTP/2, there are some
other options. More information you could find in related JIRA ticket.

2. Protostuff for serialization.
related source: http://www.protostuff.io/
related JIRA: https://issues.apache.org/jira/browse/CAY-2083
related pull-request: https://github.com/apache/cayenne/pull/102

Protostuff (licensed under Apache 2.0 licence) is based on Google's
Protocol-Buffers (Protobuf) but has some optimizations and some cool things
like runtime serialization graph of objects (like Hessian). It also could
generate schema on runtime so we shouldn't define .proto files although it
might increase efficiency. It works faster than Hessian and could handle
Java8 Date and Time types. Here is some benchmarks. Take a look at Full
Object Graph Serializers section.
http://hperadin.github.io/jvm-serializers-report/report.html
https://github.com/eishay/jvm-serializers/wiki

To use it you should add ProtostuffModule for both Server and Client
runtime configurations. And also add
-Dprotostuff.runtime.collection_schema_on_repeated_fields=true as VM option
because some of Cayenne objects have cyclic collection fields (more info:
http://www.protostuff.io/documentation/object-graphs/)

If anybody has some suggestions or questions, please, feel free to comment.
If there are no objections, I'm going to merge it to master branch soon.

Also I want to suggest to use Protostuff serialization instead of Hessian
by default. What do you think about it?

-- 
Thanks and Regards
Savva Kolbachev

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message