Hello there:

I installed JBoss 4.0.3 SP1 and JBoss Messaging 1.0.0.GA. I ran the examples 
for queue and topic and they work fine.

Then for the topic example I separate the message producer and consumer into 
two applications and they work fine. Then I change the consumer to receive 
messages continuously in an infinite loop:

      connection = cf.createConnection();
      Session session = connection.createSession(false, 
Session.AUTO_ACKNOWLEDGE);
      MessageConsumer subscriber = session.createConsumer(topic);

      subscriber.setMessageListener(this);
      connection.start();

      while (true) {
        waitForMessage();
        TextMessage the_message = (TextMessage)getMessage();
        System.out.println("For topic " + topic + ": received message: " + 
the_message.getText());
      } //END while (true)

If the producer sends messages continuously, the consumer works fine. However, 
if the producer stops, the consumer gets a timeout exception:

10:03:03,082 ERROR @SocketServerInvokerThread-10.67.21.88-0 [ServerThread] 
socket timed out
java.net.SocketTimeoutException: Read timed out
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.read(SocketInputStream.java:129)
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:201)
        at java.io.FilterInputStream.read(FilterInputStream.java:66)
        at 
org.jboss.serial.io.JBossObjectInputStream.read(JBossObjectInputStream.java:126)
        at 
org.jboss.remoting.transport.socket.ServerThread.readVersion(ServerThread.java:464)
        at 
org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:381)
        at 
org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:498)
        at 
org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:240)


Does anyone have any idea? It doesn't make sense to me that the consumer should 
keep receiving messages or it will die for timeout exception.

Thank you in advance.

Xinyu





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

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


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to