Package io.hekate.messaging.intercept
Interface ClientOutboundContext<T>
-
- Type Parameters:
T
- Message type.
- All Known Subinterfaces:
ClientSendContext<T>
public interface ClientOutboundContext<T>
Client's outbound message context.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
affinity()
Returns the hash code of affinity key or a synthetically generated value if affinity key was not specified for the messaging operation.Object
affinityKey()
Returns the affinity key of the messaging operation ornull
if the affinity key wasn't specified.String
channelName()
Returns the channel name (seeMessagingChannel.name()
).Object
getAttribute(String name)
Returns the attribute for the specified name.boolean
hasAffinity()
Returnstrue
if the messaging operation has an affinity key (seeaffinityKey()
).T
payload()
Returns the outbound message.Optional<FailedAttempt>
prevFailure()
Returns the previous failure in case if this is a retry attempt.ClusterNode
receiver()
Target node that was selected by theLoadBalancer
.ClusterTopology
topology()
Cluster topology that was used by theLoadBalancer
.OutboundType
type()
Returns the type of this message.
-
-
-
Method Detail
-
type
OutboundType type()
Returns the type of this message.- Returns:
- Type of this message.
-
payload
T payload()
Returns the outbound message.- Returns:
- Message.
-
channelName
String channelName()
Returns the channel name (seeMessagingChannel.name()
).- Returns:
- Channel name.
-
getAttribute
Object getAttribute(String name)
Returns the attribute for the specified name.- Parameters:
name
- Name.- Returns:
- Value or
null
if there is no such attribute. - See Also:
ClientSendContext.setAttribute(String, Object)
-
receiver
ClusterNode receiver()
Target node that was selected by theLoadBalancer
.- Returns:
- Target node that was selected by the
LoadBalancer
.
-
topology
ClusterTopology topology()
Cluster topology that was used by theLoadBalancer
.- Returns:
- Cluster topology that was used by the
LoadBalancer
.
-
hasAffinity
boolean hasAffinity()
Returnstrue
if the messaging operation has an affinity key (seeaffinityKey()
).- Returns:
true
if the messaging operation has an affinity key.
-
affinity
int affinity()
Returns the hash code of affinity key or a synthetically generated value if affinity key was not specified for the messaging operation.- Returns:
- Hash code of affinity key.
-
affinityKey
Object affinityKey()
Returns the affinity key of the messaging operation ornull
if the affinity key wasn't specified.- Returns:
- Affinity key or
null
.
-
prevFailure
Optional<FailedAttempt> prevFailure()
Returns the previous failure in case if this is a retry attempt.- Returns:
- Failure of a previous attempt.
-
-