[jboss-jira] [JBoss JIRA] Commented: (JBMESSAGING-1140) QueueReceiver starts out of sync with the server, so receiveNoWait always returns null

Tim Fox (JIRA) jira-events at lists.jboss.org
Wed Nov 7 06:13:45 EST 2007


    [ http://jira.jboss.com/jira/browse/JBMESSAGING-1140?page=comments#action_12386315 ] 
            
Tim Fox commented on JBMESSAGING-1140:
--------------------------------------

Well... the Queue browser queries the actual server queue for the messages, whereeas receiveNoWait acts only on the client buffer.

So there's a window between the message arriving on the server queue and reaching the client where it will be visible for browsing but not for receiveNoWait.

It depends how you define "available". If we define available as "in the client side buffer" then current behaviour is ok, if we define "available" as in the server side queue, then current behaviour is not ok.

Since the JMS spec does not offer its own definition of "available" we are free to choose. So let's choose "in the client buffer" -in which case there is nothing to fix.

Also note that JMS spec specifically says that queue browsing is not an exact snapshot of the queue at any time - i.e. never rely on queue browsing to accurately reflect what is available for consumption.


> QueueReceiver starts out of sync with the server, so receiveNoWait always returns null
> --------------------------------------------------------------------------------------
>
>                 Key: JBMESSAGING-1140
>                 URL: http://jira.jboss.com/jira/browse/JBMESSAGING-1140
>             Project: JBoss Messaging
>          Issue Type: Bug
>          Components: JMS Client Manager
>    Affects Versions: 1.4.0.SP1
>            Reporter: Carlo de Wolf
>         Assigned To: Tim Fox
>
> When there is a single message on the queue the browser will correctly report 1 message, but the receiver will not receive it right away.
>       QueueBrowser browser = session.createBrowser(queue);
>       Enumeration e = browser.getEnumeration();
>       List messages = CollectionsUtil.list(e);
>       QueueReceiver receiver = session.createReceiver(queue);
>       message = (TextMessage) receiver.receiveNoWait();
> 2007-11-06 13:58:06,437 TRACE [org.jboss.jms.client.JBossSession] attempting to create consumer for destination:JBossQueue[DLQ]
> 2007-11-06 13:58:06,438 TRACE [org.jboss.jms.client.delegate.DelegateSupport] SessionDelegate[1802245312, ID=c8a-r0sgfo8f-1-hnjqbo8f-ilci1t-110j3] invoking org.jboss.jms.wireformat.SessionCreateConsumerDelegateRequest at 2e7857a5 synchronously on server using Client[838449156]
> 2007-11-06 13:58:06,480 TRACE [org.jboss.jms.client.delegate.DelegateSupport] SessionDelegate[1802245312, ID=c8a-r0sgfo8f-1-hnjqbo8f-ilci1t-110j3] got server response for org.jboss.jms.wireformat.SessionCreateConsumerDelegateRequest at 2e7857a5: org.jboss.jms.wireformat.SessionCreateConsumerDelegateResponse at 1d30b5e2
> 2007-11-06 13:58:06,484 TRACE [org.jboss.jms.client.delegate.DelegateSupport] ConsumerDelegate[1910585900, ID=j8a-itsgfo8f-1-hnjqbo8f-ilci1t-110j3] invoking org.jboss.jms.wireformat.ConsumerChangeRateRequest at 79b2591c synchronously on server using Client[838449156]
> 2007-11-06 13:58:06,486 TRACE [org.jboss.jms.client.delegate.DelegateSupport] ConsumerDelegate[1910585900, ID=j8a-itsgfo8f-1-hnjqbo8f-ilci1t-110j3] got server response for org.jboss.jms.wireformat.ConsumerChangeRateRequest at 79b2591c: org.jboss.jms.wireformat.NullResponse at 468034b6
> 2007-11-06 13:58:06,488 TRACE [org.jboss.jms.client.container.ClientConsumer] ClientConsumer[j8a-itsgfo8f-1-hnjqbo8f-ilci1t-110j3] receiving, timeout = -1
> 2007-11-06 13:58:06,488 TRACE [org.jboss.jms.client.container.ClientConsumer] ClientConsumer[j8a-itsgfo8f-1-hnjqbo8f-ilci1t-110j3]: receive, noWait
> 2007-11-06 13:58:06,488 TRACE [org.jboss.jms.client.container.ClientConsumer] ClientConsumer[j8a-itsgfo8f-1-hnjqbo8f-ilci1t-110j3]: no message available
> 2007-11-06 13:58:06,545 TRACE [org.jboss.jms.client.container.ClientConsumer] org.jboss.jms.client.container.ClientConsumer$HandleMessageRunnable at 66201d6d receiving message delegator->JBossMessage[58368]:PERSISTENT, deliveryId=1 from the remoting layer
> 2007-11-06 13:58:06,545 TRACE [org.jboss.jms.client.container.ClientConsumer] org.jboss.jms.client.container.ClientConsumer$HandleMessageRunnable at 66201d6d added message(s) to the buffer are now 1 messages

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list