We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
protected List<Optional<StreamEntryID>> publishInActiveConnection(String streamGroup, List<String> streamMessages, Map<String, String> parameters)
This method uses for and publishes messages individual.
Would be great if there where an alternative method using Jedis Pipeline.
@Test void test() throws BaseException { List<String> ids = IntStream.range(0, 5000).mapToObj(i -> RandomUtil.generateId()).toList(); Jedis jedis = new Jedis("localhost", 6379); String streamKey = "mystream"; long startTime = System.currentTimeMillis(); for (var id : ids) { Map<String, String> message = new HashMap<>(); message.put("message_id", id); message.put("content", id); jedis.xadd(streamKey, (StreamEntryID) null, message); } System.out.println("Elapsed time: " + (System.currentTimeMillis() - startTime)); Pipeline pipeline = jedis.pipelined(); startTime = System.currentTimeMillis(); for (var id : ids) { Map<String, String> message = new HashMap<>(); message.put("message_id", id); message.put("content", id); pipeline.xadd(streamKey, (StreamEntryID) null, message); } List<Object> responses = pipeline.syncAndReturnAll(); System.out.println("Pipelined Elapsed time: " + (System.currentTimeMillis() - startTime)); jedis.close(); }
The result of this test Elapsed time: 221 Pipelined Elapsed time: 23
The text was updated successfully, but these errors were encountered:
#691 RedisStreamPublisher pipelined publish
d8e066a
#691 add missing javadoc
72cbfd1
#691 call Pipeline#sync() after every 1000 items
aba64b6
Merge pull request #729 from i-Cell-Mobilsoft-Open-Source/feature/691…
8fc9c37
…-RedisStreamPublisher-list-publish-alternative #691 RedisStreamPublisher pipelined publish
plevente011230
Successfully merging a pull request may close this issue.
protected List<Optional<StreamEntryID>> publishInActiveConnection(String streamGroup, List<String> streamMessages, Map<String, String> parameters)
This method uses for and publishes messages individual.
Would be great if there where an alternative method using Jedis Pipeline.
The result of this test
Elapsed time: 221
Pipelined Elapsed time: 23
The text was updated successfully, but these errors were encountered: