public abstract class AbstractAmqpChannel extends AbstractMessageChannel implements org.springframework.beans.factory.DisposableBean, org.springframework.amqp.rabbit.connection.ConnectionListener
AbstractMessageChannel.ChannelInterceptorList
IntegrationManagement.ManagementOverrides
interceptors
EXPRESSION_PARSER, logger
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME
Modifier and Type | Method and Description |
---|---|
void |
destroy() |
protected abstract void |
doDeclares() |
protected boolean |
doSend(org.springframework.messaging.Message<?> message,
long timeout)
Subclasses must implement this method.
|
protected org.springframework.amqp.core.AmqpAdmin |
getAdmin() |
protected org.springframework.amqp.core.AmqpTemplate |
getAmqpTemplate() |
protected org.springframework.amqp.rabbit.connection.ConnectionFactory |
getConnectionFactory() |
protected java.lang.String |
getExchangeName()
Subclasses may override this method to return an Exchange name.
|
protected AmqpHeaderMapper |
getInboundHeaderMapper() |
protected org.springframework.amqp.rabbit.core.RabbitTemplate |
getRabbitTemplate() |
protected java.lang.String |
getRoutingKey()
Subclasses may override this method to return a routing key.
|
protected boolean |
isExtractPayload() |
boolean |
isLoggingEnabled() |
void |
onClose(org.springframework.amqp.rabbit.connection.Connection connection) |
void |
onCreate(org.springframework.amqp.rabbit.connection.Connection connection) |
protected void |
onInit()
Subclasses may implement this for initialization logic.
|
protected void |
setAdmin(org.springframework.amqp.core.AmqpAdmin admin) |
protected void |
setConnectionFactory(org.springframework.amqp.rabbit.connection.ConnectionFactory connectionFactory) |
void |
setDefaultDeliveryMode(org.springframework.amqp.core.MessageDeliveryMode defaultDeliveryMode)
Set the delivery mode to use if the message has no
"amqp_deliveryMode"
header and the message property was not set by the
MessagePropertiesConverter . |
void |
setExtractPayload(boolean extractPayload)
Set to true to extract the payload and map the headers; otherwise
the entire message is converted and sent.
|
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 |
setLoggingEnabled(boolean loggingEnabled) |
addInterceptor, addInterceptor, configureMetrics, getChannelInterceptors, getComponentType, getErrorRate, getFullChannelName, getInterceptors, getMaxSendDuration, getMeanErrorRate, getMeanErrorRatio, getMeanSendDuration, getMeanSendRate, getMetrics, getMetricsCaptor, getMinSendDuration, getOverrides, getSendCount, getSendCountLong, getSendDuration, getSendErrorCount, getSendErrorCountLong, getSendRate, getStandardDeviationSendDuration, getTimeSinceLastSend, isCountsEnabled, isStatsEnabled, registerMetricsCaptor, removeInterceptor, removeInterceptor, reset, send, send, setCountsEnabled, setDatatypes, setInterceptors, setMessageConverter, setShouldTrack, setStatsEnabled
afterPropertiesSet, extractTypeIfPossible, getApplicationContext, getApplicationContextId, getBeanFactory, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
onShutDown
getComponentName
public boolean isLoggingEnabled()
isLoggingEnabled
in interface IntegrationManagement
isLoggingEnabled
in class AbstractMessageChannel
public void setLoggingEnabled(boolean loggingEnabled)
setLoggingEnabled
in interface IntegrationManagement
setLoggingEnabled
in class AbstractMessageChannel
public void setDefaultDeliveryMode(org.springframework.amqp.core.MessageDeliveryMode defaultDeliveryMode)
MessagePropertiesConverter
.defaultDeliveryMode
- the default delivery mode.public void setExtractPayload(boolean extractPayload)
extractPayload
- true to extract and map.protected boolean isExtractPayload()
setExtractPayload(boolean)
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.
Only applies when extractPayload
is true.
Default: false.headersMappedLast
- true if headers are mapped after conversion.protected java.lang.String getExchangeName()
protected java.lang.String getRoutingKey()
protected AmqpHeaderMapper getInboundHeaderMapper()
protected org.springframework.amqp.core.AmqpTemplate getAmqpTemplate()
protected org.springframework.amqp.rabbit.core.RabbitTemplate getRabbitTemplate()
protected final void setAdmin(org.springframework.amqp.core.AmqpAdmin admin)
protected final void setConnectionFactory(org.springframework.amqp.rabbit.connection.ConnectionFactory connectionFactory)
protected org.springframework.amqp.core.AmqpAdmin getAdmin()
protected org.springframework.amqp.rabbit.connection.ConnectionFactory getConnectionFactory()
protected void onInit() throws java.lang.Exception
IntegrationObjectSupport
onInit
in class AbstractMessageChannel
java.lang.Exception
- Any exception.public void destroy() throws java.lang.Exception
destroy
in interface org.springframework.beans.factory.DisposableBean
java.lang.Exception
protected boolean doSend(org.springframework.messaging.Message<?> message, long timeout)
AbstractMessageChannel
doSend
in class AbstractMessageChannel
message
- The message.timeout
- The timeout.public void onCreate(org.springframework.amqp.rabbit.connection.Connection connection)
onCreate
in interface org.springframework.amqp.rabbit.connection.ConnectionListener
public void onClose(org.springframework.amqp.rabbit.connection.Connection connection)
onClose
in interface org.springframework.amqp.rabbit.connection.ConnectionListener
protected abstract void doDeclares()