Atmosphere/atmosphere — Issue #187: jquery pubsub behaves differently using long-polling and websocket 
Author: maxqua72
Created: 2012-02-16 20:52:34+00:00
State: open

I made a little change in JQueryPubSub.java adding @Path("/{uid}/
{key}") as below

@POST
@Path("/{uid}/{key}")
@Broadcast
public Broadcastable publish(@FormParam("message") String message,
@PathParam("uid") Integer uid, @PathParam("key") String key) {
return new Broadcastable(message, "", topic);
}

The client is the same for both websocket and long polling, the
client code is the same as the original pubsub with the slight add-on
in the location path:
/pubsub/pubsub/pippo/2/khkhgkh in order to simulate the uid and key.

The principle is that two clients can subscribe to the same topic but
only if they are identified users they can pubblish their messages, so
they have to add an userid and a passwordkey in order to push
something.
Using long-polling everything works ok but switching to websocket an error message occurs on the server:

DEBUG o.a.c.version.Jetty8WebSocket - 405 Method Not Allowed
WARN o.a.w.protocol.SimpleHttpProtocol - Status code higher than 400
Status 405 Message Method Not Allowed

The modified pubsub is on line @ http://www.mindthecheck.com/pubsub/
Other info in the thread:
http://groups.google.com/group/atmosphere-framework/browse_thread/thread/728d823bbeeba3a5#