Java Code Examples for org.redisson.api.RStream#removeGroup()

The following examples show how to use org.redisson.api.RStream#removeGroup() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RedissonStreamTest.java    From redisson with Apache License 2.0 3 votes vote down vote up
@Test(expected = RedisException.class)
public void testRemoveGroup() {
    RStream<String, String> stream = redisson.getStream("test");

    stream.add("0", "0");
    
    stream.createGroup("testGroup");
    
    StreamMessageId id1 = stream.add("1", "1");
    StreamMessageId id2 = stream.add("2", "2");
    
    stream.removeGroup("testGroup");
    
    stream.readGroup("testGroup", "consumer1");
}
 
Example 2
Source File: RedissonStreamTest.java    From redisson with Apache License 2.0 3 votes vote down vote up
@Test
    public void testReadGroupBlocking() {
        RStream<String, String> stream = redisson.getStream("test");

        StreamMessageId id0 = stream.add("0", "0");
        
        stream.createGroup("testGroup", id0);
        
        stream.add("1", "1");
        stream.add("2", "2");
        stream.add("3", "3");

        Map<StreamMessageId, Map<String, String>> s = stream.readGroup("testGroup", "consumer1", 3, 5, TimeUnit.SECONDS);
        assertThat(s.values().iterator().next().keySet()).containsAnyOf("1", "2", "3");
        assertThat(s.size()).isEqualTo(3);

        stream.removeGroup("testGroup");
        
        stream.createGroup("testGroup", id0);
        
        stream.add("1", "1");
        stream.add("2", "2");
        stream.add("3", "3");

        RStream<String, String> stream2 = redisson.getStream("test2");
        
        StreamMessageId id1 = stream2.add("0", "0");
        
        stream2.createGroup("testGroup", id1);
        
//        Map<String, Map<StreamMessageId, Map<String, String>>> s2 = stream.readGroup("testGroup", "consumer1", 3, 5, TimeUnit.SECONDS, id0, Collections.singletonMap("test2", id1));
//        assertThat(s2.values().iterator().next().values().iterator().next().keySet()).containsAnyOf("1", "2", "3");
//        assertThat(s2.size()).isEqualTo(3);
    }