[long-polling] AbstractReflectorAtmosphereHandler does not resume on broadcast
When using a custom handler that extends AbstractReflectorAtmosphereHandler, with long-polling transport, connection does not get resumed when the message is broadcasted. The issue is with the resource associated with the onStateChange event; AtmosphereResource#resumeOnBroadcast() returns false for some reason.
Tested on 1.1.0beta2
Here's a workaround for now:
@Override
public void onStateChange(AtmosphereResourceEvent event) throws IOException {
super.onStateChange(event);
if (event.isResuming()){
return;
}
if(!event.getResource().resumeOnBroadcast() &&
event.getResource().transport().equals(TRANSPORT.LONG_POLLING)){
event.getResource().resume();
}
}
@nite23 Stupid question, but are you calling resumeOnBroadcast on the AtmosphereResource? If not, then just install the AtmosphereResourceLifecycleInterceptor so it does it for you. But by default, you need to call it.
Closing as not a bug.
Works now, thanks! I missed that one in documentation...