JBoss Community

How to implement long polling/server push with JBoss

created by laures in JBoss Web Services - View the full discussion

Hi,

 

i want to use http server push / long polling / whatever its called right now, in my next webservice.

 

one way (a very bad, non scaling way) to do that is like this:

 

@WebService(serviceName="mywebservice")

@Stateless
public class MyWebService {
    @WebMethod
    public String longPoll() {
         short ct = 0;
         while(someCondition == false && ct < 60) {
             sleep(1000);  // 1 sec
             ct++;
         }
         if (someCondition)
             return "got value";
         else
             return "";
    }
}

As i said, this dowsn't scale, but should demonstrate what i want to do. I've been looking for an alternative way and found two interesting things:

 

I hope you can point me in the right direction.

Reply to this message by going to Community

Start a new discussion in JBoss Web Services at Community