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

Ping command is not supported in Pub/Sub connection #1601

Closed
TsybulskyStepan opened this issue Jan 26, 2021 · 1 comment
Closed

Ping command is not supported in Pub/Sub connection #1601

TsybulskyStepan opened this issue Jan 26, 2021 · 1 comment
Labels
type: task A general task
Milestone

Comments

@TsybulskyStepan
Copy link

Bug Report

Current Behavior

When I try to send PING command into Pub/Sub connection I'm getting a following error message:

io.lettuce.core.RedisException: Command PING not allowed while subscribed. Allowed commands are: [PSUBSCRIBE, QUIT, PUNSUBSCRIBE, SUBSCRIBE, UNSUBSCRIBE]

Test

@Test
public void whenPingInPubSub_PongIsReturned() {
    RedisClient client = RedisClient.create(RedisURI.builder().withHost("localhost").withPort(6379).build());

    RedisPubSubReactiveCommands<String, String> pubsub = client.connectPubSub().reactive();

    Mono<Void> subscribe = pubsub.subscribe("channel-test");
    Mono<String> ping = Mono.delay(Duration.ofSeconds(1)).flatMap(tick -> pubsub.ping());

    Mono<String> pingAfterSubscription = subscribe.then(ping);

    StepVerifier
        .create(pingAfterSubscription)
        .expectNextMatches("PONG"::equals)
        .verifyComplete();
}

Expected behavior/code

As it was already discussed Lettuce version 6.0.x and above should permit PING command in Pub/Sub channels as it has already being supported by Redis 6.

Environment

  • Lettuce version: 6.0.1.RELEASE
  • Redis version: 6.0.9

Possible Solution

It's required to extend a list of allowed commands.

@mp911de mp911de added the type: task A general task label Jan 27, 2021
@mp911de mp911de added this to the 6.0.3 milestone Jan 27, 2021
mp911de pushed a commit that referenced this issue Mar 4, 2021
mp911de pushed a commit that referenced this issue Mar 4, 2021
@mp911de mp911de closed this as completed Mar 4, 2021
@mp911de
Copy link
Collaborator

mp911de commented Mar 4, 2021

That's in place now.

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

Successfully merging a pull request may close this issue.

2 participants