Hi all,
 
When I call TopicSubscriber.subscribe (timeoutvalue) the call does not seem to return in a time-out situation. It just waits forever.
According to spec the timeoutvalue is specified in milliseconds.
Anyone knows of this problem? Is there some setup needed for a time-out call to work properly?
 
Code sample:
 
        TopicConnectionFactory factory =
        (TopicConnectionFactory)new InitialContext().lookup(.......);
        TopicConnection connection = factory.createTopicConnection();
        Topic topic = (Topic)new InitialContext().lookup(.........);
        TopicSession session = connection.createTopicSession(false, TopicSession.CLIENT_ACKNOWLEDGE);
        TopicSubscriber subscriber = session.createSubscriber(topic);
        connection.start();
            
        Message theMessage = subscriber.receive (5000); // MAY HANG, BUT SHOULD WAIT AT MOST 5 SECS.....
 
The test program on the other side is abruptly stopping its message delivery, either through a hard cut-wire, or through System.exit(-1). We want to be able to cope with abruptly stopping clients. Can this influence in some ways?
 
It is in theory to work around this problem using subscribe() with no parameters and start a separate time-out/killer thread, but it seems very odd and awkward.....
 
Thanks in advance for any ideas.
 
/August
 

Reply via email to