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

Update RedisOperations#convertAndSend to return number of subscribers #2209

Closed
vpavic opened this issue Dec 6, 2021 · 1 comment
Closed
Assignees
Labels
theme: 4.0 type: enhancement A general enhancement

Comments

@vpavic
Copy link
Contributor

vpavic commented Dec 6, 2021

Currently, RedisOperations#convertAndSend is void event though the underlying RedisPubSubCommands#publish returns a Long that represents the number of subscribers receiving the published message (see https://redis.io/commands/publish).

The information about the number of subscribers can be useful in some scenarios, and is also returned by the reactive counterpart in ReactiveRedisOperations#convertAndSend.

Digging through the history of RedisOperations, it seems that #convertAndSend used to return Long for a brief period of time in 2013: it was introduced in b35f6a3 and reverted in d46bee7.

I understand that adding return value would be a breaking change, but the impact doesn't seem to be too big (?). I'm willing to submit a PR to address this, if the change is welcome.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Dec 6, 2021
@mp911de
Copy link
Member

mp911de commented Dec 7, 2021

Thanks for the report. Seems the method signature was reverted to keep binary compatibility. We could consider the change for the next major revision of Spring Data Redis.

@mp911de mp911de added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Dec 7, 2021
vpavic added a commit to vpavic/spring-data-redis that referenced this issue Jan 5, 2022
…eceiving the message.

Currently, `RedisOperations#convertAndSend` is void event though the underlying `RedisPubSubCommands#publish` returns a `Long` that represents the number of clients receiving the published message (see https://redis.io/commands/publish).

This commit updates `RedisOperations#convertAndSend` to return the number of clients that received the message.

Closes spring-projects#2209
vpavic added a commit to vpavic/spring-data-redis that referenced this issue Jan 5, 2022
…eceiving the message.

Currently, `RedisOperations#convertAndSend` is void event though the underlying `RedisPubSubCommands#publish` returns a `Long` that represents the number of clients receiving the published message (see https://redis.io/commands/publish).

This commit updates `RedisOperations#convertAndSend` to return the number of clients that received the message.

Closes spring-projects#2209
vpavic added a commit to vpavic/spring-data-redis that referenced this issue Jan 5, 2022
…eceiving the message.

Currently, `RedisOperations#convertAndSend` is void event though the underlying `RedisPubSubCommands#publish` returns a `Long` that represents the number of clients receiving the published message (see https://redis.io/commands/publish).

This commit updates `RedisOperations#convertAndSend` to return the number of clients that received the message.

Closes spring-projects#2209
mp911de added a commit that referenced this issue Mar 31, 2022
Reformat code. Refine tests as we do not require assertions for every publish command when testing listeners.

See #2209
Original pull request: #2225.
@mp911de mp911de added this to the 3.0 M4 (2022.0.0) milestone Mar 31, 2022
@mp911de mp911de self-assigned this Mar 31, 2022
mp911de added a commit that referenced this issue Mar 31, 2022
Refine tests as we do not require assertions for every publish command when testing listeners.

See #2209
Original pull request: #2225.
mp911de added a commit that referenced this issue Mar 31, 2022
Refine tests as we do not require assertions for every publish command when testing listeners.

See #2209
Original pull request: #2225.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme: 4.0 type: enhancement A general enhancement
Projects
None yet
3 participants