2 Replies Latest reply on Sep 28, 2012 11:19 AM by fcosfc

    Problem pushing messages through the REST interface

    fcosfc Newbie

      Hi there!

       

         I'm working with the REST interface of the Hornetq 2.2.5 version, running as the JMS provider of a JBoss-4.2.1 GA application server. I've successfully deployed a .war, which has the HornetQ REST messaging interface. I can send messages properly, using the resources of the app. Now, I'm trying to push messages to a remote REST resource, so I sent a HEAD request, got the msg-push-consumers header and sent the following POST request:

       

      <push-registration>  

         <link href="http://remotehost:8081/TestREST/webresources/test" method="PUT" />

      </push-registration>"

       

         I reviewed the JBoss log and read:

       

      18:04:20,953 INFO  [PushConsumer] Push consumer started for: XmlLink{className='null', rel='null', href='http://remotehost:8081/TestREST/webresources/test', type='null', method='PUT'}

       

         But, when I try to send a JMS test message to the queue, I got the following exception:

       

      18:07:08,234 ERROR [ClientConsumerImpl] Failed to call onMessage()

      java.lang.IndexOutOfBoundsException

                at org.jboss.netty.buffer.AbstractChannelBuffer.checkReadableBytes(AbstractChannelBuffer.java:657)

                at org.jboss.netty.buffer.AbstractChannelBuffer.readBytes(AbstractChannelBuffer.java:337)

                at org.jboss.netty.buffer.AbstractChannelBuffer.readBytes(AbstractChannelBuffer.java:343)

                at org.hornetq.core.buffers.impl.ChannelBufferWrapper.readBytes(ChannelBufferWrapper.java:347)

                at org.hornetq.rest.util.HttpMessageHelper.buildMessage(HttpMessageHelper.java:97)

                at org.hornetq.rest.queue.push.UriStrategy.push(UriStrategy.java:82)

                at org.hornetq.rest.queue.push.PushConsumer.onMessage(PushConsumer.java:114)

                at org.hornetq.core.client.impl.ClientConsumerImpl.callOnMessage(ClientConsumerImpl.java:866)

                at org.hornetq.core.client.impl.ClientConsumerImpl.access$100(ClientConsumerImpl.java:44)

                at org.hornetq.core.client.impl.ClientConsumerImpl$Runner.run(ClientConsumerImpl.java:983)

                at org.hornetq.utils.OrderedExecutorFactory$OrderedExecutor$1.run(OrderedExecutorFactory.java:100)

                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

                at java.lang.Thread.run(Thread.java:722)

       

      Do you have any idea to fix the problem?

        • 1. Re: Problem pushing messages through the REST interface
          Justin Bertram Master

          The first thing I recommend is reproducing this on the latest non-alpha (i.e. 2.2.14).

          • 2. Re: Problem pushing messages through the REST interface
            fcosfc Newbie

            Hi Justin,

             

               Thank you very much for your response.

             

               I already tried to run JBoss-4.2.1 GA with HornetQ 2.2.14 as its JMS provider but I got an exception:

             

            17:13:56,468 WARN  [ServiceController] Problem starting service jboss.jca:service=RARDeployment,name='jms-ra.rar'

            java.lang.NoClassDefFoundError: org/jboss/tm/XAResourceRecovery

                      at org.hornetq.ra.recovery.RecoveryManager.locateRecoveryRegistry(RecoveryManager.java:131)

                      at org.hornetq.ra.recovery.RecoveryManager.start(RecoveryManager.java:55)

                      at org.hornetq.ra.HornetQResourceAdapter.start(HornetQResourceAdapter.java:226)

                      at org.jboss.resource.deployment.RARDeployment.startService(RARDeployment.java:109)

                      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)

                      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)

                      at org.jboss.system.ServiceDynamicMBeanSupport.invoke(ServiceDynamicMBeanSupport.java:124)

                      at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)

                      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)

                      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)

                      at $Proxy0.start(Unknown Source)

            ...

             

                Which it was reported like a bug of the version 2.2.14: https://issues.jboss.org/browse/HORNETQ-920 Unfortunately, I must use JBoss-4.2.1 in my project.

             

               Do you have any other idea?

             

            Best regards,

             

            Paco Saucedo.