Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[emergency]send data question on cluster Solution at wiki's suggestion #494

Closed
belugaliu opened this issue Nov 6, 2017 · 3 comments
Closed

Comments

@belugaliu
Copy link

belugaliu commented Nov 6, 2017

hi, i use netty-socketio:1.7.12, when i build cluster netty-socket-io servers(example: server A and Server B).then i found that the connect channel by redis pub only pub client session id(client1 connect serverA then serverA pub message by redis to server B, then in server B has client1's sessionId).but if i want that send data by server B to client1 is impossible. beacause server B only have sessionId not client, then i dont understand how the cluster solution solve i said Scenes. please my paste code:

// BaseStoreFactory.java
// sub connect msg,so namespace allClients have not sessionId mapps client
 pubSubStore().subscribe(PubSubType.CONNECT, new PubSubListener<ConnectMessage>() {
            @Override
            public void onMessage(ConnectMessage msg) {
                authorizeHandler.connect(msg.getSessionId());
                log.debug("{} sessionId: {}", PubSubType.CONNECT, msg.getSessionId());
            }
        }, ConnectMessage.class);
// Namespace.java
// send msg to browser client
    public Iterable<SocketIOClient> getRoomClients(String room) {
        Set<UUID> sessionIds = roomClients.get(room);
        if (sessionIds == null) {
            return Collections.emptyList();
        }
        List<SocketIOClient> result = new ArrayList<SocketIOClient>();
        for (UUID sessionId : sessionIds) {
            SocketIOClient client = allClients.get(sessionId);
            if(client != null) {
                result.add(client);
            }
        }
        return result;
    }
@belugaliu belugaliu changed the title send data question on cluster Solution at wiki's suggestion [emergency]send data question on cluster Solution at wiki's suggestion Nov 6, 2017
@wuxudong
Copy link
Contributor

The question is same as #504 .
In a word, Impossible .

@yogeshkaushik
Copy link

@liuliliGithub

then i dont understand how the cluster solution solve i said Scenes

According to my understanding - the cluster solution provided in netty-socketio is for broadcasting messages across multiple servers not for the scenario you have mentioned. Have a look at class BroadcastOperations.

Here is stackoverflow link for the same doubt.

@belugaliu
Copy link
Author

ok, i will try broadcastOperation.then i reply comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants