public abstract class AbstractAmqpOutboundEndpoint extends AbstractReplyProducingMessageHandler implements Lifecycle
| Modifier and Type | Class and Description |
|---|---|
protected static class |
AbstractAmqpOutboundEndpoint.CorrelationDataWrapper |
AbstractReplyProducingMessageHandler.RequestHandlerIntegrationManagement.ManagementOverridesmessagingTemplateEXPRESSION_PARSER, loggerMETER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAMEHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE| Constructor and Description |
|---|
AbstractAmqpOutboundEndpoint() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addDelayProperty(Message<?> message,
Message amqpMessage) |
protected AbstractIntegrationMessageBuilder<?> |
buildReply(MessageConverter converter,
Message amqpReplyMessage) |
protected Message<?> |
buildReturnedMessage(Message message,
int replyCode,
String replyText,
String exchange,
String returnedRoutingKey,
MessageConverter converter) |
protected void |
doInit() |
protected void |
doStart() |
protected void |
doStop() |
protected void |
endpointInit()
Subclasses can override to perform any additional initialization.
|
protected CorrelationData |
generateCorrelationData(Message<?> requestMessage) |
protected String |
generateExchangeName(Message<?> requestMessage) |
protected String |
generateRoutingKey(Message<?> requestMessage) |
protected MessageChannel |
getConfirmAckChannel() |
protected Expression |
getConfirmCorrelationExpression() |
protected MessageChannel |
getConfirmNackChannel() |
protected java.time.Duration |
getConfirmTimeout() |
protected ExpressionEvaluatingMessageProcessor<Object> |
getCorrelationDataGenerator() |
protected MessageDeliveryMode |
getDefaultDeliveryMode() |
protected String |
getExchangeName() |
protected Expression |
getExchangeNameExpression() |
protected ExpressionEvaluatingMessageProcessor<String> |
getExchangeNameGenerator() |
AmqpHeaderMapper |
getHeaderMapper() |
protected abstract RabbitTemplate |
getRabbitTemplate() |
protected MessageChannel |
getReturnChannel() |
protected String |
getRoutingKey() |
protected Expression |
getRoutingKeyExpression() |
protected ExpressionEvaluatingMessageProcessor<String> |
getRoutingKeyGenerator() |
protected void |
handleConfirm(CorrelationData correlationData,
boolean ack,
String cause) |
protected boolean |
isHeadersMappedLast() |
protected boolean |
isLazyConnect() |
boolean |
isRunning() |
void |
setConfirmAckChannel(MessageChannel ackChannel)
Set the channel to which acks are send (publisher confirms).
|
void |
setConfirmAckChannelName(String ackChannelName)
Set the channel name to which acks are send (publisher confirms).
|
void |
setConfirmCorrelationExpression(Expression confirmCorrelationExpression)
Set a SpEL expression to evaluate confirm correlation at runtime.
|
void |
setConfirmCorrelationExpressionString(String confirmCorrelationExpression)
Set a SpEL expression to evaluate confirm correlation at runtime.
|
void |
setConfirmNackChannel(MessageChannel nackChannel)
Set the channel to which nacks are send (publisher confirms).
|
void |
setConfirmNackChannelName(String nackChannelName)
Set the channel name to which nacks are send (publisher confirms).
|
void |
setConfirmTimeout(long confirmTimeout)
Set a timeout after which a nack will be synthesized if no publisher confirm has
been received within that time.
|
protected void |
setConnectionFactory(ConnectionFactory connectionFactory) |
void |
setDefaultDeliveryMode(MessageDeliveryMode defaultDeliveryMode)
Set the default delivery mode.
|
void |
setDelay(int delay)
Set the value to set in the
x-delay header when using the
RabbitMQ delayed message exchange plugin. |
void |
setDelayExpression(Expression delayExpression)
Set the SpEL expression to calculate the
x-delay header when using the
RabbitMQ delayed message exchange plugin. |
void |
setDelayExpressionString(String delayExpression)
Set the SpEL expression to calculate the
x-delay header when using the
RabbitMQ delayed message exchange plugin. |
void |
setErrorMessageStrategy(ErrorMessageStrategy errorMessageStrategy)
Set the error message strategy to use for returned (or negatively confirmed)
messages.
|
void |
setExchangeName(String exchangeName)
Configure an AMQP exchange name for sending messages.
|
void |
setExchangeNameExpression(Expression exchangeNameExpression)
Configure a SpEL expression to evaluate an exchange name at runtime.
|
void |
setExchangeNameExpressionString(String exchangeNameExpression) |
void |
setHeaderMapper(AmqpHeaderMapper headerMapper)
Set a custom
AmqpHeaderMapper for mapping request and reply headers. |
void |
setHeadersMappedLast(boolean headersMappedLast)
When mapping headers for the outbound message, determine whether the headers are
mapped before the message is converted, or afterwards.
|
void |
setLazyConnect(boolean lazyConnect)
Set to
false to attempt to connect during endpoint start;
default true, meaning the connection will be attempted
to be established on the arrival of the first message. |
void |
setReturnChannel(MessageChannel returnChannel)
Set the channel to which returned messages are sent.
|
void |
setRoutingKey(String routingKey)
Configure an AMQP routing key for sending messages.
|
void |
setRoutingKeyExpression(Expression routingKeyExpression) |
void |
setRoutingKeyExpressionString(String routingKeyExpression) |
void |
start() |
void |
stop() |
doInvokeAdvisedRequestHandler, getBeanClassLoader, getIntegrationPatternType, getRequiresReply, handleMessageInternal, handleRequestMessage, hasAdviceChain, onInit, setAdviceChain, setBeanClassLoader, setRequiresReplyaddNotPropagatedHeaders, createOutputMessage, getNotPropagatedHeaders, getOutputChannel, isAsync, messageBuilderForReply, produceOutput, resolveErrorChannel, sendErrorMessage, sendOutput, sendOutputs, setAsync, setNotPropagatedHeaders, setOutputChannel, setOutputChannelName, setSendTimeout, shouldCopyRequestHeaders, shouldSplitOutput, updateNotPropagatedHeadershandleMessage, onComplete, onError, onNext, onSubscribebuildSendTimer, configureMetrics, destroy, getActiveCount, getActiveCountLong, getComponentType, getDuration, getErrorCount, getErrorCountLong, getHandleCount, getHandleCountLong, getHandlerMetrics, getManagedName, getManagedType, getMaxDuration, getMeanDuration, getMetricsCaptor, getMinDuration, getOrder, getOverrides, getStandardDeviationDuration, isCountsEnabled, isLoggingEnabled, isStatsEnabled, registerMetricsCaptor, reset, sendTimer, setCountsEnabled, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, setStatsEnabled, shouldTrackafterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waiterrorCount, handleCountgetBeanName, getComponentNamepublic void setHeaderMapper(AmqpHeaderMapper headerMapper)
AmqpHeaderMapper for mapping request and reply headers.
Defaults to DefaultAmqpHeaderMapper.outboundMapper().headerMapper - the AmqpHeaderMapper to use.public void setHeadersMappedLast(boolean headersMappedLast)
SimpleMessageConverter with a
String payload that contains json; the converter will set the content type to
text/plain which can be overridden to application/json by setting
the AmqpHeaders.CONTENT_TYPE message header. Default: false.headersMappedLast - true if headers are mapped after conversion.public void setExchangeName(String exchangeName)
exchangeName - the exchange name for sending messages.public void setExchangeNameExpression(Expression exchangeNameExpression)
exchangeNameExpression - the expression to use.public void setExchangeNameExpressionString(String exchangeNameExpression)
exchangeNameExpression - the String in SpEL syntax.public void setRoutingKey(String routingKey)
routingKey - the routing key to usepublic void setRoutingKeyExpression(Expression routingKeyExpression)
routingKeyExpression - the expression to use.public void setRoutingKeyExpressionString(String routingKeyExpression)
routingKeyExpression - the String in SpEL syntax.public void setConfirmCorrelationExpression(Expression confirmCorrelationExpression)
confirmCorrelationExpression - the expression to use.public void setConfirmCorrelationExpressionString(String confirmCorrelationExpression)
confirmCorrelationExpression - the String in SpEL syntax.public void setConfirmAckChannel(MessageChannel ackChannel)
ackChannel - the channel.public void setConfirmAckChannelName(String ackChannelName)
ackChannelName - the channel name.public void setConfirmNackChannel(MessageChannel nackChannel)
nackChannel - the channel.public void setConfirmNackChannelName(String nackChannelName)
nackChannelName - the channel name.public void setReturnChannel(MessageChannel returnChannel)
returnChannel - the channel.public void setDefaultDeliveryMode(MessageDeliveryMode defaultDeliveryMode)
defaultDeliveryMode - the delivery mode.public void setLazyConnect(boolean lazyConnect)
false to attempt to connect during endpoint start;
default true, meaning the connection will be attempted
to be established on the arrival of the first message.lazyConnect - the lazyConnect to setpublic void setDelay(int delay)
x-delay header when using the
RabbitMQ delayed message exchange plugin. By default, the AmqpHeaders.DELAY
header (if present) is mapped; setting the delay here overrides that value.delay - the delay.public void setDelayExpression(Expression delayExpression)
x-delay header when using the
RabbitMQ delayed message exchange plugin. By default, the AmqpHeaders.DELAY
header (if present) is mapped; setting the expression here overrides that value.delayExpression - the expression.public void setDelayExpressionString(@Nullable String delayExpression)
x-delay header when using the
RabbitMQ delayed message exchange plugin. By default, the AmqpHeaders.DELAY
header (if present) is mapped; setting the expression here overrides that value.delayExpression - the expression.public void setErrorMessageStrategy(ErrorMessageStrategy errorMessageStrategy)
errorMessageStrategy - the strategy.public void setConfirmTimeout(long confirmTimeout)
confirmTimeout - the approximate timeout.setConfirmNackChannel(MessageChannel)protected final void setConnectionFactory(ConnectionFactory connectionFactory)
protected String getExchangeName()
protected String getRoutingKey()
protected Expression getExchangeNameExpression()
protected Expression getRoutingKeyExpression()
protected ExpressionEvaluatingMessageProcessor<String> getRoutingKeyGenerator()
protected ExpressionEvaluatingMessageProcessor<String> getExchangeNameGenerator()
public AmqpHeaderMapper getHeaderMapper()
protected Expression getConfirmCorrelationExpression()
protected ExpressionEvaluatingMessageProcessor<Object> getCorrelationDataGenerator()
protected MessageChannel getConfirmAckChannel()
protected MessageChannel getConfirmNackChannel()
protected MessageChannel getReturnChannel()
protected MessageDeliveryMode getDefaultDeliveryMode()
protected boolean isLazyConnect()
protected boolean isHeadersMappedLast()
@Nullable protected java.time.Duration getConfirmTimeout()
protected final void doInit()
doInit in class AbstractReplyProducingMessageHandlerprotected void endpointInit()
@Nullable protected abstract RabbitTemplate getRabbitTemplate()
protected void doStart()
protected void doStop()
protected CorrelationData generateCorrelationData(Message<?> requestMessage)
protected AbstractIntegrationMessageBuilder<?> buildReply(MessageConverter converter, Message amqpReplyMessage)
protected Message<?> buildReturnedMessage(Message message, int replyCode, String replyText, String exchange, String returnedRoutingKey, MessageConverter converter)
protected void handleConfirm(CorrelationData correlationData, boolean ack, String cause)