public interface Correlator
SenderTask
of receiving the appropriate response to the
original request. This is done based on a correlation id that is extracted from both request and response.
Upon a successful match, SenderTask.registerResponse(Serializable)
is called.
For performance reasons, all interface methods should be implemented thread safe without locking and or synchronization.
All implementations should make sure that they do not keep eating up the memory and clean their data structures regularly.Modifier and Type | Method and Description |
---|---|
void |
registerRequest(SenderTask senderTask,
Message message,
Properties messageAttributes)
Registers a request to be sent.
|
void |
registerResponse(Serializable response,
io.vertx.core.MultiMap headers)
Extracts the correlation id from the response and calls the corresponding sender task's
SenderTask.registerResponse(Serializable) method. |
void registerRequest(SenderTask senderTask, Message message, Properties messageAttributes)
senderTask
- SenderTask
controlling the sending of the message.message
- The message to be sent and from which the correlation id is extracted.messageAttributes
- Message attributes of the message to be sent. Can help with correlation id extraction.void registerResponse(Serializable response, io.vertx.core.MultiMap headers)
SenderTask.registerResponse(Serializable)
method.
Called from a receiver upon receiving a response.response
- The response received by Receiver
.headers
- Headers received with the response. Can be useful for discovering correlation id.Copyright © 2010–2017 PerfCake Community. All rights reserved.