Hi ,

We are using QueueRequestor to send messages. We we try to close thr requestor we get 
Warning Exception. 

Client request resulted in a server exception: 
javax.jms.InvalidDestinationException: The subscription was registered with a 
destination that does not exist !
        at 
org.jboss.mq.server.ClientConsumer.removeSubscription(ClientConsumer.java:246).


Here is the piece of code which uses QueueRequestor 

   public Object sendRequest(String requestQName, Object data) throws JMSException, 
NamingException {
        Queue requestQueue = (Queue) ctx.lookup(requestQName);
        QueueSession queueSession = queueConnection.createQueueSession(false, 
Session.AUTO_ACKNOWLEDGE);
        Message message = formatMessage(queueSession, data);
        QueueRequestor requestor = null;

        try {

            requestor = new QueueRequestor(queueSession, requestQueue);
            queueConnection.start();

            Message reply = requestor.request(message);

            return ((ObjectMessage) reply).getObject();
        } finally {
            if (requestor != null) {
                requestor.close();
            }
        }
    }




This Warning is not seen is Websphere.

We also found the possible cause.

In The SpyTemporaryQueue delete method

    public void delete()
        throws JMSException
    {
        try
        {
            con.deleteTemporaryDestination(this);
        }
        catch(Exception e)
        {
            throw new SpyJMSException("Cannot delete the TemporaryQueue", e);
        }
    }

tries to delete TemporaryDestination, but the reciever is not closed.

In websphere it is Temporary queues are marked as closed but are not deleted.

if we see the QueueRequestor class in the constructor it creates _replyQueue  and 
_replyReceiver 
    public QueueRequestor(QueueSession session, Queue queue)
        throws JMSException
    {
        _queueSession = null;
        _queue = null;
        _requestSender = null;
        _replyReceiver = null;
        _replyQueue = null;
        _queueSession = session;
        _queue = queue;
        _requestSender = _queueSession.createSender(_queue);
        _replyQueue = _queueSession.createTemporaryQueue();
        _replyReceiver = _queueSession.createReceiver(_replyQueue);
    }

but while deleting _replyQueue  it is not taken care to close _replyReceiver.

I guess SpyTemporaryQueue should be taken care something like what websphere is used.

Could any one you, have come across same problem and have found any fix please let us 
know. 

Thanks
Srinivas







<a 
href="http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3827160#3827160";>View 
the original post</a>

<a 
href="http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3827160>Reply 
to the post</a>


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to