EventStore / EventStoreDB-Client-Java

Official Asynchronous Java 8+ Client Library for EventStoreDB 20.6+
https://eventstore.com
Apache License 2.0
63 stars 19 forks source link

Help reading from $all stream and avoiding deleted streams / events #199

Closed exosyphon-rxrevu closed 1 year ago

exosyphon-rxrevu commented 1 year ago

We are trying to connect to our EventStoreDb instance using Kotlin (Java) and read from the $all stream. In our lower environment we have a couple deleted streams that we do not want to read. Here are the different ways we have tried connecting and reading that either don't read any streams or read all streams including the deleted streams. Is there a different way we should be reading from the $all stream?

    override fun subscribe(category: String, listener: SubscriptionListener) {
        val filter = SubscriptionFilter.newBuilder()
//            .withStreamNameRegularExpression("^$category.*")
//            .withEventTypePrefix("$category-")
//            .withStreamNamePrefix("$category")
//            .withEventTypeRegularExpression("^$category.*")
            .build()
        val options = SubscribeToAllOptions.get().filter(filter).fromPosition(Position.START)
        eventStoreDbClient.subscribeToAll(listener, options)
    }