users@glassfish.java.net

Re: Durable subscription for topic connection factory

From: <glassfish_at_javadesktop.org>
Date: Wed, 04 Mar 2009 02:57:56 PST

Hi,

is this topic still not solved?

We have the same problem here with a cluster environment.

A WebService will call a stateless bean.

Following Code fails after the second call:

TopicSubscriber subscriber = null;
        MessageProducer producer = null;
        TopicSession session = null;
        TopicConnection connection = null;
        List<dbchangeentry> ret = new ArrayList<dbchangeentry>();
        try
        {
            String txt = null;
            connection = (TopicConnection) changedFactory.createConnection();

            if (connection.getClientID()==null)
            {
                connection.close();
                return ret;
            }

            connection.start();

            session = connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
            subscriber = session.createDurableSubscriber(changedT, id);

            Message msg = msg = subscriber.receiveNoWait();

            subscriber.close();
            session.close();
            connection.close();
[Message sent by forum member 'obiwan007' (obiwan007)]

http://forums.java.net/jive/thread.jspa?messageID=335009