Right: I don't rule out using receive(timeout) and assertNull for a real test...
But so far in my 10 years working in messaging, I still haven't seen a case where assertNull(receiveNoWait) wasn't just fine. At least, please avoid it as much as you can On Wed, Sep 11, 2019 at 10:33 AM Robbie Gemmell <[email protected]> wrote: > > The Qpid JMS client will round trip to the server on any receive or > receiveNoWait calls where it doesnt have a message available locally > in time (unless it has been configured not to do so). > > On Wed, 11 Sep 2019 at 15:21, Clebert Suconic <[email protected]> > wrote: > > > > Even if that's the case.. It would eventually fail. > > > > As far as I know, AMQP client is sending a disposition to the server. > > > > At one point in Artemis we would just catch from the current local cache. > > > > It is the user's expectation to perform the roundtrip, even though > > there's nothing specified on the JMS API. > > > > Users would be complaining to qpid-jms if that was the case. > > > > > > There's no reason really to do Assert.assertNull(receive(5000)); > > > > On Wed, Sep 11, 2019 at 9:45 AM Jiri Daněk <[email protected]> wrote: > > > > > > On Wed, Sep 11, 2019 at 3:40 PM Clebert Suconic > > > <[email protected]> > > > wrote: > > > > > > > Instead, please use consumer.receiveNoWait(); > > > > > > > > > > Depending on which JMS client is used (artemis-core-jms, > > > activemq-jms-client, qpid-jms-client), receiveNoWait either does a > > > roundtrip to server to check for new messages, or it does not. This > > > difference can be important for the test. > > > > > > c.f. https://github.com/eclipse-ee4j/jms-api/issues/85 > > > -- > > > Mit freundlichen Grüßen / Kind regards > > > Jiri Daněk > > > > > > > > -- > > Clebert Suconic -- Clebert Suconic
