msemys / esjc

EventStore Java Client
MIT License
108 stars 27 forks source link

CatchUpSubscriptionSettings.Builder.resolveLinkTos(true) does not work #35

Closed masayoshi-louis closed 6 years ago

masayoshi-louis commented 6 years ago

I am using ES 4.1.0 and esjc 2.0.0. My code look like:

        val settings = CatchUpSubscriptionSettings.newBuilder()
            .resolveLinkTos(true)
            .build()
        val sub = gesClient!!.subscribeToStreamFrom("\$ce-MyAggregate", null, settings, object : CatchUpSubscriptionListener {
            override fun onEvent(subscription: CatchUpSubscription, event: ResolvedEvent) {
                val oe = event.originalEvent()
                assert(oe.isJson) // THROWS AssertionError
                val json = String(oe.data, Charsets.UTF_8)
                println(json)
            }

            override fun onLiveProcessingStarted(subscription: CatchUpSubscription) {
            }

            override fun onClose(subscription: CatchUpSubscription, reason: SubscriptionDropReason, exception: Exception?) {
                exception?.printStackTrace()
            }
        })

The assertion oe.isJson fails and the event data is still a link (0@MyAggregate-id).

masayoshi-louis commented 6 years ago

I should use event.event.data