You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "Jens Deppe (Jira)" <ji...@apache.org> on 2020/02/10 23:34:00 UTC

[jira] [Comment Edited] (GEODE-7778) Add PUBLISH, SUBSCRIBE and UNSUBSCRIBE Redis commands

    [ https://issues.apache.org/jira/browse/GEODE-7778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17034023#comment-17034023 ] 

Jens Deppe edited comment on GEODE-7778 at 2/10/20 11:33 PM:
-------------------------------------------------------------

Redis PUBLISH/SUBSCRIBE is described here: https://redis.io/topics/pubsub

This implementation introduces 3 new command classes to support this:
{{SubscribeExecutor}}, {{PublishExecutor}} and {{UnsubscribeExecutor}}. At a high
level, the flow is as follows:

* A Redis client issues a SUBSCRIBE command. The server maintains a list of
subscribed clients and associate channel(s) in the Subscribers class. A
subscribed Client uses Netty's notion of a uniqueID to identify itself
uniquely.
* When a client PUBLISHes a message on a channel, the publish 'event' uses an
onMembers function call to distribute the channel/message to all members.
Each member then publishes the message to any Clients registered on the
channel.

Points to note:
Redis pub/sub is not HA. i.e. A subscriber only receives those messages
published after it has successfully subscribed. If the client is disconnected
and reconnects, it will not receive messages published during the disconnect
window.

When clients subscribe, an open connection is established to the server and the
client blocks waiting for messages.

This implementation does not require messages to be published on the same
server to which the clients, executing subscribe, are connected since the
published message is distributed to all servers.


was (Author: jens.deppe):
Redis PUBLISH/SUBSCRIBE is described here: https://redis.io/topics/pubsub

This implementation introduces 3 new command classes to support this:
SubscribeExecutor, PublishExecutor and UnsubscribeExecutor. At a high
level, the flow is as follows:

A Redis client issues a SUBSCRIBE command. The server maintains a list of
subscribed clients and associate channel(s) in the Subscribers class. A
subscribed Client uses Netty's notion of a uniqueID to identify itself
uniquely.
When a client PUBLISHes a message on a channel, the publish 'event' uses an
onMembers function call to distribute the channel/message to all members.
Each member then publishes the message to any Clients registered on the
channel.
Points to note:
Redis pub/sub is not HA. i.e. A subscriber only receives those messages
published after it has successfully subscribed. If the client is disconnected
and reconnects, it will not receive messages published during the disconnect
window.

When clients subscribe, an open connection is established to the server and the
client blocks waiting for messages.

This implementation does not require messages to be published on the same
server to which the clients, executing subscribe, are connected since the
published message is distributed to all servers.

> Add PUBLISH, SUBSCRIBE and UNSUBSCRIBE Redis commands
> -----------------------------------------------------
>
>                 Key: GEODE-7778
>                 URL: https://issues.apache.org/jira/browse/GEODE-7778
>             Project: Geode
>          Issue Type: Improvement
>          Components: redis
>            Reporter: Jens Deppe
>            Assignee: Jens Deppe
>            Priority: Major
>          Time Spent: 3h 10m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)