Add support for direct binding

and refactor channel proxy behaviour

- Remove DirectChannelProxyFactory;
- Proxies create channels as necessary, including support for PollableChannels;
- Channel beans are using the bean factory methods for the proxies;
- Coordinate bind/unbind across a context through the internal Bindable interface;
- Add support for embedding modules as independent child contexts of the main module, wrapped in a Bindable interface;
- Add support for channel name namespacing;
- Use a shared channel registry (consulted by the proxies) to create direct bindings;

Restrict the use of SharedChannelRegistry to aggregation

Fixed copyrights

Polishing based on comments from the previous branch

Tweaks

- namespacing takes into account module index, so multiple modules with the same class can partiticipate
- fix how properties are passes to parent/child
- Split ChannelBindingLifecycle from ChannelBindingAdapter and register it with each child;

Javadoc updates

Pass only  prefixed properties

Actually use the filtering method

Lifecycle simplifications

- Removing BindableChannelWrapper and UnbindOnCloseApplicationListener and relying on ChannelBindingListener solely;
- Some code cleanup

Further simplifications

More cleanup

Remove BindableUtils, rename ChannelBindingAdapter

Minor improvements

Addressing some comments, renaming, etc

More polishing
This commit is contained in:
Marius Bogoevici
2015-08-06 09:04:57 -04:00
committed by Mark Fisher
parent 80391fa876
commit bd47560bd5
55 changed files with 1368 additions and 1451 deletions

View File

@@ -24,43 +24,43 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
@ConfigurationProperties(prefix = "spring.cloud.stream.binder.local.executor")
class LocalExecutorConfigurationProperties {
private int executorCorePoolSize;
private int corePoolSize;
private int executorMaxPoolSize;
private int maxPoolSize;
private int executorQueueSize = Integer.MAX_VALUE;
private int queueSize = Integer.MAX_VALUE;
private int executorKeepAliveSeconds;
private int keepAliveSeconds;
public int getExecutorCorePoolSize() {
return executorCorePoolSize;
public int getCorePoolSize() {
return corePoolSize;
}
public void setExecutorCorePoolSize(int executorCorePoolSize) {
this.executorCorePoolSize = executorCorePoolSize;
public void setCorePoolSize(int corePoolSize) {
this.corePoolSize = corePoolSize;
}
public int getExecutorMaxPoolSize() {
return executorMaxPoolSize;
public int getMaxPoolSize() {
return maxPoolSize;
}
public void setExecutorMaxPoolSize(int executorMaxPoolSize) {
this.executorMaxPoolSize = executorMaxPoolSize;
public void setMaxPoolSize(int maxPoolSize) {
this.maxPoolSize = maxPoolSize;
}
public int getExecutorQueueSize() {
return executorQueueSize;
public int getQueueSize() {
return queueSize;
}
public void setExecutorQueueSize(int executorQueueSize) {
this.executorQueueSize = executorQueueSize;
public void setQueueSize(int queueSize) {
this.queueSize = queueSize;
}
public int getExecutorKeepAliveSeconds() {
return executorKeepAliveSeconds;
public int getKeepAliveSeconds() {
return keepAliveSeconds;
}
public void setExecutorKeepAliveSeconds(int executorKeepAliveSeconds) {
this.executorKeepAliveSeconds = executorKeepAliveSeconds;
public void setKeepAliveSeconds(int keepAliveSeconds) {
this.keepAliveSeconds = keepAliveSeconds;
}
}

View File

@@ -44,10 +44,10 @@ public class LocalMessageChannelBinderConfiguration {
public LocalMessageChannelBinder localMessageChannelBinder() {
LocalMessageChannelBinder localMessageChannelBinder = new LocalMessageChannelBinder();
localMessageChannelBinder.setExecutorCorePoolSize(localExecutorConfigurationProperties.getExecutorCorePoolSize());
localMessageChannelBinder.setExecutorKeepAliveSeconds(localExecutorConfigurationProperties.getExecutorKeepAliveSeconds());
localMessageChannelBinder.setExecutorMaxPoolSize(localExecutorConfigurationProperties.getExecutorMaxPoolSize());
localMessageChannelBinder.setExecutorQueueSize(localExecutorConfigurationProperties.getExecutorQueueSize());
localMessageChannelBinder.setExecutorCorePoolSize(localExecutorConfigurationProperties.getCorePoolSize());
localMessageChannelBinder.setExecutorKeepAliveSeconds(localExecutorConfigurationProperties.getKeepAliveSeconds());
localMessageChannelBinder.setExecutorMaxPoolSize(localExecutorConfigurationProperties.getMaxPoolSize());
localMessageChannelBinder.setExecutorQueueSize(localExecutorConfigurationProperties.getQueueSize());
if (polling > 0) {
PollerMetadata pollerMetadata = new PollerMetadata();