4 Replies Latest reply on Jul 22, 2014 2:51 AM by Markus Falk

    Cannot receive paged message

    Markus Falk Newbie

      Thx for the hint Justin, didn't notice that I've created a Document. Here again:




      I have two questions regarding the paging mechanism of HornetQ.


      Recently I added many messages to a Queue running in WildFly 8.1.0. Then I wanted to receive a message identified by its JMSMessageID, but I didn't get it.


      So I made some more investigation:


      - The javax.jms.QueueBrowser only gets the non paged messages

      - A javax.jms.MessageConsumer with a filter on a paged JMSMessageID won't receive it

      - A cli like 'jms-queue expire-message --queue-address=DLQ --filter=ID:129d6ae3-08d5-11e4-81e7-4f77d79c7f16' will fail with 'JBAS014749: Operation handler failed: No message found for JMSMessageID: ID:129d6ae3-08d5-11e4-81e7-4f77d79c7f16'

      - When I consume all message in the Queue with the javax.jms.MessageConsumer, I'm able to find the wanted message

      - When I use the cli 'jms-queue list-messages --queue-address=DLQ --filter="JMSMessageID='ID:129d6ae3-08d5-11e4-81e7-4f77d79c7f16'' or if I show all messages without a filter, the message is found. But I also saw that in this case the HorentQ Queue itself is used for iterating (hornetq/hornetq-server/src/main/java/org/hornetq/core/management/impl/QueueControlImpl.java at HornetQ_2_4_1_Final · hor… (method listMessages)).


      In the HornetQ Documentation (hornetq/docs/user-manual/en/paging.xml at HornetQ_2_4_1_Final · hornetq/hornetq · GitHub) there are statements like this:

      Browsers will read through the page-cursor system.

      Consumers with selectors will also navigate through the page-files and it will ignore messages that don't match the criteria.


      When I look in the org.hornetq.api.core.client.ClientSession the Javadoc looks like this (should be used by the QueueBrowser ;-) ):



          * Creates a ClientConsumer to consume or browse messages matching the filter from the queue with

          * the given name.

          * <p>

          * If <code>browseOnly</code> is <code>true</code>, the ClientConsumer will receive the messages

          * from the queue but they will not be consumed (the messages will remain in the queue). Note

          * that paged messages will not be in the queue, and will therefore not be visible if

          * {@code browseOnly} is {@code true}.

          * <p>

          * If <code>browseOnly</code> is <code>false</code>, the ClientConsumer will behave like consume

          * the messages from the queue and the messages will effectively be removed from the queue.

          * @param queueName name of the queue to consume messages from

          * @param filter only messages which match this filter will be consumed

          * @param windowSize the consumer window size

          * @param maxRate the maximum rate to consume messages

          * @param browseOnly whether the ClientConsumer will only browse the queue or consume messages.

          * @return a ClientConsumer

          * @throws HornetQException if an exception occurs while creating the ClientConsumer




      ---------------------------------------------end code-------------------------------------------



      So my question:

      Is it possible to receive the message with standard JMS 1.1 implementations?

      If it is not possible do I have to configure things in a different way like the standard-full-ha.xml or do I have to use different browsers and consumers perhaps HornetQ native ones?


      Thanks in advance for any helpful hint.




        • 1. Re: Cannot receive paged message
          Andy Taylor Master

          messages that are currently paged are not yest in the queue, paging happens at routing time. If you are sending lots of messages with lots of different selectors then this may occur. note that pattern is extremely non performant. you may have tothink of a better approach (maybe topics) or tweak your address settings to suit

          1 of 1 people found this helpful
          • 2. Re: Cannot receive paged message
            Markus Falk Newbie

            Hi Andy,


            thx for your answer. I have some more now:


            The stuff you mention here are also described in the 2.2.5 user manual (HornetQ User Manual). Are these 'Notes' there still existent in the current release?

            So actually (JMS?) Browsers will not be able to browse through the page-curser system and there is no way to get the wanted messages but to consume them all and see if one (or several) fits? Then yes, this would be extremely non performant ;-)


            When I got your answer the right way, the pattern we use should be changed. Correct?


            Thanks and cheers,


            • 3. Re: Cannot receive paged message
              Justin Bertram Master

              It sounds to me like you're trying to use the message broker like a database (i.e. a place to store lots of data that you can then query to get the specific information you want).  This is not a good use-case for a message broker.

              • 4. Re: Cannot receive paged message
                Markus Falk Newbie

                Hi Justin,


                thx for the response. I read about this also in a different thread, that you wrote its an antipattern to use the messaging system as a database.


                I was just curious to know, if its generally possible somehow to get also the paged messages with the JMS implementation of HornetQ? Because the documentation indicates to me that it should be possible ;-)