Consultor Eletrônico



Kbase P20607: SonicMQ: Large message not received with receiveNoWait() method
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/15/2008
Status: Unverified

FACT(s) (Environment):

SonicMQ

SYMPTOM(s):

Large message not received with receiveNoWait() method in Pub/Sub model

CAUSE:

Basically what you are seeing is behaving like described within the JMS spec
(9.1.3.7 Start Delivery of Messages) and the SonicMQ development guide
(Starting, Stopping, and Closing Connections) as well.

What is happening precisely is that before you start the connection no
messages are delivered to the message consumer. After you start the
message delivery thread with connection.start() the SonicMQ broker
starts to deliver messages to the SonicMQ client. If that takes longer
in time because of the size of the messages than there will still no message
be available to the message consumer. Since the

receiveNoWait() method does not wait until the messages are available
you will not get a message from the message consumer yet and
what you are seeing is expected behavior.

FIX:

The proper way to code it to avoid that problem is to use a MessageListener instead by implementing the MessageListener interface with it's onMessage method.
A simple example for doing that you will find with the Chat example.