On 4 Dec 2007, at 22:23, Emil Ong wrote:
> We've recently added new support for streaming objects in Hessian 2.0.
> The basic underlying Hessian protocol is the same, but objects may be
> broken into "messages". There is a new production for messages:
>
> # message/streaming message
> message ::= ('p' b1 b0 data)* 'P' b1 b0 data
>
> Please let us know your comments, questions, and suggestions.
I think the use case is valid but I feel that object streaming was
possible even before this suggestion.
As indicated in this post (
http://www.mail-archive.com/[email protected]/msg00044.html
- sorry the referenced project has been taken offline due to lack of
interest) the writing side could write objects from an iterator. This
left it up to the implementation of the iterator to stream the data to
the output channel. One example of streaming output could be:
Database cursor -> JPA adaptor -> Object stream -> Hessian writer ->
Wire
However on in the input side I feel that deserializing an Hessian
encoded list of objects is simpler than using the packet orientated
format and provides the same functionality. This is especially so
seeing as the receiving end needs to be aware a priori that it will
receive a stream of packets/messages/objects. It is too late on the
receiving side to realize that it has to deal with a stream if it has
not been set up to do so - where will it offload the deserialized
objects to?
What I am trying to say is that the processing side of the application
needs to be architected around a streaming principle to benefit from
any streaming ability in the protocol.
Essentially the Hessian2StreamingInput class delegates object decoding
to a wrapping reader that consumes the byte stream according to the
protocol packets, but I can't see what the difference is to using the
normal Hessian2Input to read 1 object and then send it to a downstream
component.
The only difference I see is that you can demarcate where the
boundaries are - but this is on a encoded byte level. I think that the
same can be achieved a lot more simply by using the small o notation
for a list of object instances that the receiver can opt to process in
a streaming fashion.
I am trying to envisage some benefits of optimizing the chunking of
the byte stream for more rapid parsing at the receiving end (e.g. by
aligning things more efficiently), but I don't think this knowledge
will be built into the Hessian layer.
However, having said all of that, I am not dead against it, I am just
playing devil's advocate in order to Hessian 2.0 as simple and as a
powerful as possible.
HTH,
Ben
_______________________________________________
hessian-interest mailing list
[email protected]
http://maillist.caucho.com/mailman/listinfo/hessian-interest