public abstract class AbstractAmqpChannel extends AbstractMessageChannel implements 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 AmqpAdmin |
getAdmin() |
protected AmqpTemplate |
getAmqpTemplate() |
protected ConnectionFactory |
getConnectionFactory() |
protected String |
getExchangeName()
Subclasses may override this method to return an Exchange name.
|
protected AmqpHeaderMapper |
getInboundHeaderMapper() |
protected 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(Connection connection) |
void |
onCreate(Connection connection) |
protected void |
onInit()
Subclasses may implement this for initialization logic.
|
protected void |
setAdmin(AmqpAdmin admin) |
protected void |
setConnectionFactory(ConnectionFactory connectionFactory) |
void |
setDefaultDeliveryMode(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
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(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 AmqpTemplate getAmqpTemplate()
protected RabbitTemplate getRabbitTemplate()
protected final void setAdmin(AmqpAdmin admin)
protected final void setConnectionFactory(ConnectionFactory connectionFactory)
protected AmqpAdmin getAdmin()
protected 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(Connection connection)
onCreate
in interface ConnectionListener
public void onClose(Connection connection)
onClose
in interface ConnectionListener
protected abstract void doDeclares()