"[EMAIL PROTECTED]" wrote : Moderated: Show me some evidence you haven't just 
posted this error message
  | into the forums without first doing some research. Sigh!

In the JBOSS-3.2.4.
Use the DefaultDS(hypersonic) to save message. 
If the size of the message(only a message once) is over 1M, JBOSS send a 
message:
     09:15:45,281 INFO  [STDOUT] java.lang.OutOfMemoryError
     09:15:45,406 INFO  [STDOUT] **** Reply Message 
Errororg.jboss.mq.SpyJMSException: Could not store message: 2 msg=0 hard 
NOT_STORED PERSISTENT queue=QUEUE.A priority=4 lateClone=false 
hashCode=6951232; - nested throwable: (java.sql.SQLException: out of memory)

This tiny code snippet 
In the client:
////////////////////////////////////////////////////////////////////////////////////
     //getInitialContext: Initialize context by IP.
     InitialContext iniCtx =  getInitialContext();
        Object tmp = iniCtx.lookup("ConnectionFactory"); 
//java:/XAConnectionFactory ConnectionFactory
        QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
        conn = qcf.createQueueConnection();
        queA = (Queue) iniCtx.lookup(strRQueue);
        queB = (Queue) iniCtx.lookup(strLQueue);
        session = conn.createQueueSession(false,
                                          QueueSession.AUTO_ACKNOWLEDGE);
        conn.start();
        
         // Set the async listener for queB        
        QueueReceiver recv = session.createReceiver(queB);
        recv.setMessageListener(new ExListener());

        // Send a few text msgs to queA
        QueueSender send = session.createSender(queA);
        TextMessage tm = session.createTextMessage(m_strCommand);
        tm.setJMSReplyTo(queB);
        send.send(tm);


/////////////////////////////////////////////////////////////////////////////////////
In the server, use MDB:
    //get response message content
    //SessionBean is a session bean
    Inputstream inStream  = SessionBean.getMessageContent(....);

    Queue dest = (Queue) message.getJMSReplyTo();    
    QueueSender sender = queueSession.createSender(dest);
    
    BytesMessage tm = queueSession.createBytesMessage();    
    tm.setJMSType("BytesMessage");
    
    if (inStream != null)
    {
            byte[] data = new byte[1024];    
            while((count = inStream.read(data, 0, 1024)) != -1){
                tm.writeBytes(data, 0, count);
            }       
            inStream.close();
    }
    
    sender.send(tm);   
    // If the size of message reach 1M, error message is sent. 
    // If the size of message is less than 1M, this is ok.

    sender.close();

///////////////////////////////////////////////////////////////////////////////////

How to deal with it?
Thanks.


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

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


-------------------------------------------------------
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