Closed masayoshi-louis closed 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).
oe.isJson
0@MyAggregate-id
I should use event.event.data
event.event.data
I am using ES 4.1.0 and esjc 2.0.0. My code look like:
The assertion
oe.isJson
fails and the event data is still a link (0@MyAggregate-id
).