public abstract class AbstractBinder<T,C extends ConsumerProperties,P extends ProducerProperties> extends Object implements org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean, Binder<T,C,P>
Binder
implementations.Modifier and Type | Field and Description |
---|---|
protected org.apache.commons.logging.Log |
logger |
Constructor and Description |
---|
AbstractBinder() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
static String |
applyPrefix(String prefix,
String name)
For binder implementations that support a prefix, apply the prefix to the name.
|
Binding<T> |
bindConsumer(String name,
String group,
T target,
C properties)
Bind the target component as a message consumer to the logical entity identified by
the name.
|
Binding<T> |
bindProducer(String name,
T outboundBindTarget,
P properties)
Bind the target component as a message producer to the logical entity identified by
the name.
|
protected String |
buildPartitionRoutingExpression(String expressionRoot)
Deprecated.
|
protected org.springframework.retry.support.RetryTemplate |
buildRetryTemplate(ConsumerProperties properties)
Create and configure a default retry template unless one
has already been provided via @Bean by an application.
|
static String |
constructDLQName(String name)
For binder implementations that support dead lettering, construct the name of the
dead letter entity for the underlying pipe name.
|
protected abstract Binding<T> |
doBindConsumer(String name,
String group,
T inputTarget,
C properties) |
protected abstract Binding<T> |
doBindProducer(String name,
T outboundBindTarget,
P properties) |
protected org.springframework.context.support.AbstractApplicationContext |
getApplicationContext() |
protected org.springframework.beans.factory.config.ConfigurableListableBeanFactory |
getBeanFactory() |
protected org.springframework.expression.EvaluationContext |
getEvaluationContext() |
protected String |
groupedName(String name,
String group)
Construct a name comprised of the name and group.
|
protected void |
onInit()
Subclasses may implement this method to perform any necessary initialization.
|
protected MessageValues |
serializePayloadIfNecessary(org.springframework.messaging.Message<?> message)
Deprecated.
|
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
public static String applyPrefix(String prefix, String name)
prefix
- the prefix.name
- the name.public static String constructDLQName(String name)
name
- the name.protected org.springframework.context.support.AbstractApplicationContext getApplicationContext()
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
org.springframework.beans.BeansException
protected org.springframework.beans.factory.config.ConfigurableListableBeanFactory getBeanFactory()
protected org.springframework.expression.EvaluationContext getEvaluationContext()
public final void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
protected void onInit() throws Exception
afterPropertiesSet()
which is itself final
.Exception
public final Binding<T> bindConsumer(String name, String group, T target, C properties)
Binder
bindConsumer
in interface Binder<T,C extends ConsumerProperties,P extends ProducerProperties>
name
- the logical identity of the message sourcegroup
- the consumer group to which this consumer belongs - subscriptions are
shared among consumers in the same group (a null
or empty String, must
be treated as an anonymous group that doesn't share the subscription with any other
consumer)target
- the app interface to be bound as a consumerproperties
- the consumer propertiesprotected abstract Binding<T> doBindConsumer(String name, String group, T inputTarget, C properties)
public final Binding<T> bindProducer(String name, T outboundBindTarget, P properties)
Binder
bindProducer
in interface Binder<T,C extends ConsumerProperties,P extends ProducerProperties>
name
- the logical identity of the message targetoutboundBindTarget
- the app interface to be bound as a producerproperties
- the producer propertiesprotected abstract Binding<T> doBindProducer(String name, T outboundBindTarget, P properties)
protected final String groupedName(String name, String group)
name
- the name.group
- the group.@Deprecated protected final MessageValues serializePayloadIfNecessary(org.springframework.messaging.Message<?> message)
MessageValues
built from Message
. Remains primarily for
backward compatibility and will be removed in the next major release.@Deprecated protected String buildPartitionRoutingExpression(String expressionRoot)
protected org.springframework.retry.support.RetryTemplate buildRetryTemplate(ConsumerProperties properties)
properties
- The properties.Copyright © 2019 Pivotal Software, Inc.. All rights reserved.