public abstract class AbstractAmqpChannel extends AbstractMessageChannel implements org.springframework.amqp.rabbit.connection.ConnectionListener
AbstractMessageChannel.ChannelInterceptorList
IntegrationManagement.ManagementOverrides
interceptors, meters
EXPRESSION_PARSER, logger
INDEFINITE_TIMEOUT
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME
Modifier and Type | Method and Description |
---|---|
void |
destroy() |
protected abstract void |
doDeclares() |
protected boolean |
doSend(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 String |
getExchangeName()
Subclasses may override this method to return an Exchange name.
|
protected AmqpHeaderMapper |
getInboundHeaderMapper() |
protected org.springframework.amqp.rabbit.core.RabbitTemplate |
getRabbitTemplate() |
protected String |
getRoutingKey()
Subclasses may override this method to return a routing key.
|
protected boolean |
isExtractPayload() |
boolean |
isLoggingEnabled()
Return whether logging is enabled.
|
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)
Enable logging or not.
|
addInterceptor, addInterceptor, getComponentType, getFullChannelName, getIChannelInterceptorList, getIntegrationPatternType, getInterceptors, getMetricsCaptor, getOverrides, registerMetricsCaptor, removeInterceptor, removeInterceptor, send, send, setDatatypes, setInterceptors, setMessageConverter, setShouldTrack
afterPropertiesSet, 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, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
onFailed, onShutDown
getManagedName, getManagedType, getThisAs, setManagedName, setManagedType
getBeanName, getComponentName
public boolean isLoggingEnabled()
IntegrationManagement
isLoggingEnabled
in interface IntegrationManagement
isLoggingEnabled
in class AbstractMessageChannel
public void setLoggingEnabled(boolean loggingEnabled)
IntegrationManagement
setLoggingEnabled
in interface IntegrationManagement
setLoggingEnabled
in class AbstractMessageChannel
loggingEnabled
- dalse to disable.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 String getExchangeName()
protected 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()
IntegrationObjectSupport
onInit
in class AbstractMessageChannel
public void destroy()
destroy
in interface DisposableBean
destroy
in interface IntegrationManagement
destroy
in class AbstractMessageChannel
protected boolean doSend(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()