5 Replies Latest reply: May 1, 2012 3:09 PM by Jim Brownfield RSS

sendNowWith(RequestDispatcher) from server sends message to multiple browsers

Jim Brownfield Newbie

I have a server endpoint with a method:

 

    private void messageClientsForLogin(String username, String loginStatus, Exception ex) {
        MessageBuilder.createMessage().toSubject("ClientLoginStatus").signalling().with("LoginStatus", loginStatus)
                .with("Username", username).with("Exception", ex).errorsHandledBy(new ErrorCallback() {
                    public boolean error(Message message, Throwable throwable) {
                        log.error("Error sending login status to client(s): " + message.toString(), throwable);
                        return true;
                    }
                }).sendNowWith(dispatcher);
    }

 

I would like this message to go only to tabs and windows within the same HTTP session ID -- i.e. multiple windows/tabs within the same browser.  That's what I thought happened if I didn't execute a "sendGlobalWith" method.

 

However, when I attach from Chrome and from Safari simultaneously, the message is delivered to both browsers even though they are in different HTTP sessions.

 

Is my understanding of server-to-client message delivery incorrect, and if so, is there a way just to send to all client connections within the same HTTP session?