Which token should i pass?

Hi @liav!

Listening and subscribing are the same thing in this context so for your first 2 questions, the answer is that it comes from the call to getTransactions. This produces an infinite stream of transactions starting after the point in time at which you called the function.

For question 3, I don’t know why you’re seeing empty transactions. I’d stick with my previous suggestion: Try to reproduce this against sandbox and if you encounter the same issue provide instructions so we can reproduce it and I’m sure we can help you fix it. If you cannot reproduce it against Sandbox, then we’ve drastically narrowed down what might be going wrong and it should be a lot easier to find the issue. It would also be helpful if you could push your current state to a fork of the repository so we can see exactly what changes you made.

I don’t understand what exactly you are asking for in question 4. The way the app is setup is that it reacts to the transactions it receives.

For the error you are seeing could you expand on where exactly you are seeing that? I’m a bit surprised that you see an http error here. Maybe you connected to the JSON API on Daml hub instead of the gRPC API?

Sure Moritz,

I’ve ran it against Sandbox and according to its log it seems like working (see log below)
I couldn’t see any created contracts however in the Navigator (for both parties)

The HTTP protocol is produced by Java client side. I assume its a wrapper of gRPC call eventually triggered. Although i assumed gRPC is implemented by protobuf over tcp without the HTTP application layer.
The object is seen in the stack trace:

com.daml.grpc.adapter.client.rs.BufferingResponseObserver

Thanks for clearing the “subscribing equal listening” terminology. I know understand that the subscription of Alice and Bob’s identifiers are actually enabling their parties to “listen” to incoming stream of transactions.

Forked project is: https://github.com/liavezer/ex-java-bindings

Last thing - Assuming the program works correctly, should i manually submit a “RespondPing” (and “RespondPong”) via the Ledger live data or i should automatically see the correspondence done automatically in the background? I assume that the later option is the expected one (automatic…)

mvn exec:java -Dexec.mainClass=examples.pingpong.reactive.PingPongReactiveMain -Dexec.args="localhost 7600"

SDK 1.18.1 has been released!
See https://github.com/digital-asset/daml/releases/tag/v1.18.1 for details.

SDK 1.18.1 has been released!
See https://github.com/digital-asset/daml/releases/tag/v1.18.1 for details.

Compiling ex-java-bindings to a DAR.
Created .daml/dist/ex-java-bindings-0.0.1.dar
Waiting for sandbox to start:
INFO: Slf4jLogger started
INFO: Listening on localhost:7600 over plain text.
   ____             ____
  / __/__ ____  ___/ / /  ___ __ __
 _\ \/ _ `/ _ \/ _  / _ \/ _ \\ \ /
/___/\_,_/_//_/\_,_/_.__/\___/_\_\

INFO: Initialized sandbox version 1.0.0 with ledger-id = a599da3c-dca0-4724-b33f-ac5512efd415, port = 7600, dar file = List(.daml/dist/ex-java-bindings-0.0.1.dar), time mode = wall-clock time, ledger = in-memory, auth-service = AuthServiceWildcard$, contract ids seeding = strong
Waiting for navigator to start:
   _  __          _           __
  / |/ /__ __  __(_)__ ____ _/ /____  ____
 /    / _ `/ |/ / / _ `/ _ `/ __/ _ \/ __/
/_/|_/\_,_/|___/_/\_, /\_,_/\__/\___/_/
                 /___/
Version 1.0.0
Frontend running at http://localhost:7500.
.......Waiting for JSON API to start:
09:41:45.206 [main] INFO  com.daml.http.Main$ - Config(ledgerHost=localhost, ledgerPort=7600, address=127.0.0.1, httpPort=7575, portFile=None, applicationId=HTTP-JSON-API-Gateway, packageReloadInterval=5 seconds, maxInboundMessageSize=4194304, jdbcConfig=None, staticContentConfig=None, accessTokenFile=None)
09:41:45.523 [http-json-ledger-api-akka.actor.default-dispatcher-4] INFO  akka.event.slf4j.Slf4jLogger - Slf4jLogger started
09:41:46.288 [http-json-ledger-api-akka.actor.default-dispatcher-19] INFO  com.daml.http.HttpService$ - Connected to Ledger: a599da3c-dca0-4724-b33f-ac5512efd415
09:41:46.289 [http-json-ledger-api-akka.actor.default-dispatcher-19] INFO  com.daml.http.HttpService$ - contractDao: None
09:41:46.839 [http-json-ledger-api-akka.actor.default-dispatcher-19] INFO  com.daml.http.PackageService - new package IDs loaded: c1f1f00558799eec139fb4f4c76f95fb52fa1837a5dd29600baa1c8ed1bdccfd, 733e38d36a2759688a4b2c4cec69d48e7b55ecc8dedc8067b815926c917a182a, bfcd37bd6b84768e86e432f5f6c33e25d9e7724a9d42e33875ff74f6348e733f, 518032f41fd0175461b35ae0c9691e08b4aea55e62915f8360af2cc7a1f2ba6c, cc348d369011362a5190fe96dd1f0dfbc697fdfd10e382b9e9666f0da05961b7, ed2beae6b3bc8a8804ef43a7add61c87689c18e7b4a2ed45ec2f866df40d16f0, 6839a6d3d430c569b2425e9391717b44ca324b88ba621d597778811b2d05031d, 99a2705ed38c1c26cbb8fe7acf36bbf626668e167a33335de932599219e0a235, 76bf0fd12bd945762a01f8fc5bbcdfa4d0ff20f8762af490f8f41d6237c6524f, e22bce619ae24ca3b8e6519281cb5a33b64b3190cc763248b4c3f9ad5087a92c, d58cf9939847921b2aab78eaa7b427dc4c649d25e6bee3c749ace4c3f52f5c97, d3a089ecbcc688bbd96ace45dc7d38a000e0423ec4c52d26c47957d9e5fded3d, 6c2c0667393c5f92f1885163068cd31800d2264eb088eb6fc740e11241b2bf06, 532f849b7d757c5a08c76307acd720292992fcd3f89e96e660a9e2786624b957, d14e08374fc7197d6a0de468c968ae8ba3aadbf9315476fd39071831f5923662, 057eed1fd48c238491b8ea06b9b5bf85a5d4c9275dd3f6183e0e6b01730cc2ba, e491352788e56ca4603acc411ffe1a49fefd76ed8b163af86cf5ee5f4c38645b, 40f452260bef3f29dede136108fc08a88d5a5250310281067087da6f0baddff7, 8a7806365bbd98d88b4c13832ebfa305f6abaeaf32cfa2b7dd25c4fa489b79fb
09:41:47.211 [http-json-ledger-api-akka.actor.default-dispatcher-17] INFO  com.daml.http.Main$ - Started server: ServerBinding(/127.0.0.1:7575)

09:40:50.149 [examples.pingpong.reactive.PingPongReactiveMain.main()] Alice starts reading transactions.
09:40:50.213 [examples.pingpong.reactive.PingPongReactiveMain.main()] Bob starts reading transactions.
09:40:50.837 [client-1] Bob is exercising RespondPong on 00792438aeccd2cc4da01ae1546346a269e0c720ba7efc3c9006d0d5bad38cfec2 in workflow Ping-Alice-0 at count 0
09:40:51.026 [client-0] Alice is exercising RespondPing on 006d160223cc99ff917eb000e61c3e7d1a07e298bad29b13732d5d3747663c868b in workflow Ping-Alice-0 at count 1
09:40:51.029 [client-1] Bob is exercising RespondPong on 008142924eafb3196143ad5d759e061e7384dbe20e2d098813b4e69f39fc350c8b in workflow Ping-Alice-1 at count 0
09:40:51.140 [client-1] Bob is exercising RespondPong on 008118295ff5907e61719808cef5b9fa5b6eb353ebdbce82ce88ba29f477058ac9 in workflow Ping-Alice-2 at count 0
09:40:51.143 [client-0] Alice is exercising RespondPing on 001adf9391ecbe674bcae71c10d9b9506be2140267e5e4aec81c2f011c01fadc6c in workflow Ping-Alice-1 at count 1
09:40:51.260 [client-1] Bob is exercising RespondPong on 007469a41420b66bc09280bf03bd640ac0525d74425a57333c18f3ad9cb23e3397 in workflow Ping-Alice-3 at count 0
09:40:51.272 [client-0] Alice is exercising RespondPing on 003ad28709694c0e207938e43afb896362f368e46dd03f5e58a601ced0827e3b16 in workflow Ping-Alice-2 at count 1
09:40:51.377 [client-1] Bob is exercising RespondPong on 006c78b8c59bd1cc96870d3d1fbe7277042a6f6b23b42037d4f58953b16bbf6106 in workflow Ping-Alice-0 at count 2
09:40:51.381 [client-0] Alice is exercising RespondPing on 00d110d74eb05e7b09c0bdf515837545c5cc959e0889444098aab3297ee897fdac in workflow Ping-Alice-3 at count 1
09:40:51.498 [client-1] Bob is exercising RespondPong on 0020e99a58e9538111f4f88817ae1c23659b1bb95f693c41c26a3666d51f92c5c1 in workflow Ping-Alice-4 at count 0
09:40:51.501 [client-0] Alice is exercising RespondPing on 00552bc5d4114fbd4782e830a70c9c206609dd765a8f34397b18a3cb99881d5b76 in workflow Ping-Alice-0 at count 3
09:40:51.619 [client-1] Bob is exercising RespondPong on 0023f2bc9a8566d493582b9db99599d9b523ae2d0c26a64428d5deb7e4f7be73dc in workflow Ping-Alice-1 at count 2
09:40:51.631 [client-0] Alice is exercising RespondPing on 00c0ffea632ebb7c47368f13131287c940d362ffb747d9b74fed494432fc5be5f6 in workflow Ping-Alice-4 at count 1
09:40:51.739 [client-1] Bob is exercising RespondPong on 009248f4c064220c52ea04ea0874f0cddcf4d0baf25330a46e8910446cbaa6d75d in workflow Ping-Alice-5 at count 0
09:40:51.742 [client-0] Alice is exercising RespondPing on 002333b249b968f30c68f9e6cf1fe1ed4f2c37f4b7249750368df6f95a148286df in workflow Ping-Alice-1 at count 3
09:40:51.859 [client-1] Bob is exercising RespondPong on 00f2d63c2acaca25af3c2f1c92089eaa5c4ebb816d29b06664609e3e202ff200d1 in workflow Ping-Alice-2 at count 2
09:40:51.861 [client-0] Alice is exercising RespondPing on 004e5cec27e2197e8663b9564db1001f1f0d327fb55e0a848e2aa04530956490c8 in workflow Ping-Alice-5 at count 1
09:40:51.982 [client-1] Bob is exercising RespondPong on 00e5874d4a41a616b5d65dfd619f1b71b5f3a673b603607768669e2213732f5b20 in workflow Ping-Alice-6 at count 0
09:40:51.985 [client-0] Alice is exercising RespondPong on 001aefcbdbe40a8e60c0060b124fde945c4c77a91d3706fbf57103de49fe48aded in workflow Ping-Bob-0 at count 0
09:40:52.099 [client-0] Alice is exercising RespondPing on 007dbae6a9568981067bf9e0f8601862e9879ddd67706c4b00ce1fe5893113a70e in workflow Ping-Alice-2 at count 3
09:40:52.099 [client-1] Bob is exercising RespondPong on 00104b1ba689f7161c93430ad653fc09d917915e806e15b0c76b696e8f663961b4 in workflow Ping-Alice-3 at count 2
09:40:52.218 [client-0] Alice is exercising RespondPong on 00b072f712bb696bf21e308dd4fcd38c1ed031ba4a6bddb308eef8e5fb0ddb3dac in workflow Ping-Bob-1 at count 0
09:40:52.218 [client-1] Bob is exercising RespondPong on 006937272ad0db12300cfab42c46845666955c64cd45da9e5096cbb7370eaff1d5 in workflow Ping-Alice-7 at count 0
09:40:52.337 [client-0] Alice is exercising RespondPing on 009cce2ae641a8a953f36d045b6d3f0f9db024c104df6a6a2d87dc3ff2164d3d4f in workflow Ping-Alice-6 at count 1
09:40:52.338 [client-1] Bob is exercising RespondPong on 00dd3afb1d7a0b5263ba3d7df6eaad4cb02a294323410b509ac2596157cd748205 in workflow Ping-Alice-0 at count 4
09:40:52.460 [client-1] Bob is exercising RespondPong on 00571fcd9f221d77f50baa6ff514bfe02dd3a3d7aa4493ecffe91bd9e9965e1db6 in workflow Ping-Alice-8 at count 0
09:40:52.461 [client-0] Alice is exercising RespondPong on 00cb40905c22b117725f2ab0e90b137d69eb96408a752b53f1f12b755144906509 in workflow Ping-Bob-2 at count 0
09:40:52.582 [client-0] Alice is exercising RespondPing on 0077e15a6d3f51a86fdc7339b5f4eb2b6b8c719356cbbf02f8015a6f4a59d34c4f in workflow Ping-Alice-3 at count 3
09:40:52.582 [client-1] Bob is exercising RespondPong on 00c24dbb739707e12946af5ba037cdce789071e67d2fd58d6c6cb0786e62dba3d3 in workflow Ping-Alice-4 at count 2
09:40:52.699 [client-1] Bob is exercising RespondPong on 00b994efaded7720ae9dd97918f8dd37a7b5742ff37a237e79c3e0f18fd4b34a31 in workflow Ping-Alice-9 at count 0
09:40:52.699 [client-0] Alice is exercising RespondPong on 0048ace25478df3875cd9cc3a15315fc27915f712e43c1d0c6a65039c3e2023f79 in workflow Ping-Bob-3 at count 0
09:40:52.818 [client-1] Bob is exercising RespondPong on 00f330de9141b2465f88ecfa6b87b6aaa4de5ad17377876ce7649c5cd301b7345f in workflow Ping-Alice-1 at count 4
09:40:52.818 [client-0] Alice is exercising RespondPing on 0053d3d0666ec6489723cd84b876d90bf810f87c84e61cb0b9c3cecc2d96bd4f3d in workflow Ping-Alice-7 at count 1
09:40:52.941 [client-0] Alice is exercising RespondPong on 00f13cedeb96b7c4384d3602fcebd5775434bd3fd9e28766cf2d03ef5b83961307 in workflow Ping-Bob-4 at count 0
09:40:52.942 [client-1] Bob is exercising RespondPong on 00b2baae5e4d96bd4f809e325515ebf9ce617ff0b06eb87f0127a10b420f8df384 in workflow Ping-Alice-5 at count 2
09:40:53.061 [client-0] Alice is exercising RespondPing on 0012dce23ef20d7becb4aeeb21817d36adf756211c0ba59524d03ec645873a059e in workflow Ping-Alice-0 at count 5
09:40:53.062 [client-1] Bob is exercising RespondPing on 00c781f7712d3313479d390ee641a129766fd15324f036f96cdaa9d2bd7f92af88 in workflow Ping-Bob-0 at count 1
09:40:53.177 [client-1] Bob is exercising RespondPong on 00270b4e557ebfffa21cc033d6d65ac2280689f373f16ee1bc86137c9cd96b8c1e in workflow Ping-Alice-2 at count 4
09:40:53.177 [client-0] Alice is exercising RespondPong on 00629462a4ce20ec297288193bc120762c9113819d988201448ca7595a023655b7 in workflow Ping-Bob-5 at count 0
09:40:53.297 [client-0] Alice is exercising RespondPing on 00d37803c224f8448737e9f9de1b3aa071da6f424a13fec477ba1d8a2761eb94a2 in workflow Ping-Alice-8 at count 1
09:40:53.297 [client-1] Bob is exercising RespondPing on 0063e1fbeb69f5ecbbec6c3d2e2f91af8222eaf5b682014c5928a7a9c6e3e2c437 in workflow Ping-Bob-1 at count 1
09:40:53.419 [client-0] Alice is exercising RespondPong on 0069c891f95540cb9e29d5de06627c4f45ac16418591a2a06797eefe61b702282e in workflow Ping-Bob-6 at count 0
09:40:53.419 [client-1] Bob is exercising RespondPong on 00fcb7f4ea0041a8bc51b4f683c716ee484f39da58c82ed83a9d43d5e1bbf24ef6 in workflow Ping-Alice-6 at count 2
09:40:53.539 [client-0] Alice is exercising RespondPing on 009d33caf4f534dde394d015e6e0751fbf5dacdd358887424d3f9d64defaa28e7c in workflow Ping-Alice-4 at count 3
09:40:53.539 [client-1] Bob is exercising RespondPing on 0056feb546f2ecc4caf1ae995e1490d3ce2fe6e15ead0d3cfabb84b5d8158559bd in workflow Ping-Bob-2 at count 1
09:40:53.660 [client-0] Alice is exercising RespondPong on 0040be07c306a32cf36bb31ed2baf0bc6b1e245d217800b5963e1c2c698496c620 in workflow Ping-Bob-7 at count 0
09:40:53.660 [client-1] Bob is exercising RespondPong on 008982d17f4273742e7a671cb37cf7d25aed73e318ebd5873c38ec5b741b0b043e in workflow Ping-Alice-3 at count 4
09:40:53.778 [client-1] Bob is exercising RespondPing on 00956c6e27263caf464d90c953590e5332619091426be120645247ddd3e15d821d in workflow Ping-Bob-3 at count 1
09:40:53.778 [client-0] Alice is exercising RespondPing on 00faa7dc41d6a96332b83505593dab1c07947bf8ca73d2d87e882c7a4a182bb953 in workflow Ping-Alice-9 at count 1
09:40:53.899 [client-0] Alice is exercising RespondPong on 0040209eefbbd1df2d687b123c45ec9f7c8ad7f7802a084bdc25b2ec02e6d91c3b in workflow Ping-Bob-8 at count 0
09:40:53.899 [client-1] Bob is exercising RespondPong on 00a65b559e020aab96f6a53ecbb15d52acfdf8e402d7bd3efe5e9488d9d875f4c1 in workflow Ping-Alice-7 at count 2
09:40:54.021 [client-0] Alice is exercising RespondPing on 00f19850f05ba390e246f1b2562a73aa854d013f8448d6bdabe96b2fcb62914109 in workflow Ping-Alice-1 at count 5
09:40:54.021 [client-1] Bob is exercising RespondPing on 00a0f5f27402a381a1c016dc6d2a0d3eeb66e17be05b2a2bae8b8f14a69f6d31b9 in workflow Ping-Bob-4 at count 1
09:40:54.140 [client-0] Alice is exercising RespondPong on 00f42e5e06145a9d0baa7253f442caa76714ef37d1cebf0908dcef85074120af8e in workflow Ping-Bob-9 at count 0
09:40:54.140 [client-1] Bob is exercising RespondPong on 007105fb1215b684e295482e48dbd20ed207e77f9ae1b2376e99dbf8bb6e4fddba in workflow Ping-Alice-0 at count 6
09:40:54.258 [client-0] Alice is exercising RespondPing on 004ff8f53371d6856a28ff0444c07c5b7a09b9ab7278e4f82b99dc1fe831d051f8 in workflow Ping-Alice-5 at count 3
09:40:54.258 [client-1] Bob is exercising RespondPing on 0026c58aaf0693073419830e36d8c6960a6aa549415cf2283e9077032eab860a52 in workflow Ping-Bob-5 at count 1
09:40:54.378 [client-1] Bob is exercising RespondPong on 00947739e4f347e1f01d017aeb7f04b444d744d7a2d8bb9364ddcf121cdb8365c9 in workflow Ping-Alice-8 at count 2
09:40:54.378 [client-0] Alice is exercising RespondPong on 001910075d80802d1addb172526b3298e5d463d8120f885f534ccf6ddfb4f5ba19 in workflow Ping-Bob-0 at count 2
09:40:54.499 [client-1] Bob is exercising RespondPing on 00986fa9598bca5ad4e82314f122130a68a7d6ee3cb2d87683c2c9f5ac048f417d in workflow Ping-Bob-6 at count 1
09:40:54.499 [client-0] Alice is exercising RespondPing on 0045e8246ccb7ccf5f29366ddef73863659d8e08ff8cfaf70f969fb2eb6099995b in workflow Ping-Alice-2 at count 5
09:40:54.621 [client-1] Bob is exercising RespondPong on 005c257349886c62856efa79db73b5e95c1ef98e587aa78f87e0c5bc74f808ceee in workflow Ping-Alice-4 at count 4
09:40:54.622 [client-0] Alice is exercising RespondPong on 00e1f5d2b53c4f59a17f4ec187c8cf0fb523034a759863a94151e0d78f43eb62c8 in workflow Ping-Bob-1 at count 2
09:40:54.741 [client-1] Bob is exercising RespondPing on 00a6aaed21d476e43678e2474eb6640008c57bb2afc783176b7497514ddebffb05 in workflow Ping-Bob-7 at count 1
09:40:54.741 [client-0] Alice is exercising RespondPing on 006a4b8740586d176cd6cf0b9adc3d9d45caf137989ea577f2d856f99fccfc593c in workflow Ping-Alice-6 at count 3
09:40:54.858 [client-0] Alice is exercising RespondPong on 000f5df19b73cde0386b101cc68905eff358b561e0061b421e2c0de10c9048b01d in workflow Ping-Bob-2 at count 2
09:40:54.858 [client-1] Bob is exercising RespondPong on 00746eae08cfb9821d107094db1dcbd2805267499e7cf86cefb7b3cd13741a14a6 in workflow Ping-Alice-9 at count 2
09:40:54.977 [client-0] Alice is exercising RespondPing on 0046238bdb779d28c4bbf1a3a9942e6440be5ccdc21c9fb66ec4dc618f038e07a6 in workflow Ping-Alice-3 at count 5
09:40:54.977 [client-1] Bob is exercising RespondPing on 0003019010e60d58f1e6735e10930f983f5636d07259919a90bee58aedbeed3273 in workflow Ping-Bob-8 at count 1
09:40:55.099 [client-0] Alice is exercising RespondPong on 0003983b9efda6861bf51ad3cd16a72ac0652ba3f68d0ac1decf3b6c3c0b37ef8c in workflow Ping-Bob-3 at count 2
09:40:55.099 [client-1] Bob is exercising RespondPong on 00dc415f594b547573896aef2ded9f2424696a24f62da85509fc1cb65bbe4eec6a in workflow Ping-Alice-1 at count 6
09:40:55.217 [client-0] Alice is exercising RespondPing on 0040c3aab5ce0b06062b69190f4ab65d4080f91eb000a3dc7f8b58bd2de4d448e6 in workflow Ping-Alice-7 at count 3
09:40:55.217 [client-1] Bob is exercising RespondPing on 003ac5f5d93c984088002070717856f1336b409145c8ce89fbbb775acd2b91ebaa in workflow Ping-Bob-9 at count 1
09:40:55.337 [client-1] Bob is exercising RespondPong on 0085f64377933fc5317e8d671065b5a269ae19261ee1257d6953cac4ef269dc665 in workflow Ping-Alice-5 at count 4
09:40:55.337 [client-0] Alice is exercising RespondPong on 00d885f1e267dabd90c890ef41e188be8688e9184a0f28dd307018fec5d6d2c00a in workflow Ping-Bob-4 at count 2
09:40:55.457 [client-0] Alice is exercising RespondPing on 006918caf26317e71ba312f526e6c75213d7a07e8c110f6345f888429bd8d23b01 in workflow Ping-Alice-0 at count 7
09:40:55.457 [client-1] Bob is exercising RespondPing on 0077f5c433517c857ca3d7784230fb6941a11bcf8ffb3bdded5274b0dc7120a286 in workflow Ping-Bob-0 at count 3
09:40:55.578 [client-1] Bob is exercising RespondPong on 0089873f78248365803098ccf84cbf313f738ec8f501dea9936adb164219a5143b in workflow Ping-Alice-2 at count 6
09:40:55.578 [client-0] Alice is exercising RespondPong on 00613249d016637cc32bea69ba527b5b013248a99273b5c7a1b3056d7b2280a76c in workflow Ping-Bob-5 at count 2
09:40:55.698 [client-1] Bob is exercising RespondPing on 0022d3a839ff9335b62e1d8f7eb0a288620a8c9916d3f6aa940837ef5a2eba8a4d in workflow Ping-Bob-1 at count 3
09:40:55.698 [client-0] Alice is exercising RespondPing on 00e527d4f7e8fc8999e11aea030750d3606765bccf41446caab69d9d4ea03da2f1 in workflow Ping-Alice-8 at count 3
09:40:55.818 [client-0] Alice is exercising RespondPong on 003c26a1da464e758434dadc325a07b8f986e6ccb63ad318525ac19aee8ab58931 in workflow Ping-Bob-6 at count 2
09:40:55.818 [client-1] Bob is exercising RespondPong on 00f4d74e1e8dc8c75f83169e87fd423c066d7ec3c68cdaf2279b570b56085170a8 in workflow Ping-Alice-6 at count 4
09:40:55.940 [client-0] Alice is exercising RespondPing on 00e231857ac5bdc9a8c9268f3cc00caafa638fe8b6ece0142ce6c8679fee76b477 in workflow Ping-Alice-4 at count 5
09:40:55.940 [client-1] Bob is exercising RespondPing on 00401d6f78b06c405ed9a1f77479f8b00af58ee5ec43bc59e71482555e14e9086a in workflow Ping-Bob-2 at count 3
09:40:56.058 [client-1] Bob is exercising RespondPong on 001cace740f0f5f383e1b1451e0b59eb5be1cdc8031bf2dbdd8b6aa273f44e920b in workflow Ping-Alice-3 at count 6
09:40:56.058 [client-0] Alice is exercising RespondPong on 00977b14dfbaa9de8e2ea01558300d2c13f94adab76624a6379edda9286307a3b7 in workflow Ping-Bob-7 at count 2
09:40:56.176 [client-1] Bob is exercising RespondPing on 001f49fe2ad539c20b5348b70582757cb63a216c4766e1b374d8bfa014ca777d5c in workflow Ping-Bob-3 at count 3
09:40:56.176 [client-0] Alice is exercising RespondPing on 00b80fed57dd323696c2f7a04db8e3341caf2060c1212daa23ef3472c063bfdd4c in workflow Ping-Alice-9 at count 3
09:40:56.299 [client-0] Alice is exercising RespondPong on 0009ce2e7f60363408a84ca5226d183d8585420180aa56fee7699c51c3d13d2f6a in workflow Ping-Bob-8 at count 2
09:40:56.299 [client-1] Bob is exercising RespondPong on 00dc28959764c12b7106ecb776a3a0bb3d76b8d20b8204edec45d8ad8a0c6c4e65 in workflow Ping-Alice-7 at count 4
09:40:56.418 [client-1] Bob is exercising RespondPing on 00c3b44fe38ad3dd5275ff2efed041366992c7e0e9c2e09144fb1f080ea210c928 in workflow Ping-Bob-4 at count 3
09:40:56.419 [client-0] Alice is exercising RespondPing on 00fd4c6487ad92b647482fd9701b9040d37b82fa734bf0c111753d5a991ffedc6f in workflow Ping-Alice-1 at count 7
09:40:56.539 [client-0] Alice is exercising RespondPong on 00b715c124b8837445bf557adccaf21ffceb94b49220543003f97bd07168d16daf in workflow Ping-Bob-9 at count 2
09:40:56.539 [client-1] Bob is exercising RespondPong on 007f56869a02fd300ff8c28916b4fbb62f03e78b7503adaed19ed0e80600e2fbb2 in workflow Ping-Alice-0 at count 8
09:40:56.659 [client-1] Bob is exercising RespondPing on 002f6fbabec4611b2a29e7cc1af672caa3de162ea49587542e2f6637e7be9b99cb in workflow Ping-Bob-5 at count 3
09:40:56.659 [client-0] Alice is exercising RespondPing on 003269231159fa888bd63d84b2f7c7f94e82300abd1b9f6ee9d45841b8d2b1e24c in workflow Ping-Alice-5 at count 5
09:40:56.778 [client-0] Alice is exercising RespondPong on 006b709bd271d7f40f87a0db37b0ffa6c186506756efc6e1a9f59bb4437a69a878 in workflow Ping-Bob-0 at count 4
09:40:56.778 [client-1] Bob is exercising RespondPong on 0087c87794a232124df541dbf0d7c9c0400e986934d3c5eb359f3d735946c2b507 in workflow Ping-Alice-8 at count 4
09:40:56.899 [client-0] Alice is exercising RespondPing on 00f323a0d6928afb5a8b1e14139c04c9deb478141aeab5034db37b13cdf243572f in workflow Ping-Alice-2 at count 7
09:40:56.899 [client-1] Bob is exercising RespondPing on 004c4d71b8ca91614308b21f8a4d56a74c8d85e9b7790ead8f58871e7ca198fa5d in workflow Ping-Bob-6 at count 3
09:40:57.018 [client-0] Alice is exercising RespondPong on 0040e509b750008da5ff0afa9c98b7b50c0ee880abd668e6eb61b0edb515a81569 in workflow Ping-Bob-1 at count 4
09:40:57.018 [client-1] Bob is exercising RespondPong on 00194b37cfb6a7295d17adc42bda932e094191786eb316a81308b48d58519cd2b1 in workflow Ping-Alice-4 at count 6
09:40:57.138 [client-0] Alice is exercising RespondPing on 004f29685187bd5e8193a241ad066b8e0e16c36665fee962980df6f76b00de8e87 in workflow Ping-Alice-6 at count 5
09:40:57.138 [client-1] Bob is exercising RespondPing on 0002e3d79098af77a7b9e245296fac359a50a1dcc98d9645c53d1c77c38cdc4137 in workflow Ping-Bob-7 at count 3
09:40:57.258 [client-0] Alice is exercising RespondPong on 00818b04b692ec84071290f629d7ab34e803328bce657247b23ec71ce675bb6061 in workflow Ping-Bob-2 at count 4
09:40:57.259 [client-1] Bob is exercising RespondPong on 005410bb977b4f81f4874087f9ee36160e0b42d59836a655f96cc4d14a2f7cdb6d in workflow Ping-Alice-9 at count 4
09:40:57.380 [client-1] Bob is exercising RespondPing on 00b92c0d386f938eaf46cf607e7d93edd0b43f5a42348d402f99551c0251beceb4 in workflow Ping-Bob-8 at count 3
09:40:57.380 [client-0] Alice is exercising RespondPing on 00472ba02a1cfe8a396789e01411c5a5a95ba51059d2e2c806635cc87caf45d6de in workflow Ping-Alice-3 at count 7
09:40:57.500 [client-0] Alice is exercising RespondPong on 00a681d7ad4b7f881cab5c0fc2e3e6de77a930edc6c634837b9584a86b2d0c3656 in workflow Ping-Bob-3 at count 4
09:40:57.500 [client-1] Bob is exercising RespondPong on 00c87a87886cf9c670a7eb89ca389d2b5d9dbe80e1976adb23139664a745d01576 in workflow Ping-Alice-1 at count 8
09:40:57.617 [client-1] Bob is exercising RespondPing on 0089bb2e5b98fc47ce195423a7258a0b11124907cbb61a84497672160efa99e54e in workflow Ping-Bob-9 at count 3
09:40:57.617 [client-0] Alice is exercising RespondPing on 0036b1d55029aa429d93896b9273b9949d51c758577931872c4c7043f397d6f62e in workflow Ping-Alice-7 at count 5
09:40:57.739 [client-0] Alice is exercising RespondPong on 00edbfe8038220726edbc37a651b5383468cea0d9defe287336ae763a565825c53 in workflow Ping-Bob-4 at count 4
09:40:57.739 [client-1] Bob is exercising RespondPong on 0002043efcbe5fcdf24d65002d8ef661ae1f465a91c69e011c17755b8482acce8a in workflow Ping-Alice-5 at count 6
09:40:57.857 [client-1] Bob is exercising RespondPing on 00a8a02dc604cf0bd4bf9538a7a5eafa0ed743249da4ba4d16d5c079c6f2c6d27a in workflow Ping-Bob-0 at count 5
09:40:57.857 [client-0] Alice is exercising RespondPing on 00ab91735ad58a4bf3cb90d3218ae752d2bc0f80c4dff077a6f39e32e2003d774b in workflow Ping-Alice-0 at count 9
09:40:57.978 [client-0] Alice is exercising RespondPong on 002f5d1eeb2ed973d639e8b91c92bb5a7fb1c1740e178642b49a5f51db9ac4ce1f in workflow Ping-Bob-5 at count 4
09:40:57.978 [client-1] Bob is exercising RespondPong on 0064efea524595f98739326b3d600511fcb37f8e389d6d61e7c5629b0e5b047c1f in workflow Ping-Alice-2 at count 8

You don’t have write access to the repository so you need to fork it so you can push somewhere. I’d still recommend to make a custom branch on your fork that you push to rather than pushing to main but that’s not that important for sharing it.

Automatic is expected.

So if I read your logs above correctly it is working fine against Sandbox?

I wonder what is the indication for this pingPongReactive to work. According to my understanding i should see the Sandbox Ledger console getting filled with printed staf indicating that new contract are being created as a respond to existing one.
I dont see such traffic in the console.
I tried manually to respond to Bob from one of Alice’s contracts with no success (no traffic on the Sandbox Console):


Sandbox Console is:

ILTLVMAC0261:ex-java-bindings le056g$ daml start --sandbox-port 7600
SDK 1.18.1 has been released!
See https://github.com/digital-asset/daml/releases/tag/v1.18.1 for details.

SDK 1.18.1 has been released!
See https://github.com/digital-asset/daml/releases/tag/v1.18.1 for details.

Compiling ex-java-bindings to a DAR.
Created .daml/dist/ex-java-bindings-0.0.1.dar
Waiting for sandbox to start:
INFO: Slf4jLogger started
INFO: Listening on localhost:7600 over plain text.
   ____             ____
  / __/__ ____  ___/ / /  ___ __ __
 _\ \/ _ `/ _ \/ _  / _ \/ _ \\ \ /
/___/\_,_/_//_/\_,_/_.__/\___/_\_\

INFO: Initialized sandbox version 1.0.0 with ledger-id = 58d5a4a1-d4f5-4f1c-baf5-adae9d911342, port = 7600, dar file = List(.daml/dist/ex-java-bindings-0.0.1.dar), time mode = wall-clock time, ledger = in-memory, auth-service = AuthServiceWildcard$, contract ids seeding = strong
Waiting for navigator to start:
   _  __          _           __
  / |/ /__ __  __(_)__ ____ _/ /____  ____
 /    / _ `/ |/ / / _ `/ _ `/ __/ _ \/ __/
/_/|_/\_,_/|___/_/\_, /\_,_/\__/\___/_/
                 /___/
Version 1.0.0
Frontend running at http://localhost:7500.
........Waiting for JSON API to start:
13:51:14.870 [main] INFO  com.daml.http.Main$ - Config(ledgerHost=localhost, ledgerPort=7600, address=127.0.0.1, httpPort=7575, portFile=None, applicationId=HTTP-JSON-API-Gateway, packageReloadInterval=5 seconds, maxInboundMessageSize=4194304, jdbcConfig=None, staticContentConfig=None, accessTokenFile=None)
13:51:15.197 [http-json-ledger-api-akka.actor.default-dispatcher-4] INFO  akka.event.slf4j.Slf4jLogger - Slf4jLogger started
13:51:16.029 [http-json-ledger-api-akka.actor.default-dispatcher-18] INFO  com.daml.http.HttpService$ - Connected to Ledger: 58d5a4a1-d4f5-4f1c-baf5-adae9d911342
13:51:16.030 [http-json-ledger-api-akka.actor.default-dispatcher-18] INFO  com.daml.http.HttpService$ - contractDao: None
13:51:16.562 [http-json-ledger-api-akka.actor.default-dispatcher-18] INFO  com.daml.http.PackageService - new package IDs loaded: ...
13:51:16.936 [http-json-ledger-api-akka.actor.default-dispatcher-17] INFO  com.daml.http.Main$ - Started server: ServerBinding(/127.0.0.1:7575)

In the Java client log (which i posted earlier) i can see 39 times that “Bob is exercising RespondPong” and 33 times that “Alice is exercising RespondPing”

According to my findings: Does it mean that the client listens to the module and react accordingly?
Liav

I took a look at your code and you are actually very close! I pushed a fixed version to Fix hub support · cocreature/ex-java-bindings@d5ce5e1 · GitHub and tested it against Daml hub. Let me go through the issues:

  1. First by trying to filter by template you actually broke the application. The way it works it sees a Ping contract then creates a Pong contract and so on. So you want it to listen on both Ping and Pong templates while you filtered down to only one of them. You could change your filter to include both or even easier, just go back to not filtering by template which is the route I went down.
  2. In thisPartyIsReceiver in processEvent you were still referring to party instead of partyId causing the check to always fail. I’ve killed party completely from the class to make sure we use the party id everywhere consistently.
  3. While you passed the token on getTransactions, you did not pass it on the command submission in processEvent which means you’ll pass the token used when constructing the ledger client rather than the one for the specific party.

After fixing those 3 issues the example works for me against Daml hub without further changes. I also changed the SDK version in daml.yaml to something more recent but that is not a requirement.

Wow Moritz, you’re a real pro and this kind of support is much appriciated. I’ll run it first thing in the morning and update

Hi Moritz,

Indeed the program works as expected! It actually subscribe to any transaction created by any of the party on the real Ledger. It’s an important ability for future DAML applications.

Regarding your fixes:

  1. Understood!
  2. Understood but thisPartyIsReceiver() method was never called in my old unsuccessfully setup hence i believe its part of DA base code (using partyName instead of partyId). Worth checking if it needs to be fixed there also.
  3. Understood!

One thing i noticed is that whenever i’m manually experimenting with the “RespongPing” (or “RespongPong”) from the Ledger itself i get an expected behaviour (see first line in the below log) followed by a weird HTTP close-stream error:

11:18:54.006 [client-2] INFO  e.p.reactive.PingPongProcessor - transaction = Transaction{transactionId='00000000000000a0', commandId='', workflowId='', effectiveAt=2022-02-26T09:18:54.443204Z, events=[ArchivedEvent{witnessParties=[ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb], eventId='#00000000000000a0:0', templateId=Identifier{packageId='b8e864550d5d351c0d66cc8d6a899a119d06e900dfedc64396e284f69a8e27e6', moduleName='PingPong', entityName='Pong'}, contractId='00268313b3df53237761181c6575f09823b3fd2bfd93600094892ea7254246b4fe'}, CreatedEvent{witnessParties=[ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb], eventId='#00000000000000a0:1', templateId=Identifier{packageId='b8e864550d5d351c0d66cc8d6a899a119d06e900dfedc64396e284f69a8e27e6', moduleName='PingPong', entityName='Ping'}, contractId='0025996ad01351bb26469f6146bcee072f74066a906436105dc324603681a5df12', arguments=DamlRecord{recordId=Optional[Identifier{packageId='b8e864550d5d351c0d66cc8d6a899a119d06e900dfedc64396e284f69a8e27e6', moduleName='PingPong', entityName='Ping'}], fields=[Field{label=Optional[sender], value=Party{value='ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246'}}, Field{label=Optional[receiver], value=Party{value='ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb'}}, Field{label=Optional[count], value=Int64{value=4}}]}, agreementText='Optional[]', contractKey=Optional.empty, signatories=[ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246], observers=[ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb]}], offset='00000000000000a0'}
11:18:54.009 [client-1] INFO  e.p.reactive.PingPongProcessor - processTransaction: Transaction{transactionId='00000000000000a0', commandId='4e1a99d8-620c-4517-ba02-ce216c906616', workflowId='', effectiveAt=2022-02-26T09:18:54.443204Z, events=[ArchivedEvent{witnessParties=[ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246], eventId='#00000000000000a0:0', templateId=Identifier{packageId='b8e864550d5d351c0d66cc8d6a899a119d06e900dfedc64396e284f69a8e27e6', moduleName='PingPong', entityName='Pong'}, contractId='00268313b3df53237761181c6575f09823b3fd2bfd93600094892ea7254246b4fe'}, CreatedEvent{witnessParties=[ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246], eventId='#00000000000000a0:1', templateId=Identifier{packageId='b8e864550d5d351c0d66cc8d6a899a119d06e900dfedc64396e284f69a8e27e6', moduleName='PingPong', entityName='Ping'}, contractId='0025996ad01351bb26469f6146bcee072f74066a906436105dc324603681a5df12', arguments=DamlRecord{recordId=Optional[Identifier{packageId='b8e864550d5d351c0d66cc8d6a899a119d06e900dfedc64396e284f69a8e27e6', moduleName='PingPong', entityName='Ping'}], fields=[Field{label=Optional[sender], value=Party{value='ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246'}}, Field{label=Optional[receiver], value=Party{value='ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb'}}, Field{label=Optional[count], value=Int64{value=4}}]}, agreementText='Optional[]', contractKey=Optional.empty, signatories=[ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246], observers=[ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb]}], offset='00000000000000a0'}
11:18:54.011 [client-3] INFO  e.p.reactive.PingPongProcessor - processTransaction: Transaction{transactionId='00000000000000a0', commandId='', workflowId='', effectiveAt=2022-02-26T09:18:54.443204Z, events=[ArchivedEvent{witnessParties=[ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb], eventId='#00000000000000a0:0', templateId=Identifier{packageId='b8e864550d5d351c0d66cc8d6a899a119d06e900dfedc64396e284f69a8e27e6', moduleName='PingPong', entityName='Pong'}, contractId='00268313b3df53237761181c6575f09823b3fd2bfd93600094892ea7254246b4fe'}, CreatedEvent{witnessParties=[ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb], eventId='#00000000000000a0:1', templateId=Identifier{packageId='b8e864550d5d351c0d66cc8d6a899a119d06e900dfedc64396e284f69a8e27e6', moduleName='PingPong', entityName='Ping'}, contractId='0025996ad01351bb26469f6146bcee072f74066a906436105dc324603681a5df12', arguments=DamlRecord{recordId=Optional[Identifier{packageId='b8e864550d5d351c0d66cc8d6a899a119d06e900dfedc64396e284f69a8e27e6', moduleName='PingPong', entityName='Ping'}], fields=[Field{label=Optional[sender], value=Party{value='ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246'}}, Field{label=Optional[receiver], value=Party{value='ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb'}}, Field{label=Optional[count], value=Int64{value=4}}]}, agreementText='Optional[]', contractKey=Optional.empty, signatories=[ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246], observers=[ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb]}], offset='00000000000000a0'}
11:18:54.011 [client-3] INFO  e.p.reactive.PingPongProcessor - ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb is exercising RespondPong on 0025996ad01351bb26469f6146bcee072f74066a906436105dc324603681a5df12 in workflow  at count 4
11:18:54.039 [client-0] INFO  e.p.reactive.PingPongProcessor - transaction = Transaction{transactionId='00000000000000a0', commandId='4e1a99d8-620c-4517-ba02-ce216c906616', workflowId='', effectiveAt=2022-02-26T09:18:54.443204Z, events=[ArchivedEvent{witnessParties=[ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246], eventId='#00000000000000a0:0', templateId=Identifier{packageId='b8e864550d5d351c0d66cc8d6a899a119d06e900dfedc64396e284f69a8e27e6', moduleName='PingPong', entityName='Pong'}, contractId='00268313b3df53237761181c6575f09823b3fd2bfd93600094892ea7254246b4fe'}, CreatedEvent{witnessParties=[ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246], eventId='#00000000000000a0:1', templateId=Identifier{packageId='b8e864550d5d351c0d66cc8d6a899a119d06e900dfedc64396e284f69a8e27e6', moduleName='PingPong', entityName='Ping'}, contractId='0025996ad01351bb26469f6146bcee072f74066a906436105dc324603681a5df12', arguments=DamlRecord{recordId=Optional[Identifier{packageId='b8e864550d5d351c0d66cc8d6a899a119d06e900dfedc64396e284f69a8e27e6', moduleName='PingPong', entityName='Ping'}], fields=[Field{label=Optional[sender], value=Party{value='ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246'}}, Field{label=Optional[receiver], value=Party{value='ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb'}}, Field{label=Optional[count], value=Int64{value=4}}]}, agreementText='Optional[]', contractKey=Optional.empty, signatories=[ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246], observers=[ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb]}], offset='00000000000000a0'}
11:18:54.243 [client-0] INFO  e.p.reactive.PingPongProcessor - transaction = Transaction{transactionId='00000000000000a1', commandId='', workflowId='', effectiveAt=2022-02-26T09:18:54.683774Z, events=[ArchivedEvent{witnessParties=[ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246], eventId='#00000000000000a1:0', templateId=Identifier{packageId='b8e864550d5d351c0d66cc8d6a899a119d06e900dfedc64396e284f69a8e27e6', moduleName='PingPong', entityName='Ping'}, contractId='0025996ad01351bb26469f6146bcee072f74066a906436105dc324603681a5df12'}, CreatedEvent{witnessParties=[ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246], eventId='#00000000000000a1:1', templateId=Identifier{packageId='b8e864550d5d351c0d66cc8d6a899a119d06e900dfedc64396e284f69a8e27e6', moduleName='PingPong', entityName='Pong'}, contractId='00635c16dcb9caa8bca9a873b902c5e5990b74889a065e58e4656fd940394f4f22', arguments=DamlRecord{recordId=Optional[Identifier{packageId='b8e864550d5d351c0d66cc8d6a899a119d06e900dfedc64396e284f69a8e27e6', moduleName='PingPong', entityName='Pong'}], fields=[Field{label=Optional[sender], value=Party{value='ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb'}}, Field{label=Optional[receiver], value=Party{value='ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246'}}, Field{label=Optional[count], value=Int64{value=5}}]}, agreementText='Optional[]', contractKey=Optional.empty, signatories=[ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb], observers=[ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246]}], offset='00000000000000a1'}
11:18:54.243 [client-2] INFO  e.p.reactive.PingPongProcessor - transaction = Transaction{transactionId='00000000000000a1', commandId='7fc67b9e-fe41-4164-94ea-4676b3c18e3e', workflowId='', effectiveAt=2022-02-26T09:18:54.683774Z, events=[ArchivedEvent{witnessParties=[ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb], eventId='#00000000000000a1:0', templateId=Identifier{packageId='b8e864550d5d351c0d66cc8d6a899a119d06e900dfedc64396e284f69a8e27e6', moduleName='PingPong', entityName='Ping'}, contractId='0025996ad01351bb26469f6146bcee072f74066a906436105dc324603681a5df12'}, CreatedEvent{witnessParties=[ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb], eventId='#00000000000000a1:1', templateId=Identifier{packageId='b8e864550d5d351c0d66cc8d6a899a119d06e900dfedc64396e284f69a8e27e6', moduleName='PingPong', entityName='Pong'}, contractId='00635c16dcb9caa8bca9a873b902c5e5990b74889a065e58e4656fd940394f4f22', arguments=DamlRecord{recordId=Optional[Identifier{packageId='b8e864550d5d351c0d66cc8d6a899a119d06e900dfedc64396e284f69a8e27e6', moduleName='PingPong', entityName='Pong'}], fields=[Field{label=Optional[sender], value=Party{value='ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb'}}, Field{label=Optional[receiver], value=Party{value='ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246'}}, Field{label=Optional[count], value=Int64{value=5}}]}, agreementText='Optional[]', contractKey=Optional.empty, signatories=[ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb], observers=[ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246]}], offset='00000000000000a1'}
11:18:54.246 [client-1] INFO  e.p.reactive.PingPongProcessor - processTransaction: Transaction{transactionId='00000000000000a1', commandId='', workflowId='', effectiveAt=2022-02-26T09:18:54.683774Z, events=[ArchivedEvent{witnessParties=[ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246], eventId='#00000000000000a1:0', templateId=Identifier{packageId='b8e864550d5d351c0d66cc8d6a899a119d06e900dfedc64396e284f69a8e27e6', moduleName='PingPong', entityName='Ping'}, contractId='0025996ad01351bb26469f6146bcee072f74066a906436105dc324603681a5df12'}, CreatedEvent{witnessParties=[ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246], eventId='#00000000000000a1:1', templateId=Identifier{packageId='b8e864550d5d351c0d66cc8d6a899a119d06e900dfedc64396e284f69a8e27e6', moduleName='PingPong', entityName='Pong'}, contractId='00635c16dcb9caa8bca9a873b902c5e5990b74889a065e58e4656fd940394f4f22', arguments=DamlRecord{recordId=Optional[Identifier{packageId='b8e864550d5d351c0d66cc8d6a899a119d06e900dfedc64396e284f69a8e27e6', moduleName='PingPong', entityName='Pong'}], fields=[Field{label=Optional[sender], value=Party{value='ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb'}}, Field{label=Optional[receiver], value=Party{value='ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246'}}, Field{label=Optional[count], value=Int64{value=5}}]}, agreementText='Optional[]', contractKey=Optional.empty, signatories=[ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb], observers=[ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246]}], offset='00000000000000a1'}
11:18:54.246 [client-1] INFO  e.p.reactive.PingPongProcessor - ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246 is exercising RespondPing on 00635c16dcb9caa8bca9a873b902c5e5990b74889a065e58e4656fd940394f4f22 in workflow  at count 5
11:18:54.251 [client-3] INFO  e.p.reactive.PingPongProcessor - processTransaction: Transaction{transactionId='00000000000000a1', commandId='7fc67b9e-fe41-4164-94ea-4676b3c18e3e', workflowId='', effectiveAt=2022-02-26T09:18:54.683774Z, events=[ArchivedEvent{witnessParties=[ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb], eventId='#00000000000000a1:0', templateId=Identifier{packageId='b8e864550d5d351c0d66cc8d6a899a119d06e900dfedc64396e284f69a8e27e6', moduleName='PingPong', entityName='Ping'}, contractId='0025996ad01351bb26469f6146bcee072f74066a906436105dc324603681a5df12'}, CreatedEvent{witnessParties=[ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb], eventId='#00000000000000a1:1', templateId=Identifier{packageId='b8e864550d5d351c0d66cc8d6a899a119d06e900dfedc64396e284f69a8e27e6', moduleName='PingPong', entityName='Pong'}, contractId='00635c16dcb9caa8bca9a873b902c5e5990b74889a065e58e4656fd940394f4f22', arguments=DamlRecord{recordId=Optional[Identifier{packageId='b8e864550d5d351c0d66cc8d6a899a119d06e900dfedc64396e284f69a8e27e6', moduleName='PingPong', entityName='Pong'}], fields=[Field{label=Optional[sender], value=Party{value='ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb'}}, Field{label=Optional[receiver], value=Party{value='ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246'}}, Field{label=Optional[count], value=Int64{value=5}}]}, agreementText='Optional[]', contractKey=Optional.empty, signatories=[ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb], observers=[ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246]}], offset='00000000000000a1'}
11:18:54.494 [client-0] INFO  e.p.reactive.PingPongProcessor - transaction = Transaction{transactionId='00000000000000a2', commandId='1d3d7515-a685-404f-94eb-7acdf9a79112', workflowId='', effectiveAt=2022-02-26T09:18:54.921602Z, events=[ArchivedEvent{witnessParties=[ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246], eventId='#00000000000000a2:0', templateId=Identifier{packageId='b8e864550d5d351c0d66cc8d6a899a119d06e900dfedc64396e284f69a8e27e6', moduleName='PingPong', entityName='Pong'}, contractId='00635c16dcb9caa8bca9a873b902c5e5990b74889a065e58e4656fd940394f4f22'}, CreatedEvent{witnessParties=[ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246], eventId='#00000000000000a2:1', templateId=Identifier{packageId='b8e864550d5d351c0d66cc8d6a899a119d06e900dfedc64396e284f69a8e27e6', moduleName='PingPong', entityName='Ping'}, contractId='00f6ac0e590b1a67b01da88684951b114f730fce3e4de4061b22a922dee8f159a1', arguments=DamlRecord{recordId=Optional[Identifier{packageId='b8e864550d5d351c0d66cc8d6a899a119d06e900dfedc64396e284f69a8e27e6', moduleName='PingPong', entityName='Ping'}], fields=[Field{label=Optional[sender], value=Party{value='ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246'}}, Field{label=Optional[receiver], value=Party{value='ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb'}}, Field{label=Optional[count], value=Int64{value=6}}]}, agreementText='Optional[]', contractKey=Optional.empty, signatories=[ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246], observers=[ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb]}], offset='00000000000000a2'}
11:18:54.494 [client-3] INFO  e.p.reactive.PingPongProcessor - processTransaction: Transaction{transactionId='00000000000000a2', commandId='', workflowId='', effectiveAt=2022-02-26T09:18:54.921602Z, events=[ArchivedEvent{witnessParties=[ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb], eventId='#00000000000000a2:0', templateId=Identifier{packageId='b8e864550d5d351c0d66cc8d6a899a119d06e900dfedc64396e284f69a8e27e6', moduleName='PingPong', entityName='Pong'}, contractId='00635c16dcb9caa8bca9a873b902c5e5990b74889a065e58e4656fd940394f4f22'}, CreatedEvent{witnessParties=[ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb], eventId='#00000000000000a2:1', templateId=Identifier{packageId='b8e864550d5d351c0d66cc8d6a899a119d06e900dfedc64396e284f69a8e27e6', moduleName='PingPong', entityName='Ping'}, contractId='00f6ac0e590b1a67b01da88684951b114f730fce3e4de4061b22a922dee8f159a1', arguments=DamlRecord{recordId=Optional[Identifier{packageId='b8e864550d5d351c0d66cc8d6a899a119d06e900dfedc64396e284f69a8e27e6', moduleName='PingPong', entityName='Ping'}], fields=[Field{label=Optional[sender], value=Party{value='ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246'}}, Field{label=Optional[receiver], value=Party{value='ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb'}}, Field{label=Optional[count], value=Int64{value=6}}]}, agreementText='Optional[]', contractKey=Optional.empty, signatories=[ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246], observers=[ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb]}], offset='00000000000000a2'}
11:18:54.494 [client-2] INFO  e.p.reactive.PingPongProcessor - transaction = Transaction{transactionId='00000000000000a2', commandId='', workflowId='', effectiveAt=2022-02-26T09:18:54.921602Z, events=[ArchivedEvent{witnessParties=[ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb], eventId='#00000000000000a2:0', templateId=Identifier{packageId='b8e864550d5d351c0d66cc8d6a899a119d06e900dfedc64396e284f69a8e27e6', moduleName='PingPong', entityName='Pong'}, contractId='00635c16dcb9caa8bca9a873b902c5e5990b74889a065e58e4656fd940394f4f22'}, CreatedEvent{witnessParties=[ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb], eventId='#00000000000000a2:1', templateId=Identifier{packageId='b8e864550d5d351c0d66cc8d6a899a119d06e900dfedc64396e284f69a8e27e6', moduleName='PingPong', entityName='Ping'}, contractId='00f6ac0e590b1a67b01da88684951b114f730fce3e4de4061b22a922dee8f159a1', arguments=DamlRecord{recordId=Optional[Identifier{packageId='b8e864550d5d351c0d66cc8d6a899a119d06e900dfedc64396e284f69a8e27e6', moduleName='PingPong', entityName='Ping'}], fields=[Field{label=Optional[sender], value=Party{value='ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246'}}, Field{label=Optional[receiver], value=Party{value='ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb'}}, Field{label=Optional[count], value=Int64{value=6}}]}, agreementText='Optional[]', contractKey=Optional.empty, signatories=[ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246], observers=[ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb]}], offset='00000000000000a2'}
11:18:54.494 [client-1] INFO  e.p.reactive.PingPongProcessor - processTransaction: Transaction{transactionId='00000000000000a2', commandId='1d3d7515-a685-404f-94eb-7acdf9a79112', workflowId='', effectiveAt=2022-02-26T09:18:54.921602Z, events=[ArchivedEvent{witnessParties=[ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246], eventId='#00000000000000a2:0', templateId=Identifier{packageId='b8e864550d5d351c0d66cc8d6a899a119d06e900dfedc64396e284f69a8e27e6', moduleName='PingPong', entityName='Pong'}, contractId='00635c16dcb9caa8bca9a873b902c5e5990b74889a065e58e4656fd940394f4f22'}, CreatedEvent{witnessParties=[ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246], eventId='#00000000000000a2:1', templateId=Identifier{packageId='b8e864550d5d351c0d66cc8d6a899a119d06e900dfedc64396e284f69a8e27e6', moduleName='PingPong', entityName='Ping'}, contractId='00f6ac0e590b1a67b01da88684951b114f730fce3e4de4061b22a922dee8f159a1', arguments=DamlRecord{recordId=Optional[Identifier{packageId='b8e864550d5d351c0d66cc8d6a899a119d06e900dfedc64396e284f69a8e27e6', moduleName='PingPong', entityName='Ping'}], fields=[Field{label=Optional[sender], value=Party{value='ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246'}}, Field{label=Optional[receiver], value=Party{value='ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb'}}, Field{label=Optional[count], value=Int64{value=6}}]}, agreementText='Optional[]', contractKey=Optional.empty, signatories=[ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246], observers=[ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb]}], offset='00000000000000a2'}
11:18:54.494 [client-3] INFO  e.p.reactive.PingPongProcessor - ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb is exercising RespondPong on 00f6ac0e590b1a67b01da88684951b114f730fce3e4de4061b22a922dee8f159a1 in workflow  at count 6
11:18:54.724 [client-2] INFO  e.p.reactive.PingPongProcessor - transaction = Transaction{transactionId='00000000000000a3', commandId='b26075ce-55fd-4fc3-8c2f-056255896095', workflowId='', effectiveAt=2022-02-26T09:18:55.170859Z, events=[ArchivedEvent{witnessParties=[ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb], eventId='#00000000000000a3:0', templateId=Identifier{packageId='b8e864550d5d351c0d66cc8d6a899a119d06e900dfedc64396e284f69a8e27e6', moduleName='PingPong', entityName='Ping'}, contractId='00f6ac0e590b1a67b01da88684951b114f730fce3e4de4061b22a922dee8f159a1'}, CreatedEvent{witnessParties=[ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb], eventId='#00000000000000a3:1', templateId=Identifier{packageId='b8e864550d5d351c0d66cc8d6a899a119d06e900dfedc64396e284f69a8e27e6', moduleName='PingPong', entityName='Pong'}, contractId='00b2d1072a347f395c8af49c44d20308655f30f31a1c0009a4c655dcc56cfe07aa', arguments=DamlRecord{recordId=Optional[Identifier{packageId='b8e864550d5d351c0d66cc8d6a899a119d06e900dfedc64396e284f69a8e27e6', moduleName='PingPong', entityName='Pong'}], fields=[Field{label=Optional[sender], value=Party{value='ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb'}}, Field{label=Optional[receiver], value=Party{value='ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246'}}, Field{label=Optional[count], value=Int64{value=7}}]}, agreementText='Optional[]', contractKey=Optional.empty, signatories=[ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb], observers=[ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246]}], offset='00000000000000a3'}
11:18:54.725 [client-1] INFO  e.p.reactive.PingPongProcessor - processTransaction: Transaction{transactionId='00000000000000a3', commandId='', workflowId='', effectiveAt=2022-02-26T09:18:55.170859Z, events=[ArchivedEvent{witnessParties=[ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246], eventId='#00000000000000a3:0', templateId=Identifier{packageId='b8e864550d5d351c0d66cc8d6a899a119d06e900dfedc64396e284f69a8e27e6', moduleName='PingPong', entityName='Ping'}, contractId='00f6ac0e590b1a67b01da88684951b114f730fce3e4de4061b22a922dee8f159a1'}, CreatedEvent{witnessParties=[ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246], eventId='#00000000000000a3:1', templateId=Identifier{packageId='b8e864550d5d351c0d66cc8d6a899a119d06e900dfedc64396e284f69a8e27e6', moduleName='PingPong', entityName='Pong'}, contractId='00b2d1072a347f395c8af49c44d20308655f30f31a1c0009a4c655dcc56cfe07aa', arguments=DamlRecord{recordId=Optional[Identifier{packageId='b8e864550d5d351c0d66cc8d6a899a119d06e900dfedc64396e284f69a8e27e6', moduleName='PingPong', entityName='Pong'}], fields=[Field{label=Optional[sender], value=Party{value='ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb'}}, Field{label=Optional[receiver], value=Party{value='ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246'}}, Field{label=Optional[count], value=Int64{value=7}}]}, agreementText='Optional[]', contractKey=Optional.empty, signatories=[ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb], observers=[ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246]}], offset='00000000000000a3'}
11:18:54.725 [client-1] INFO  e.p.reactive.PingPongProcessor - ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246 is exercising RespondPing on 00b2d1072a347f395c8af49c44d20308655f30f31a1c0009a4c655dcc56cfe07aa in workflow  at count 7
11:18:54.726 [client-0] INFO  e.p.reactive.PingPongProcessor - transaction = Transaction{transactionId='00000000000000a3', commandId='', workflowId='', effectiveAt=2022-02-26T09:18:55.170859Z, events=[ArchivedEvent{witnessParties=[ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246], eventId='#00000000000000a3:0', templateId=Identifier{packageId='b8e864550d5d351c0d66cc8d6a899a119d06e900dfedc64396e284f69a8e27e6', moduleName='PingPong', entityName='Ping'}, contractId='00f6ac0e590b1a67b01da88684951b114f730fce3e4de4061b22a922dee8f159a1'}, CreatedEvent{witnessParties=[ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246], eventId='#00000000000000a3:1', templateId=Identifier{packageId='b8e864550d5d351c0d66cc8d6a899a119d06e900dfedc64396e284f69a8e27e6', moduleName='PingPong', entityName='Pong'}, contractId='00b2d1072a347f395c8af49c44d20308655f30f31a1c0009a4c655dcc56cfe07aa', arguments=DamlRecord{recordId=Optional[Identifier{packageId='b8e864550d5d351c0d66cc8d6a899a119d06e900dfedc64396e284f69a8e27e6', moduleName='PingPong', entityName='Pong'}], fields=[Field{label=Optional[sender], value=Party{value='ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb'}}, Field{label=Optional[receiver], value=Party{value='ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246'}}, Field{label=Optional[count], value=Int64{value=7}}]}, agreementText='Optional[]', contractKey=Optional.empty, signatories=[ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb], observers=[ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246]}], offset='00000000000000a3'}
11:18:54.740 [client-3] INFO  e.p.reactive.PingPongProcessor - processTransaction: Transaction{transactionId='00000000000000a3', commandId='b26075ce-55fd-4fc3-8c2f-056255896095', workflowId='', effectiveAt=2022-02-26T09:18:55.170859Z, events=[ArchivedEvent{witnessParties=[ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb], eventId='#00000000000000a3:0', templateId=Identifier{packageId='b8e864550d5d351c0d66cc8d6a899a119d06e900dfedc64396e284f69a8e27e6', moduleName='PingPong', entityName='Ping'}, contractId='00f6ac0e590b1a67b01da88684951b114f730fce3e4de4061b22a922dee8f159a1'}, CreatedEvent{witnessParties=[ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb], eventId='#00000000000000a3:1', templateId=Identifier{packageId='b8e864550d5d351c0d66cc8d6a899a119d06e900dfedc64396e284f69a8e27e6', moduleName='PingPong', entityName='Pong'}, contractId='00b2d1072a347f395c8af49c44d20308655f30f31a1c0009a4c655dcc56cfe07aa', arguments=DamlRecord{recordId=Optional[Identifier{packageId='b8e864550d5d351c0d66cc8d6a899a119d06e900dfedc64396e284f69a8e27e6', moduleName='PingPong', entityName='Pong'}], fields=[Field{label=Optional[sender], value=Party{value='ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb'}}, Field{label=Optional[receiver], value=Party{value='ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246'}}, Field{label=Optional[count], value=Int64{value=7}}]}, agreementText='Optional[]', contractKey=Optional.empty, signatories=[ledger-party-1dc946a0-0398-4d81-8dc0-d5a976096cdb], observers=[ledger-party-38f28393-45b6-4740-806a-ffc5d01a8246]}], offset='00000000000000a3'}
11:18:54.742 [client-0] ERROR c.d.g.a.SingleThreadExecutionSequencer - Unhandled exception in SingleThreadExecutionSequencer.
io.reactivex.exceptions.OnErrorNotImplementedException: INTERNAL: RST_STREAM closed stream. HTTP/2 error code: INTERNAL_ERROR
	at io.reactivex.internal.functions.Functions$OnErrorMissingConsumer.accept(Functions.java:704)
	at io.reactivex.internal.functions.Functions$OnErrorMissingConsumer.accept(Functions.java:701)
	at io.reactivex.internal.subscribers.LambdaSubscriber.onError(LambdaSubscriber.java:79)
	at io.reactivex.internal.operators.flowable.FlowableFlattenIterable$FlattenIterableSubscriber.checkTerminated(FlowableFlattenIterable.java:396)
	at io.reactivex.internal.operators.flowable.FlowableFlattenIterable$FlattenIterableSubscriber.drain(FlowableFlattenIterable.java:256)
	at io.reactivex.internal.operators.flowable.FlowableFlattenIterable$FlattenIterableSubscriber.onError(FlowableFlattenIterable.java:182)
	at io.reactivex.internal.subscribers.BasicFuseableSubscriber.onError(BasicFuseableSubscriber.java:101)
	at com.daml.grpc.adapter.client.rs.BufferingResponseObserver.lambda$onError$3(BufferingResponseObserver.java:81)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: io.grpc.StatusRuntimeException: INTERNAL: RST_STREAM closed stream. HTTP/2 error code: INTERNAL_ERROR
	at io.grpc.Status.asRuntimeException(Status.java:535)
	at io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onClose(ClientCalls.java:478)
	at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:557)
	at io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:69)
	at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:738)
	at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:717)
	at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
	at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:133)
	... 3 common frames omitted

According to google and by looking at the stacktrace this issue need to be investigated on the server side (Ledger) and DA might want to implement a callback handler to process such error. I assume this issue wasn’t tested before (manually creating a contract) since the app was alive for 5 seconds (i extended it to 2 minute).

My next challenge is taking this logic and implementing it in order to replace the below code which manually fetch for contracts matching a given filter. Will try and update.

private static void processActiveContracts(DamlLedgerClient client, XsdMetadata metadata) {
    ActiveContractsClient activeContractsClient = client.getActiveContractSetClient();
    TransactionFilter filter = filterFor(TEMPLATE_ID, ADMIN_PARTY);
    Flowable<GetActiveContractsResponse> activeContracts =
        activeContractsClient.getActiveContracts(filter, true);
    activeContracts.blockingForEach(
        response -> {
          response.getCreatedEvents().stream()
              .map(PolicyPagesNotification.Contract::fromCreatedEvent)
              .forEach(
                  contract -> {
                      // Do something with the contract
                  });
        });
  }


  private static TransactionFilter filterFor(Identifier templateId, String party) {
    InclusiveFilter inclusiveFilter = new InclusiveFilter(Collections.singleton(templateId));
    Map<String, Filter> filter = Collections.singletonMap(party, inclusiveFilter);
    return new FiltersByParty(filter);
  }

The reason it was never called was point 1: You filtered your transactions down to one of the templates and got the other so you never got any events.

For the stream error, if you can reproduce that please open a separate question with instructions for how to reproduce for that to avoid mixing up too many things.