title: AKKA: Communicating via Messaging Queue
body: <p>We have a component written in Groovy ( let's call it a "G-Component" ) that needs to communicate with a component written in Scala / AKKA ( let's call it an "A-Component" ).</p>
  
  <p>What fits our needs best is a messaging queue:</p>
  
  <pre><code>"G-COMPONENT" &lt;==&gt; in memory messaging queue &lt;==&gt; "A-COMPONENT"
  </code></pre>
  
  <p>For the "G-COMPONENT" life is simple:</p>
  
  <pre><code>queue.send( message )
  message = queue.receive()
  </code></pre>
  
  <p>For the AKKA component it seems a bit more involved, since there is an Actor that needs to "handle"/"receive" messages, and be able to "send" messages back. </p>
  
  <p>The problem is the "receive" part, as it now needs to go into a loop of its own to listen for messages from the queue. Which.. disables it as an AKKA Actor, since once it is in that loop, it can't receive any AKKA messages.</p>
  
  <p>Would appreciate any help on the clean solution for this, without implementing an AKKA plugin of "that particular queue implementation" Actor mailbox.</p>