title: Receiving Java Objects over JMS
body: <p>Is this really the way to receive POJOs with JMS?</p>
  
  <pre><code>public void onMessage(Message msg) {
       ObjectMessage objMsg = (ObjectMessage) msg;
       if(objMsg.getObject() instanceof &lt;&lt;sometype&gt;&gt;) {
          //do something 
       }
   }
  </code></pre>
  
  <p>Do I have to cast to ObjectMessage. Actually then i have to check if msg is castable to ObjectMessage too.</p>
  
  <p>or do i miss something?</p>
  
  <p>thx</p>