Exception returning UnicastSubject Observable from flow

Description

*To Reproduce*

Create the following flow:
` @StartableByRPC
class ObservableSubject(val unicast: Boolean) : FlowLogic<rx.Observable<Int>>() {
override fun call(): rx.Observable<Int> {
val o: rx.Observable<Int> = if (unicast) UnicastSubject.create() else PublishSubject.create()
return o
}
}`

And the following driver test:
` @Test
fun unicastSujectTest() = driver(driverParameters) {
val handle = startNode().getOrThrow()
val observable = handle.rpc.startFlow(DataFeedFlow::ObservableSubject, *true*).returnValue.get()
observable.subscribe().unsubscribe()
println("string: $observable")
}`

When the test is with unicast=false the test completes without failure.
When run with unicast=true (as above) the test fails with the stack trace below

Created by github action.

Activity

Show:
David Rapacchiale
June 2, 2020, 12:25 PM

FYI

Rick Parker
June 2, 2020, 12:51 PM

The documentation this is referring to isn’t really targeted at customers but contributors to Corda. In general, it is not recommended that flows return Observables and certainly user defined Observables are not supported, even though the RPC layer may appear to support them.

David Rapacchiale
June 16, 2020, 12:44 PM

we probably need to make some edit to https://docs.corda.net/docs/corda-os/4.4/clientrpc.html#observables. Rick will support you on this ticket

Ivan Terziev
June 16, 2020, 1:37 PM

Sure thanks and .

BTW it seems we had lost the menu navigation to the equivalent page in CE, does it need updated too?

https://docs.corda.net/docs/corda-enterprise/4.4/node/operating/clientrpc.html#observables

Ivan Terziev
September 19, 2020, 10:20 PM

Please pick this up after the Q3 release, check with if anything else than the recommendation mentioned above should be added or changed.

Assignee

ben.pester

Reporter

eng.bot

Sprint

None

Epic Link

None

Priority

High

Due Date

None

Engineering Teams

Docs Team

Affects versions

None

Ported to...

None

Story Points / Dev Days

0.5
Configure