public interface NettyCamelStateCorrelationManager
NettyCamelState
when doing request/reply via NettyProducer
.
This SPI allows custom implementations to correlate the request and replies.Modifier and Type | Method and Description |
---|---|
NettyCamelState |
getState(io.netty.channel.ChannelHandlerContext ctx,
io.netty.channel.Channel channel,
Object msg)
Gets the state when a response message has been received.
|
NettyCamelState |
getState(io.netty.channel.ChannelHandlerContext ctx,
io.netty.channel.Channel channel,
Throwable cause)
Gets the state when some internal error occurred.
|
void |
putState(io.netty.channel.Channel channel,
NettyCamelState state)
Puts the state.
|
void |
removeState(io.netty.channel.ChannelHandlerContext ctx,
io.netty.channel.Channel channel)
Removes the state when the channel is inactive.
|
void putState(io.netty.channel.Channel channel, NettyCamelState state)
NettyCamelState
instance.channel
- the channelstate
- the Camel state to be storedvoid removeState(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.Channel channel)
ctx
- netty channel handler contextchannel
- the channelNettyCamelState getState(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.Channel channel, Object msg)
Map
instance
then this method should remove the state from the map as its no longer needed. In other
words use the Map.remove(Object)
to get and remove the state.ctx
- netty channel handler contextchannel
- the channelmsg
- the response messageNettyCamelState getState(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.Channel channel, Throwable cause)
ctx
- netty channel handler contextchannel
- the channelcause
- the errorApache Camel