Good catch, although your solution is wrong. :-)

If you don't reply to the message, it will gradually build up
on the server as an unreplied message and you will run out of memory.
You will also be blocking delivery threads waiting for the reply.

The sendReply should be trimming the message (it is missing from
org.jboss.mq.il.uil2.msgs.ReceiveRequestMsg)


  |    public void trimReply()
  |    {
  |       messages = null;
  |    }
  | 

However, your solution brings an interesting point.
The server does not need to know at this point whether the messages were 
actually
received (that is handled by acknowledgements).

It only needs to know whether there is an error communicating with the
client so you are not continually writing messages into a broken connection.

So a better fix is to send the ReceiveRequest as a "one-way" message:
UILClientIL

  |    public void receive(ReceiveRequest messages[])
  |           throws Exception
  |    {
  |       ReceiveRequestMsg msg = new ReceiveRequestMsg(messages);
  | - socketMgr.sendMessage(msg);
  | +      socketMgr.sendReply(msg);
  |    }
  | 
UILClientILService

  |          case m_receiveRequest:
  |             ReceiveRequestMsg rmsg = (ReceiveRequestMsg) msg;
  |             ReceiveRequest[] messages = rmsg.getMessages();
  |             connection.asynchDeliver(messages);
  | - socketMgr.sendReply(msg);
  |             break;
  | 

But then we need to add code to the WriteTask so it can signal
on the server side that the message didn't make it to the client.
Currently, this is given to the thread waiting for the response:

  |          if (msg != null)
  |          {
  |             msg.setError(e);
  |             synchronized (msg)
  |             {
  |                msg.notify();
  |             }
  |          }
  | 

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3870100#3870100

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3870100


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to