{"action":"created","comment":{"url":"https://api.github.com/repos/corda/corda/pulls/comments/187070646","pull_request_review_id":118776146,"id":187070646,"diff_hunk":"@@ -0,0 +1,103 @@\n+package net.corda.client.rpc.internal.serialization.amqp\n+\n+\n+import net.corda.client.rpc.internal.ObservableContext\n+import net.corda.core.context.Trace\n+import net.corda.core.serialization.SerializationContext\n+import net.corda.nodeapi.RPCApi\n+import net.corda.nodeapi.internal.serialization.amqp.*\n+import org.apache.qpid.proton.codec.Data\n+import rx.Notification\n+import rx.Observable\n+import rx.subjects.UnicastSubject\n+import java.io.NotSerializableException\n+import java.lang.reflect.Type\n+import java.time.Instant\n+import java.util.concurrent.atomic.AtomicInteger\n+import javax.transaction.NotSupportedException\n+\n+object RpcClientObservableSerializer : CustomSerializer.Implements<Observable<*>>(Observable::class.java) {\n+    private object RpcObservableContextKey\n+\n+    fun createContext(\n+            serializationContext: SerializationContext,\n+            observableContext: ObservableContext\n+    ) = serializationContext.withProperty(RpcObservableContextKey, observableContext)\n+\n+    private fun <T> pinInSubscriptions(observable: Observable<T>, hardReferenceStore: MutableSet<Observable<*>>): Observable<T> {\n+        val refCount = AtomicInteger(0)\n+        return observable.doOnSubscribe {\n+            if (refCount.getAndIncrement() == 0) {\n+                require(hardReferenceStore.add(observable)) {\n+                    \"Reference store already contained reference $this on add\"\n+                }\n+            }\n+        }.doOnUnsubscribe {\n+            if (refCount.decrementAndGet() == 0) {\n+                require(hardReferenceStore.remove(observable)) {\n+                    \"Reference store did not contain reference $this on remove\"\n+                }\n+            }\n+        }\n+    }\n+\n+    override val schemaForDocumentation = Schema(\n+            listOf(\n+                    RestrictedType(","path":"client/rpc/src/main/kotlin/net/corda/client/rpc/internal/serialization/amqp/RpcClientObservableSerializer.kt","position":46,"original_position":46,"commit_id":"319f3b0b8c7a95700faaa5de0c914ad876e10f87","original_commit_id":"319f3b0b8c7a95700faaa5de0c914ad876e10f87","user":{"login":"rick-r3","id":23558791,"avatar_url":"https://avatars2.githubusercontent.com/u/23558791?v=4","gravatar_id":"","url":"https://api.github.com/users/rick-r3","html_url":"https://github.com/rick-r3","followers_url":"https://api.github.com/users/rick-r3/followers","following_url":"https://api.github.com/users/rick-r3/following{/other_user}","gists_url":"https://api.github.com/users/rick-r3/gists{/gist_id}","starred_url":"https://api.github.com/users/rick-r3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rick-r3/subscriptions","organizations_url":"https://api.github.com/users/rick-r3/orgs","repos_url":"https://api.github.com/users/rick-r3/repos","events_url":"https://api.github.com/users/rick-r3/events{/privacy}","received_events_url":"https://api.github.com/users/rick-r3/received_events","type":"User","site_admin":false},"body":"Is this correct?  It looks to me like this is a CompositeType of String + Long, looking at `readObject`.","created_at":"2018-05-09T15:01:50Z","updated_at":"2018-05-09T15:01:50Z","html_url":"https://github.com/corda/corda/pull/3072#discussion_r187070646","pull_request_url":"https://api.github.com/repos/corda/corda/pulls/3072","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/corda/corda/pulls/comments/187070646"},"html":{"href":"https://github.com/corda/corda/pull/3072#discussion_r187070646"},"pull_request":{"href":"https://api.github.com/repos/corda/corda/pulls/3072"}}},"pull_request":{"url":"https://api.github.com/repos/corda/corda/pulls/3072","id":185771979,"html_url":"https://github.com/corda/corda/pull/3072","diff_url":"https://github.com/corda/corda/pull/3072.diff","patch_url":"https://github.com/corda/corda/pull/3072.patch","issue_url":"https://api.github.com/repos/corda/corda/issues/3072","number":3072,"state":"open","locked":false,"title":"CORDA-847 - AMQP RPC ","user":{"login":"fenryka","id":3903362,"avatar_url":"https://avatars3.githubusercontent.com/u/3903362?v=4","gravatar_id":"","url":"https://api.github.com/users/fenryka","html_url":"https://github.com/fenryka","followers_url":"https://api.github.com/users/fenryka/followers","following_url":"https://api.github.com/users/fenryka/following{/other_user}","gists_url":"https://api.github.com/users/fenryka/gists{/gist_id}","starred_url":"https://api.github.com/users/fenryka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fenryka/subscriptions","organizations_url":"https://api.github.com/users/fenryka/orgs","repos_url":"https://api.github.com/users/fenryka/repos","events_url":"https://api.github.com/users/fenryka/events{/privacy}","received_events_url":"https://api.github.com/users/fenryka/received_events","type":"User","site_admin":false},"body":"Adding / Enabling AMQP for RPC","created_at":"2018-05-03T16:30:30Z","updated_at":"2018-05-09T15:01:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"87a382c1caa01141a01938849f0aa23c4d22f1f3","assignee":{"login":"fenryka","id":3903362,"avatar_url":"https://avatars3.githubusercontent.com/u/3903362?v=4","gravatar_id":"","url":"https://api.github.com/users/fenryka","html_url":"https://github.com/fenryka","followers_url":"https://api.github.com/users/fenryka/followers","following_url":"https://api.github.com/users/fenryka/following{/other_user}","gists_url":"https://api.github.com/users/fenryka/gists{/gist_id}","starred_url":"https://api.github.com/users/fenryka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fenryka/subscriptions","organizations_url":"https://api.github.com/users/fenryka/orgs","repos_url":"https://api.github.com/users/fenryka/repos","events_url":"https://api.github.com/users/fenryka/events{/privacy}","received_events_url":"https://api.github.com/users/fenryka/received_events","type":"User","site_admin":false},"assignees":[{"login":"fenryka","id":3903362,"avatar_url":"https://avatars3.githubusercontent.com/u/3903362?v=4","gravatar_id":"","url":"https://api.github.com/users/fenryka","html_url":"https://github.com/fenryka","followers_url":"https://api.github.com/users/fenryka/followers","following_url":"https://api.github.com/users/fenryka/following{/other_user}","gists_url":"https://api.github.com/users/fenryka/gists{/gist_id}","starred_url":"https://api.github.com/users/fenryka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fenryka/subscriptions","organizations_url":"https://api.github.com/users/fenryka/orgs","repos_url":"https://api.github.com/users/fenryka/repos","events_url":"https://api.github.com/users/fenryka/events{/privacy}","received_events_url":"https://api.github.com/users/fenryka/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/corda/corda/pulls/3072/commits","review_comments_url":"https://api.github.com/repos/corda/corda/pulls/3072/comments","review_comment_url":"https://api.github.com/repos/corda/corda/pulls/comments{/number}","comments_url":"https://api.github.com/repos/corda/corda/issues/3072/comments","statuses_url":"https://api.github.com/repos/corda/corda/statuses/319f3b0b8c7a95700faaa5de0c914ad876e10f87","head":{"label":"corda:kat/feature/amqp-rpc","ref":"kat/feature/amqp-rpc","sha":"319f3b0b8c7a95700faaa5de0c914ad876e10f87","user":{"login":"corda","id":22600631,"avatar_url":"https://avatars1.githubusercontent.com/u/22600631?v=4","gravatar_id":"","url":"https://api.github.com/users/corda","html_url":"https://github.com/corda","followers_url":"https://api.github.com/users/corda/followers","following_url":"https://api.github.com/users/corda/following{/other_user}","gists_url":"https://api.github.com/users/corda/gists{/gist_id}","starred_url":"https://api.github.com/users/corda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/corda/subscriptions","organizations_url":"https://api.github.com/users/corda/orgs","repos_url":"https://api.github.com/users/corda/repos","events_url":"https://api.github.com/users/corda/events{/privacy}","received_events_url":"https://api.github.com/users/corda/received_events","type":"Organization","site_admin":false},"repo":{"id":70137417,"name":"corda","full_name":"corda/corda","owner":{"login":"corda","id":22600631,"avatar_url":"https://avatars1.githubusercontent.com/u/22600631?v=4","gravatar_id":"","url":"https://api.github.com/users/corda","html_url":"https://github.com/corda","followers_url":"https://api.github.com/users/corda/followers","following_url":"https://api.github.com/users/corda/following{/other_user}","gists_url":"https://api.github.com/users/corda/gists{/gist_id}","starred_url":"https://api.github.com/users/corda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/corda/subscriptions","organizations_url":"https://api.github.com/users/corda/orgs","repos_url":"https://api.github.com/users/corda/repos","events_url":"https://api.github.com/users/corda/events{/privacy}","received_events_url":"https://api.github.com/users/corda/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/corda/corda","description":"Corda is a distributed ledger platform designed to record, manage and automate legal agreements between business partners. Designed by (and for) the world's largest financial institutions yet with applications in multiple industries.  It offers a unique response to the privacy and scalability challenges facing decentralised applications.","fork":false,"url":"https://api.github.com/repos/corda/corda","forks_url":"https://api.github.com/repos/corda/corda/forks","keys_url":"https://api.github.com/repos/corda/corda/keys{/key_id}","collaborators_url":"https://api.github.com/repos/corda/corda/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/corda/corda/teams","hooks_url":"https://api.github.com/repos/corda/corda/hooks","issue_events_url":"https://api.github.com/repos/corda/corda/issues/events{/number}","events_url":"https://api.github.com/repos/corda/corda/events","assignees_url":"https://api.github.com/repos/corda/corda/assignees{/user}","branches_url":"https://api.github.com/repos/corda/corda/branches{/branch}","tags_url":"https://api.github.com/repos/corda/corda/tags","blobs_url":"https://api.github.com/repos/corda/corda/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/corda/corda/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/corda/corda/git/refs{/sha}","trees_url":"https://api.github.com/repos/corda/corda/git/trees{/sha}","statuses_url":"https://api.github.com/repos/corda/corda/statuses/{sha}","languages_url":"https://api.github.com/repos/corda/corda/languages","stargazers_url":"https://api.github.com/repos/corda/corda/stargazers","contributors_url":"https://api.github.com/repos/corda/corda/contributors","subscribers_url":"https://api.github.com/repos/corda/corda/subscribers","subscription_url":"https://api.github.com/repos/corda/corda/subscription","commits_url":"https://api.github.com/repos/corda/corda/commits{/sha}","git_commits_url":"https://api.github.com/repos/corda/corda/git/commits{/sha}","comments_url":"https://api.github.com/repos/corda/corda/comments{/number}","issue_comment_url":"https://api.github.com/repos/corda/corda/issues/comments{/number}","contents_url":"https://api.github.com/repos/corda/corda/contents/{+path}","compare_url":"https://api.github.com/repos/corda/corda/compare/{base}...{head}","merges_url":"https://api.github.com/repos/corda/corda/merges","archive_url":"https://api.github.com/repos/corda/corda/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/corda/corda/downloads","issues_url":"https://api.github.com/repos/corda/corda/issues{/number}","pulls_url":"https://api.github.com/repos/corda/corda/pulls{/number}","milestones_url":"https://api.github.com/repos/corda/corda/milestones{/number}","notifications_url":"https://api.github.com/repos/corda/corda/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/corda/corda/labels{/name}","releases_url":"https://api.github.com/repos/corda/corda/releases{/id}","deployments_url":"https://api.github.com/repos/corda/corda/deployments","created_at":"2016-10-06T08:46:29Z","updated_at":"2018-05-09T14:45:38Z","pushed_at":"2018-05-09T14:53:11Z","git_url":"git://github.com/corda/corda.git","ssh_url":"git@github.com:corda/corda.git","clone_url":"https://github.com/corda/corda.git","svn_url":"https://github.com/corda/corda","homepage":"https://www.corda.net","size":130378,"stargazers_count":1850,"watchers_count":1850,"language":"Kotlin","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":479,"mirror_url":null,"archived":false,"open_issues_count":110,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":479,"open_issues":110,"watchers":1850,"default_branch":"master"}},"base":{"label":"corda:master","ref":"master","sha":"fe87f16d985571e98c9ed2374efdde281b9812e8","user":{"login":"corda","id":22600631,"avatar_url":"https://avatars1.githubusercontent.com/u/22600631?v=4","gravatar_id":"","url":"https://api.github.com/users/corda","html_url":"https://github.com/corda","followers_url":"https://api.github.com/users/corda/followers","following_url":"https://api.github.com/users/corda/following{/other_user}","gists_url":"https://api.github.com/users/corda/gists{/gist_id}","starred_url":"https://api.github.com/users/corda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/corda/subscriptions","organizations_url":"https://api.github.com/users/corda/orgs","repos_url":"https://api.github.com/users/corda/repos","events_url":"https://api.github.com/users/corda/events{/privacy}","received_events_url":"https://api.github.com/users/corda/received_events","type":"Organization","site_admin":false},"repo":{"id":70137417,"name":"corda","full_name":"corda/corda","owner":{"login":"corda","id":22600631,"avatar_url":"https://avatars1.githubusercontent.com/u/22600631?v=4","gravatar_id":"","url":"https://api.github.com/users/corda","html_url":"https://github.com/corda","followers_url":"https://api.github.com/users/corda/followers","following_url":"https://api.github.com/users/corda/following{/other_user}","gists_url":"https://api.github.com/users/corda/gists{/gist_id}","starred_url":"https://api.github.com/users/corda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/corda/subscriptions","organizations_url":"https://api.github.com/users/corda/orgs","repos_url":"https://api.github.com/users/corda/repos","events_url":"https://api.github.com/users/corda/events{/privacy}","received_events_url":"https://api.github.com/users/corda/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/corda/corda","description":"Corda is a distributed ledger platform designed to record, manage and automate legal agreements between business partners. Designed by (and for) the world's largest financial institutions yet with applications in multiple industries.  It offers a unique response to the privacy and scalability challenges facing decentralised applications.","fork":false,"url":"https://api.github.com/repos/corda/corda","forks_url":"https://api.github.com/repos/corda/corda/forks","keys_url":"https://api.github.com/repos/corda/corda/keys{/key_id}","collaborators_url":"https://api.github.com/repos/corda/corda/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/corda/corda/teams","hooks_url":"https://api.github.com/repos/corda/corda/hooks","issue_events_url":"https://api.github.com/repos/corda/corda/issues/events{/number}","events_url":"https://api.github.com/repos/corda/corda/events","assignees_url":"https://api.github.com/repos/corda/corda/assignees{/user}","branches_url":"https://api.github.com/repos/corda/corda/branches{/branch}","tags_url":"https://api.github.com/repos/corda/corda/tags","blobs_url":"https://api.github.com/repos/corda/corda/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/corda/corda/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/corda/corda/git/refs{/sha}","trees_url":"https://api.github.com/repos/corda/corda/git/trees{/sha}","statuses_url":"https://api.github.com/repos/corda/corda/statuses/{sha}","languages_url":"https://api.github.com/repos/corda/corda/languages","stargazers_url":"https://api.github.com/repos/corda/corda/stargazers","contributors_url":"https://api.github.com/repos/corda/corda/contributors","subscribers_url":"https://api.github.com/repos/corda/corda/subscribers","subscription_url":"https://api.github.com/repos/corda/corda/subscription","commits_url":"https://api.github.com/repos/corda/corda/commits{/sha}","git_commits_url":"https://api.github.com/repos/corda/corda/git/commits{/sha}","comments_url":"https://api.github.com/repos/corda/corda/comments{/number}","issue_comment_url":"https://api.github.com/repos/corda/corda/issues/comments{/number}","contents_url":"https://api.github.com/repos/corda/corda/contents/{+path}","compare_url":"https://api.github.com/repos/corda/corda/compare/{base}...{head}","merges_url":"https://api.github.com/repos/corda/corda/merges","archive_url":"https://api.github.com/repos/corda/corda/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/corda/corda/downloads","issues_url":"https://api.github.com/repos/corda/corda/issues{/number}","pulls_url":"https://api.github.com/repos/corda/corda/pulls{/number}","milestones_url":"https://api.github.com/repos/corda/corda/milestones{/number}","notifications_url":"https://api.github.com/repos/corda/corda/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/corda/corda/labels{/name}","releases_url":"https://api.github.com/repos/corda/corda/releases{/id}","deployments_url":"https://api.github.com/repos/corda/corda/deployments","created_at":"2016-10-06T08:46:29Z","updated_at":"2018-05-09T14:45:38Z","pushed_at":"2018-05-09T14:53:11Z","git_url":"git://github.com/corda/corda.git","ssh_url":"git@github.com:corda/corda.git","clone_url":"https://github.com/corda/corda.git","svn_url":"https://github.com/corda/corda","homepage":"https://www.corda.net","size":130378,"stargazers_count":1850,"watchers_count":1850,"language":"Kotlin","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":479,"mirror_url":null,"archived":false,"open_issues_count":110,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":479,"open_issues":110,"watchers":1850,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/corda/corda/pulls/3072"},"html":{"href":"https://github.com/corda/corda/pull/3072"},"issue":{"href":"https://api.github.com/repos/corda/corda/issues/3072"},"comments":{"href":"https://api.github.com/repos/corda/corda/issues/3072/comments"},"review_comments":{"href":"https://api.github.com/repos/corda/corda/pulls/3072/comments"},"review_comment":{"href":"https://api.github.com/repos/corda/corda/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/corda/corda/pulls/3072/commits"},"statuses":{"href":"https://api.github.com/repos/corda/corda/statuses/319f3b0b8c7a95700faaa5de0c914ad876e10f87"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"rick-r3"}}