Key: COMETD-366
URL: http://bugs.cometd.org/browse/COMETD-366
Project: CometD
Issue Type: Bug
Components: java-client
Affects Versions: 2.4.1, 2.4.0, 2.4.0.beta1
Reporter: akram
Priority: Blocker
While subscribing to a channel after having handshaken successfully in an asynchronous way, messages are never received on the channel.
This is not the case when synchronous (.waitFor(10000, State.CONNECTED)) handshake is used.
I am reusing the same LongPollingTransport for both subscription. I am using a customized transport that adds authentication header to the Exchange object.
Here are some code Snippets:
httpClient = new HttpClient();
httpClient.start();
Map<String, Object> options = new HashMap<String, Object>();
ClientTransport transport = new MyLongPollingTransport(options, httpClient);
client = new BayeuxClient(Configuration.getServerURL() + COMET_PUBLISH_URI, transport);
ClientSessionChannel channel = client.getChannel(Channel.META_HANDSHAKE);
EventProcessor eventProcessor = new EventProcessor();
ClientSessionChannelListener handshakeListener = new HandshakeSuccesfulListener(eventProcessor, listener);
channel.addListener(handshakeListener);
client.handshake();
Then in the HandshakeSuccesfulListener.onMessage() method:
if (message.isSuccessful()) {
ClientSessionChannel push = channel.getSession().getChannel(COMET_SUBSCRIBE_URI + "/" + Configuration.getUsername());
push.subscribe(listener);
// push.addListener(listener); Tried this one with no difference
eventProcessor.init();
LOGGER.info("Handshake successful sur le channel {}", channel);
while ( !interrupted) {
eventProcessor.process();
}
}
While events are successfully posted on server side, they are never received on the channel.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: http://bugs.cometd.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira