7 Replies Latest reply on Oct 20, 2010 1:21 AM by srinivaas venkat

    Issue sending java object and a file via StreamMessage

    srinivaas venkat Novice

      Hi,

       

      I'm using Hornetq 2.0.0 GA and Jboss AS 5.1.0 GA.

       

      I have a requirement where I need to send a Java object and a pdf file both together as a single JMS message, I tried the large file example in distro and it worked fine for large files but I'm not sure how to send a java object along with that file.

       

      I've attached the sample code that

                                         1. Sends a message to requestQ (with a file and an object as byte[]) ,

                                         2. Listener onMessage reads the message and extract the file/ object contents from the message.

       

      The issue is that when I send either the file or the object in the message then the listener is able to extract the contents whereas if I send both the object and the file together then I get an "Invalid conversion" error in detachObject method while extracting the object contents.

       

      Is it possible to send the java object as well as a large file (as stream)  in the same message? Pls help!!

       

      Thanks

      Srinivaas