title: How to design a distributed application using a Message Broker and a Database?
body: <p>I would like to implement an distributed Point-Of-Sale system, somewhat like the one described in <a href="https://stackoverflow.com/questions/2454629/point-of-sale-app-architecture-advice">Point of sale app architecture advice</a>.</p>
  
  <p>It is a distributed system with these charachteristics:</p>
  
  <ul>
  <li>The clients are <b>mission critical</b>, they should work even if the network connection or the server fails, but just for a few days or so.</li>
  <li>The clients must be easy to install.</li>
  <li>Each client has it's own local embedded database.</li>
  <li>The communication between the clients and the server is using a message queue.</li>
  <li>The server is used for backup, bookkeeping, statistics and distribute prices to the clients.</li>
  <li>The server is placed on internet.</li>
  </ul>
  
  <p>I am implementing the client in Java Swing with JavaDB as the database.</p>
  
  <p><b>How should my application communicate with the message broker and the database?</b></p>
  
  <p>I have never used Message Queues and Message Brokers before. My idea is that the application reads from the database, but writes to the message broker, and the message broker writes to the database and communicates with the server. Or is this a bad idea? How should I solve this?</p>
  
  <p>So besides my embedded database, I need to find a message broker, preferably one written in Java that could be embedded in my application, for easy installation.</p>