Java client: receive pubsub messages#385
Merged
Yury-Fridlyand merged 12 commits intojava/integ_yuryf_pubsubfrom Jun 26, 2024
Merged
Java client: receive pubsub messages#385Yury-Fridlyand merged 12 commits intojava/integ_yuryf_pubsubfrom
Yury-Fridlyand merged 12 commits intojava/integ_yuryf_pubsubfrom
Conversation
Signed-off-by: Yury-Fridlyand <[email protected]>
Signed-off-by: Yury-Fridlyand <[email protected]>
Signed-off-by: Yury-Fridlyand <[email protected]>
Signed-off-by: Yury-Fridlyand <[email protected]>
Yury-Fridlyand
commented
Jun 21, 2024
java/client/src/main/java/glide/connectors/handlers/MessageHandler.java
Outdated
Show resolved
Hide resolved
| /// Recursively calls to [`redis_value_to_java`] for every element. | ||
| /// | ||
| /// Returns an arbitrary java `Object[]`. | ||
| fn array_to_java_array<'local>(env: &mut JNIEnv<'local>, values: Vec<Value>) -> JObject<'local> { |
Author
There was a problem hiding this comment.
Moved from Value::Array handling from above
Signed-off-by: Yury-Fridlyand <[email protected]>
Signed-off-by: Yury-Fridlyand <[email protected]>
Signed-off-by: Yury-Fridlyand <[email protected]>
Signed-off-by: Yury-Fridlyand <[email protected]>
df87657 to
30005f8
Compare
aaron-congo
approved these changes
Jun 25, 2024
acarbonetto
reviewed
Jun 25, 2024
| * with a callback. | ||
| * @return A message if any or <code>null</code> if there are no unread messages. | ||
| */ | ||
| public Message tryGetPubSubMessage() { |
There was a problem hiding this comment.
why "try"? what is the purpose of this method vs getPubSubMessage?
Author
There was a problem hiding this comment.
I followed python client namings: https://github.com/aws/glide-for-redis/pull/1616/files#diff-f0f69819afe466c0f3e8afd4ea2fd31ca4f451373fa8ed1351f48473a1c39633R5042
async def get_pubsub_message(self) -> PubSubMsg:
def try_get_pubsub_message(self) -> Optional[PubSubMsg]:| public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { | ||
| // TODO: log thru logger | ||
| System.out.printf("=== exceptionCaught %s %s %n", ctx, cause); | ||
| cause.printStackTrace(); |
Author
There was a problem hiding this comment.
I think we need to log it through logger too.
Signed-off-by: Yury-Fridlyand <[email protected]>
Signed-off-by: Yury-Fridlyand <[email protected]>
5 tasks
Signed-off-by: Yury-Fridlyand <[email protected]>
…va/integ_yuryf_pubsub_receive Signed-off-by: Yury-Fridlyand <[email protected]>
jamesx-improving
pushed a commit
that referenced
this pull request
Jul 1, 2024
* Java: Add client configuration for subscribing to channels. (#381) * Add client configuartion for subscribing to channels. Signed-off-by: Yury-Fridlyand <[email protected]> * CLIPPY I HATE YOU Signed-off-by: Yury-Fridlyand <[email protected]> * Get and store callback. Signed-off-by: Yury-Fridlyand <[email protected]> * Fix tests. Signed-off-by: Yury-Fridlyand <[email protected]> * Rework configuration and add docs. Signed-off-by: Yury-Fridlyand <[email protected]> * Config rework. Signed-off-by: Yury-Fridlyand <[email protected]> * docs Signed-off-by: Yury-Fridlyand <[email protected]> * More TODOs for the god of TODOs. Signed-off-by: Yury-Fridlyand <[email protected]> --------- Signed-off-by: Yury-Fridlyand <[email protected]> * Add `PUBLISH` and `SPUBLISH` commands. (#391) * Add `PUBLISH` and `SPUBLISH` commands. Signed-off-by: Yury-Fridlyand <[email protected]> * Fix the test. Signed-off-by: Yury-Fridlyand <[email protected]> --------- Signed-off-by: Yury-Fridlyand <[email protected]> * Java client: receive pubsub messages (#385) * Add client configuartion for subscribing to channels. Signed-off-by: Yury-Fridlyand <[email protected]> * CLIPPY I HATE YOU Signed-off-by: Yury-Fridlyand <[email protected]> * Get and store callback. Signed-off-by: Yury-Fridlyand <[email protected]> * Fix tests. Signed-off-by: Yury-Fridlyand <[email protected]> * Rework configuration and add docs. Signed-off-by: Yury-Fridlyand <[email protected]> * Config rework. Signed-off-by: Yury-Fridlyand <[email protected]> * docs Signed-off-by: Yury-Fridlyand <[email protected]> * Receive pushes (subscibed messages). Signed-off-by: Yury-Fridlyand <[email protected]> * Address PR comments. Signed-off-by: Yury-Fridlyand <[email protected]> * I HATE YOU SPOTLESS Signed-off-by: Yury-Fridlyand <[email protected]> * Rename a class. Signed-off-by: Yury-Fridlyand <[email protected]> --------- Signed-off-by: Yury-Fridlyand <[email protected]> * Address PR comments. Signed-off-by: Yury-Fridlyand <[email protected]> * Address PR comments. Signed-off-by: Yury-Fridlyand <[email protected]> * Java: add IT for pubsub (#400) * Add some tests. Signed-off-by: Yury-Fridlyand <[email protected]> * Test fixes. Signed-off-by: Yury-Fridlyand <[email protected]> * Add more tests. Signed-off-by: Yury-Fridlyand <[email protected]> * Address PR comments. Signed-off-by: Yury-Fridlyand <[email protected]> * Experiment Signed-off-by: Yury-Fridlyand <[email protected]> * Add more tests. Signed-off-by: Yury-Fridlyand <[email protected]> * Typo fix. Signed-off-by: Yury-Fridlyand <[email protected]> * Typo fix. Signed-off-by: Yury-Fridlyand <[email protected]> * I HATE YOU SPOTLESS Signed-off-by: Yury-Fridlyand <[email protected]> * Typo fix. Signed-off-by: Yury-Fridlyand <[email protected]> * Uncomment test timeout. Signed-off-by: Yury-Fridlyand <[email protected]> * Address PR comments. Signed-off-by: Yury-Fridlyand <[email protected]> * Typo fix. Signed-off-by: Yury-Fridlyand <[email protected]> * Typo fix. Signed-off-by: Yury-Fridlyand <[email protected]> * Typo fix. Signed-off-by: Yury-Fridlyand <[email protected]> * Typo fix. Signed-off-by: Yury-Fridlyand <[email protected]> --------- Signed-off-by: Yury-Fridlyand <[email protected]> * Update function signature. Signed-off-by: Yury-Fridlyand <[email protected]> * Address PR comments. Signed-off-by: Yury-Fridlyand <[email protected]> * Address PR comments. Signed-off-by: Yury-Fridlyand <[email protected]> --------- Signed-off-by: Yury-Fridlyand <[email protected]>
cyip10
pushed a commit
that referenced
this pull request
Jul 16, 2024
* Java: Add client configuration for subscribing to channels. (#381) * Add client configuartion for subscribing to channels. Signed-off-by: Yury-Fridlyand <[email protected]> * CLIPPY I HATE YOU Signed-off-by: Yury-Fridlyand <[email protected]> * Get and store callback. Signed-off-by: Yury-Fridlyand <[email protected]> * Fix tests. Signed-off-by: Yury-Fridlyand <[email protected]> * Rework configuration and add docs. Signed-off-by: Yury-Fridlyand <[email protected]> * Config rework. Signed-off-by: Yury-Fridlyand <[email protected]> * docs Signed-off-by: Yury-Fridlyand <[email protected]> * More TODOs for the god of TODOs. Signed-off-by: Yury-Fridlyand <[email protected]> --------- Signed-off-by: Yury-Fridlyand <[email protected]> * Add `PUBLISH` and `SPUBLISH` commands. (#391) * Add `PUBLISH` and `SPUBLISH` commands. Signed-off-by: Yury-Fridlyand <[email protected]> * Fix the test. Signed-off-by: Yury-Fridlyand <[email protected]> --------- Signed-off-by: Yury-Fridlyand <[email protected]> * Java client: receive pubsub messages (#385) * Add client configuartion for subscribing to channels. Signed-off-by: Yury-Fridlyand <[email protected]> * CLIPPY I HATE YOU Signed-off-by: Yury-Fridlyand <[email protected]> * Get and store callback. Signed-off-by: Yury-Fridlyand <[email protected]> * Fix tests. Signed-off-by: Yury-Fridlyand <[email protected]> * Rework configuration and add docs. Signed-off-by: Yury-Fridlyand <[email protected]> * Config rework. Signed-off-by: Yury-Fridlyand <[email protected]> * docs Signed-off-by: Yury-Fridlyand <[email protected]> * Receive pushes (subscibed messages). Signed-off-by: Yury-Fridlyand <[email protected]> * Address PR comments. Signed-off-by: Yury-Fridlyand <[email protected]> * I HATE YOU SPOTLESS Signed-off-by: Yury-Fridlyand <[email protected]> * Rename a class. Signed-off-by: Yury-Fridlyand <[email protected]> --------- Signed-off-by: Yury-Fridlyand <[email protected]> * Address PR comments. Signed-off-by: Yury-Fridlyand <[email protected]> * Address PR comments. Signed-off-by: Yury-Fridlyand <[email protected]> * Java: add IT for pubsub (#400) * Add some tests. Signed-off-by: Yury-Fridlyand <[email protected]> * Test fixes. Signed-off-by: Yury-Fridlyand <[email protected]> * Add more tests. Signed-off-by: Yury-Fridlyand <[email protected]> * Address PR comments. Signed-off-by: Yury-Fridlyand <[email protected]> * Experiment Signed-off-by: Yury-Fridlyand <[email protected]> * Add more tests. Signed-off-by: Yury-Fridlyand <[email protected]> * Typo fix. Signed-off-by: Yury-Fridlyand <[email protected]> * Typo fix. Signed-off-by: Yury-Fridlyand <[email protected]> * I HATE YOU SPOTLESS Signed-off-by: Yury-Fridlyand <[email protected]> * Typo fix. Signed-off-by: Yury-Fridlyand <[email protected]> * Uncomment test timeout. Signed-off-by: Yury-Fridlyand <[email protected]> * Address PR comments. Signed-off-by: Yury-Fridlyand <[email protected]> * Typo fix. Signed-off-by: Yury-Fridlyand <[email protected]> * Typo fix. Signed-off-by: Yury-Fridlyand <[email protected]> * Typo fix. Signed-off-by: Yury-Fridlyand <[email protected]> * Typo fix. Signed-off-by: Yury-Fridlyand <[email protected]> --------- Signed-off-by: Yury-Fridlyand <[email protected]> * Update function signature. Signed-off-by: Yury-Fridlyand <[email protected]> * Address PR comments. Signed-off-by: Yury-Fridlyand <[email protected]> * Address PR comments. Signed-off-by: Yury-Fridlyand <[email protected]> --------- Signed-off-by: Yury-Fridlyand <[email protected]>
Yury-Fridlyand
added a commit
that referenced
this pull request
Jun 6, 2025
* Java: Add client configuration for subscribing to channels. (#381) * Add client configuartion for subscribing to channels. Signed-off-by: Yury-Fridlyand <[email protected]> * CLIPPY I HATE YOU Signed-off-by: Yury-Fridlyand <[email protected]> * Get and store callback. Signed-off-by: Yury-Fridlyand <[email protected]> * Fix tests. Signed-off-by: Yury-Fridlyand <[email protected]> * Rework configuration and add docs. Signed-off-by: Yury-Fridlyand <[email protected]> * Config rework. Signed-off-by: Yury-Fridlyand <[email protected]> * docs Signed-off-by: Yury-Fridlyand <[email protected]> * More TODOs for the god of TODOs. Signed-off-by: Yury-Fridlyand <[email protected]> --------- Signed-off-by: Yury-Fridlyand <[email protected]> * Add `PUBLISH` and `SPUBLISH` commands. (#391) * Add `PUBLISH` and `SPUBLISH` commands. Signed-off-by: Yury-Fridlyand <[email protected]> * Fix the test. Signed-off-by: Yury-Fridlyand <[email protected]> --------- Signed-off-by: Yury-Fridlyand <[email protected]> * Java client: receive pubsub messages (#385) * Add client configuartion for subscribing to channels. Signed-off-by: Yury-Fridlyand <[email protected]> * CLIPPY I HATE YOU Signed-off-by: Yury-Fridlyand <[email protected]> * Get and store callback. Signed-off-by: Yury-Fridlyand <[email protected]> * Fix tests. Signed-off-by: Yury-Fridlyand <[email protected]> * Rework configuration and add docs. Signed-off-by: Yury-Fridlyand <[email protected]> * Config rework. Signed-off-by: Yury-Fridlyand <[email protected]> * docs Signed-off-by: Yury-Fridlyand <[email protected]> * Receive pushes (subscibed messages). Signed-off-by: Yury-Fridlyand <[email protected]> * Address PR comments. Signed-off-by: Yury-Fridlyand <[email protected]> * I HATE YOU SPOTLESS Signed-off-by: Yury-Fridlyand <[email protected]> * Rename a class. Signed-off-by: Yury-Fridlyand <[email protected]> --------- Signed-off-by: Yury-Fridlyand <[email protected]> * Address PR comments. Signed-off-by: Yury-Fridlyand <[email protected]> * Address PR comments. Signed-off-by: Yury-Fridlyand <[email protected]> * Java: add IT for pubsub (#400) * Add some tests. Signed-off-by: Yury-Fridlyand <[email protected]> * Test fixes. Signed-off-by: Yury-Fridlyand <[email protected]> * Add more tests. Signed-off-by: Yury-Fridlyand <[email protected]> * Address PR comments. Signed-off-by: Yury-Fridlyand <[email protected]> * Experiment Signed-off-by: Yury-Fridlyand <[email protected]> * Add more tests. Signed-off-by: Yury-Fridlyand <[email protected]> * Typo fix. Signed-off-by: Yury-Fridlyand <[email protected]> * Typo fix. Signed-off-by: Yury-Fridlyand <[email protected]> * I HATE YOU SPOTLESS Signed-off-by: Yury-Fridlyand <[email protected]> * Typo fix. Signed-off-by: Yury-Fridlyand <[email protected]> * Uncomment test timeout. Signed-off-by: Yury-Fridlyand <[email protected]> * Address PR comments. Signed-off-by: Yury-Fridlyand <[email protected]> * Typo fix. Signed-off-by: Yury-Fridlyand <[email protected]> * Typo fix. Signed-off-by: Yury-Fridlyand <[email protected]> * Typo fix. Signed-off-by: Yury-Fridlyand <[email protected]> * Typo fix. Signed-off-by: Yury-Fridlyand <[email protected]> --------- Signed-off-by: Yury-Fridlyand <[email protected]> * Update function signature. Signed-off-by: Yury-Fridlyand <[email protected]> * Address PR comments. Signed-off-by: Yury-Fridlyand <[email protected]> * Address PR comments. Signed-off-by: Yury-Fridlyand <[email protected]> --------- Signed-off-by: Yury-Fridlyand <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Based on #381
Configuration with callback:
To send messages use
redis-cli:publish ch1 $messageConfiguration without callback: