main website home
  • About this blog

    This blog features updates, opinions, and technical notes from Caucho engineers about Caucho products, the enterprise Java industry, and PHP. Caucho Technology is the creator of the Resin Application Server and the Quercus PHP in Java engine. A leader in Java performance since 1998, Caucho is a Sun JavaEE licensee with over 9000 customers worldwide.
  • Tags

    ajaxworld bam candi cdi cloud cluster comet configuration deploy devoxx eclipse ejb embedded flash flex google app engine hessian hmtp ioc java ee 6 javaone javazone jms messaging newsletter nyjug osgi php pomegranate quercus resin resin 4.0 REST servlet sfjug silicon valley code camp spring testing training tssjs watchdog webbeans web profile websockets wordpress
  • Meta

    • Register
    • Log in
    • Entries RSS
    • Comments RSS
    • WordPress.org
« Are We There Yet?: Resin 4 Java EE 6 Web Profile Certification
Extending Resin’s command set »

HMTP/WebSocket - actor messaging for Hessian

As we get closer to finishing up the web profile for Resin and as the WebSocket draft works through the IETF committee, we have the opportunity to make Hessian a full actor messaging protocol, not just limited to RPC calls.

The idea of HMTP is to redesign XMPP (Jabber) as a binary actor protocol using Hessian, and simplify the model by removing the IM-specific parts. The messaging model means HMTP can be non-blocking, and can support bidirectional messaging: unsolicited messages from the server and the client.

Each HMTP Actor has a unique JID (Jabber identifier), which resembles an email address:

harry@tictactoe.com/13

The “/13″ is an optional resource identifier, because harry might have multiple connections to the server (or an Actor programming model might have multiple load-balanced Actors like MDB queues.)

In Java, the basic API is a stream with two messaging styles: one-way messages, and RPC get/set, which covers the important messaging patterns:

class ActorStream {
  // The actor's jid
  String getJid();
  // message (one-way)
  void message(String to, String from, Serializable payload);

  // RPC calls - "get" is like a REST get, and "set" is like a REST POST/PUT
  // i.e. get has no side-effects
  void queryGet(long qid, String to, String from, Serializable payload);
  void querySet(long qid, String to, String from, Serializable payload);
  void queryResult(long qid, String to, String from, Serializable payload);

  // errors
  void messageError(String to, String from, Serializable payload, ActorError error);
  void queryError(long qid, String to, String from, Serializable payload, ActorError error);
}

The qid (query-id) is needed in the RPC calls to match the get/set with the corresponding result or error.

Unlike RPC Hessian, HMTP is non-blocking. A queryGet RPC call returns when the packet is sent. The actor will receive the result message as a normal message. There may even be one-way messages interleaved between or queries returning out of order.

This entry was posted on Thursday, December 2nd, 2010 at 11:54 am and is filed under Uncategorized. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply

You must be logged in to post a comment.


Caucho Technology is proudly powered by WordPress and Quercus®
Entries (RSS) and Comments (RSS).

  • HOME |
  • CONTACT US |
  • DOCUMENTATION |
  • BLOG |
  • WIKI 4 |
  • WIKI 3 |
  • Resin: Java Application Server
Copyright (c) 1998-2012 Caucho Technology, Inc. All rights reserved.
caucho® , resin® and quercus® are registered trademarks of Caucho Technology, Inc.
resin® is a cloud optimized, java® application server that supports the java ee webprofile ®