title: Sending complex object via JMS in Java
body: <p>Is it possible to send complex messages via JMS? I can send TextMessages, Messages etc .. but when I try to send my custom object type <code>MyObject</code> trough <code>send()</code> method of <code>MessageProducer</code> I get compile error.</p>
  
  <p>Then I tried to cast it, I get cast exception like <code>MyObject cannot be cast to javax.jms.Message</code></p>
  
  <p>Here is a code I tried :</p>
  
  <pre><code>MessageProducer messageProducer = session.createProducer(destination);
  messageProducer.send((Message)getMyObject()); //where getMyObject method retrieves mapped myObject type
  </code></pre>
  
  <p>anyone got any advice? thank you</p>