]
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@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@2e7857a5:
org.jboss.jms.wireformat.SessionCreateConsumerDelegateResponse@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@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@79b2591c:
org.jboss.jms.wireformat.NullResponse@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@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@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: