1 Reply Latest reply on Mar 3, 2010 1:27 PM by peterj

    Receiving message instanceof org.jboss.jms.message.ObjectMessageProxy in MDB

      Hi,

      In my application,a JMS client (using JBOSS client jars) publishes messages of Object type to a queue configured on JBOSS 5.1.0 GA . The message received by JBOSS is of type org.jboss.jms.message.ObjectMessageProxy  and NOT javax.jms.ObjectMessage . Hence in MDB , I am having to check

      if(message instanceof org.jboss.jms.message.ObjectMessageProxy){}

       

      Since the application is required to be portable to other application servers , it is desirable to eliminate JBOSS pacakge dependecies.Instead of the above check , I would like to have

      if

       

      (message instanceof ObjectMessage){}

       

      Please let me know how to address this.

       

      Thankyou!

        • 1. Re: Receiving message instanceof org.jboss.jms.message.ObjectMessageProxy in MDB
          peterj

          javax.jms.ObjectMessage is an interface. org.jboss.jms.message.ObjectMessageProxy  implements that interface. Thus you can cast the received object to javax.jms.ObjectMessage without any problems.

           

          By the way, if you ran your same code with another messaging system and looked at the type, you would find that the type is specific to that messaging system. And you will find that that type also implements javax.jms.ObjectMessage.