Interface MessageEndpoint
-
- All Known Subinterfaces:
MessageLogReceiverEndpoint,MessageQueueReceiverEndpoint,MessageReceiverEndpoint,MessageSenderEndpoint
- All Known Implementing Classes:
AbstractMessageEndpoint,AbstractMessageLogReceiverEndpoint,AbstractMessageReceiverEndpoint,AbstractMessageSenderEndpoint,DelegateMessageLogReceiverEndpoint,DelegateMessageQueueReceiverEndpoint,DelegateMessageSenderEndpoint
public interface MessageEndpointEndpoint that is used by an application to access the messaging infrastructure to send or receive messages.
The
MessageEndpointclass is intended to derivemessage sender,message receiverormessage-log receiverendpoints.Message Endpoint code is custom to both the application and the messaging system’s client API. The rest of the application knows little about message formats, messaging channels, or any of the other details of communicating with other applications via messaging. It just knows that it has a request or piece of data to send to another application, or is expecting those from another application.
It is the messaging endpoint code that takes that command or data, makes it into a message, and sends it on a particular messaging channel. It is the endpoint that receives a message, extracts the contents, and gives them to the application in a meaningful way.
- See Also:
- EIP: Message Endpoint
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringgetChannelName()Returns the name of the channel.EndpointTypegetEndpointType()InterceptorChaingetInterceptorChain()Returns theInterceptorChainof theMessageEndpoint.TextMessageintercept(TextMessage message)Intercepts a message using all registered interceptors and returns the resulting message.
-
-
-
Method Detail
-
getChannelName
@Nonnull java.lang.String getChannelName()
Returns the name of the channel.The channel name corresponds to the name of the underlying stream, queue or message log.
- Returns:
- name of the channel
-
getInterceptorChain
@Nonnull InterceptorChain getInterceptorChain()
Returns theInterceptorChainof theMessageEndpoint.- Returns:
- InterceptorChain
-
getEndpointType
@Nonnull EndpointType getEndpointType()
- Returns:
- EndpointType
-
intercept
@Nullable TextMessage intercept(@Nonnull TextMessage message)
Intercepts a message using all registered interceptors and returns the resulting message.The interceptors are called in order. The result of one interceptor is propagated to the next interceptor in the chain, until the end of the chain is reached, or one interceptor has returned null.
If
nullis returned, the message must be dropped by theAbstractMessageEndpoint.Every interceptor may transform the message, or may take additional actions like, for example, logging, monitoring or other things.
- Parameters:
message- the message to intercept- Returns:
- the (possibly modified) message, or null if the message should be dropped.
-
-