Make integration tests pass in AMQP mode, part 1 (#1855)

This commit is contained in:
Viktor Kolomeyko
2017-10-11 11:13:46 +01:00
committed by GitHub
parent 4ee250a19b
commit ef0f0acc4a
5 changed files with 27 additions and 14 deletions

View File

@ -213,6 +213,7 @@ data class TopicSession(val topic: String, val sessionID: Long = MessagingServic
* These IDs and timestamps should not be assumed to be globally unique, although due to the nanosecond precision of
* the timestamp field they probably will be, even if an implementation just uses a hash prefix as the message id.
*/
@CordaSerializable
interface Message {
val topicSession: TopicSession
val data: ByteArray

View File

@ -133,6 +133,11 @@ class NodeMessagingClient(override val config: NodeConfiguration,
persistentEntityClass = RetryMessage::class.java
)
}
private class NodeClientMessage(override val topicSession: TopicSession, override val data: ByteArray, override val uniqueMessageId: UUID) : Message {
override val debugTimestamp: Instant = Instant.now()
override fun toString() = "$topicSession#${String(data)}"
}
}
private class InnerState {
@ -599,13 +604,7 @@ class NodeMessagingClient(override val config: NodeConfiguration,
override fun createMessage(topicSession: TopicSession, data: ByteArray, uuid: UUID): Message {
// TODO: We could write an object that proxies directly to an underlying MQ message here and avoid copying.
return object : Message {
override val topicSession: TopicSession = topicSession
override val data: ByteArray = data
override val debugTimestamp: Instant = Instant.now()
override val uniqueMessageId: UUID = uuid
override fun toString() = "$topicSession#${String(data)}"
}
return NodeClientMessage(topicSession, data, uuid)
}
private fun createOutOfProcessVerifierService(): TransactionVerifierService {