EAI Patterns with Actor Model: Request-Reply

This is the first in a series of simple posts about using Actor Model to implement the EAI Patterns. The patterns are from the book Enterprise Integration Patterns, by Gregor Hohpe and Bobby Woolf. Information about the book and the patterns are found at the previously referenced link.

When I say Actor Model I am not discussing the general use of messaging, as in Pub-Sub or Queues, or a SOAP request for that matter. Of course ultimately you can use the Actor Model in that way, and you can find enough similarities to prove that using those approaches to service design and implementation qualifies them as Actor Model. In fact, even Carl Hewitt explains that you can model email systems and Web service endpoints as Actor systems.

On the other hand, some toolkits bring you much closer to the use of Actor Model as originally specified by Carl Hewitt and his team. This is the use of Actor Model that I am emphasizing, and the specific toolkits I am using are those that support Actor Model in that way. So I will be talking about Akka and my own Actor Model toolkit. Actors as supported by such an Actor Model toolkit will have the following basic characteristics:

  • Communication via Direct Asynchronous Messaging
  • Lock Free Concurrency
  • Share Nothing
  • Futures/Promises
  • Supervision
  • Parallelism (yes, even the potential for Parallelism)

This post is about Request-Reply. It’s quite simple and straightforward to implement using Actor Model.

. . .

The full text is now available as part of my book Reactive Enterprise with Actor Model on Safari Books Online.

Comments

  1. Ramesh Mandaleeka says:

    The example is covering a single Request and a sing Response. Does the pattern restricts to single request and single response?. If it supports many requests and corresponding responses:

    1) How to handle message sequencing?
    2) How to survive a restart of Request actor or Reply actor? How to handle the messages that are already submitted to any of the actors?

  2. Thanks for your questions. The example is not restricted in any way to a single request/response. Message resequencing will be discussed soon. By definition, the original Actor Model supports “at most once delivery” of messages. This is less than adequate when addressing the requirements of most business systems. In the near future I will also discuss “at least once delivery” of messages with Actor Model.