mirror of
https://github.com/corda/corda.git
synced 2024-12-20 13:33:12 +00:00
Corda-2209 - Make the AMQP bridge individually ACK artemis messages (so that we don't have to wait for an ack flush or end up with ack'd messages queued up). (#4568) (#4574)
This commit is contained in:
parent
8e535b2a8a
commit
22388d812c
@ -158,7 +158,7 @@ class AMQPBridgeManager(config: MutualSslConfiguration, maxMessageSize: Int,
|
||||
logWarnWithMDC(msg)
|
||||
bridgeMetricsService?.packetDropEvent(artemisMessage, msg)
|
||||
// Ack the message to prevent same message being sent to us again.
|
||||
artemisMessage.acknowledge()
|
||||
artemisMessage.individualAcknowledge()
|
||||
return
|
||||
}
|
||||
val data = ByteArray(artemisMessage.bodySize).apply { artemisMessage.bodyBuffer.readBytes(this) }
|
||||
@ -181,7 +181,7 @@ class AMQPBridgeManager(config: MutualSslConfiguration, maxMessageSize: Int,
|
||||
logDebugWithMDC { "Bridge ACK ${sendableMessage.onComplete.get()}" }
|
||||
lock.withLock {
|
||||
if (sendableMessage.onComplete.get() == MessageStatus.Acknowledged) {
|
||||
artemisMessage.acknowledge()
|
||||
artemisMessage.individualAcknowledge()
|
||||
} else {
|
||||
logInfoWithMDC("Rollback rejected message uuid: ${artemisMessage.getObjectProperty("_AMQ_DUPL_ID")}")
|
||||
// We need to commit any acknowledged messages before rolling back the failed
|
||||
|
Loading…
Reference in New Issue
Block a user