Given a Java web application using CometD, how can I publish a message to all of a channel’s subscribers each time a message is processed by bayeux?
For testing, I used
serverSession.deliver(serverSession, "/test-channel", map, null);.
Should I be using some form of a client session? The CometD documentation appears to be a bit unclear.
localSession seems to be the answer. I implemented this to fix:
ClientSessionChannel channel = localSession.getChannel(getClientChannel()); channel.publish(map);
The clients are now receiving all messages.