5 Replies Latest reply on Jul 11, 2013 4:18 AM by ataylor

    Convert ClientMessage to TextMessage

    123avi

      Our server uses org.hornetq.api.core.client ClientMessage and user trying to send a message to the queue using jms TextMessage .

      receive code

       

      def createReceiveActor(receiveMethod: MessageBusClient.PartialReceiveType): ActorRef = {

      // create the actor
      val caller =
        actorOf
      (new Actor {
         
      protected def receive = {
           
      case message: org.hornetq.api.core.client.ClientMessage => {
                   
      val text = message.getBodyBuffer.readString}}

       

      sender code

      session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE)

      producer = session.createProducer(queue)

      val txtMessage:javax.jms.TextMessage = session.createTextMessage("helloWorld")

      producer.send(txtMessage)

      is there a way that the receiver will read the message without using JMS ? converting the avax.jms.TextMessage to org.hornetq.api.core.client.ClientMessage ?