diff --git a/spring-bus-core/pom.xml b/spring-bus-core/pom.xml
index 2d6071a6b..a32884eb4 100644
--- a/spring-bus-core/pom.xml
+++ b/spring-bus-core/pom.xml
@@ -27,6 +27,11 @@
org.springframework.boot
spring-boot-starter-actuator
+
+ org.springframework.cloud
+ spring-cloud-starter
+ true
+
org.springframework.boot
spring-boot-starter-web
@@ -57,6 +62,11 @@
spring-boot-starter-test
test
+
+ org.scala-lang
+ scala-library
+ 2.10.4
+
diff --git a/spring-bus-core/src/main/java/org/springframework/bus/runner/adapter/ChannelLocator.java b/spring-bus-core/src/main/java/org/springframework/bus/runner/adapter/ChannelLocator.java
new file mode 100644
index 000000000..b235c1ef5
--- /dev/null
+++ b/spring-bus-core/src/main/java/org/springframework/bus/runner/adapter/ChannelLocator.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2015 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.springframework.bus.runner.adapter;
+
+/**
+ * @author Dave Syer
+ *
+ */
+// TODO: Use DestinationResolver?
+public interface ChannelLocator {
+
+ String locate(String name);
+
+}
diff --git a/spring-bus-core/src/main/java/org/springframework/bus/runner/adapter/ChannelsMetadata.java b/spring-bus-core/src/main/java/org/springframework/bus/runner/adapter/ChannelsMetadata.java
new file mode 100644
index 000000000..c3a32a4c2
--- /dev/null
+++ b/spring-bus-core/src/main/java/org/springframework/bus/runner/adapter/ChannelsMetadata.java
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2015 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.springframework.bus.runner.adapter;
+
+import java.util.Collection;
+import java.util.Collections;
+
+import org.springframework.bus.runner.config.MessageBusProperties;
+
+/**
+ * @author Dave Syer
+ *
+ */
+public class ChannelsMetadata {
+
+ private Collection outputChannels = Collections.emptySet();
+ private Collection inputChannels = Collections.emptySet();
+ private MessageBusProperties module;
+
+ public MessageBusProperties getModule() {
+ return module;
+ }
+
+ public void setModule(MessageBusProperties module) {
+ this.module = module;
+ }
+
+ public Collection getOutputChannels() {
+ return outputChannels;
+ }
+
+ public void setOutputChannels(Collection outputChannels) {
+ this.outputChannels = outputChannels;
+ }
+
+ public Collection getInputChannels() {
+ return inputChannels;
+ }
+
+ public void setInputChannels(Collection inputChannels) {
+ this.inputChannels = inputChannels;
+ }
+
+}
diff --git a/spring-bus-core/src/main/java/org/springframework/bus/runner/adapter/DefaultChannelLocator.java b/spring-bus-core/src/main/java/org/springframework/bus/runner/adapter/DefaultChannelLocator.java
new file mode 100644
index 000000000..5f17d0b23
--- /dev/null
+++ b/spring-bus-core/src/main/java/org/springframework/bus/runner/adapter/DefaultChannelLocator.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright 2015 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.springframework.bus.runner.adapter;
+
+import org.springframework.bus.runner.config.MessageBusProperties;
+
+import reactor.util.StringUtils;
+
+/**
+ * @author Dave Syer
+ *
+ */
+public class DefaultChannelLocator implements ChannelLocator {
+
+ private MessageBusProperties module;
+
+ public DefaultChannelLocator(MessageBusProperties module) {
+ this.module = module;
+ }
+
+ @Override
+ public String locate(String name) {
+ String channelName = extractChannelName("input", name, this.module.getInputChannelName());
+ if (channelName!=null) {
+ return channelName;
+ }
+ channelName = extractChannelName("output", name, this.module.getOutputChannelName());
+ if (channelName!=null) {
+ return channelName;
+ }
+ return null;
+ }
+
+
+ private String extractChannelName(String start, String name,
+ String externalChannelName) {
+ if (name.equals(start)) {
+ return externalChannelName;
+ }
+ else if (name.startsWith(start + ".") || name.startsWith(start + "_")) {
+ String prefix = "";
+ String channelName = name.substring(start.length() + 1);
+ if (channelName.contains(":")) {
+ String[] tokens = channelName.split(":", 2);
+ String type = tokens[0];
+ if ("queue".equals(type)) {
+ // omit the type for a queue
+ if (StringUtils.hasText(tokens[1])) {
+ prefix = tokens[1] + ".";
+ }
+ }
+ else {
+ prefix = channelName + (channelName.endsWith(":") ? "" : ".");
+ }
+ }
+ else {
+ prefix = channelName + ".";
+ }
+ return prefix + getPlainChannelName(externalChannelName);
+ }
+ return null;
+ }
+
+ private String getPlainChannelName(String name) {
+ if (name.contains(":")) {
+ name = name.substring(name.indexOf(":") + 1);
+ }
+ return name;
+ }
+
+}
diff --git a/spring-bus-core/src/main/java/org/springframework/bus/runner/adapter/DiscoveryChannelLocator.java b/spring-bus-core/src/main/java/org/springframework/bus/runner/adapter/DiscoveryChannelLocator.java
new file mode 100644
index 000000000..57e9b78ef
--- /dev/null
+++ b/spring-bus-core/src/main/java/org/springframework/bus/runner/adapter/DiscoveryChannelLocator.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2015 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.springframework.bus.runner.adapter;
+
+import java.net.URI;
+import java.util.List;
+import java.util.Random;
+
+import org.springframework.cloud.client.ServiceInstance;
+import org.springframework.cloud.client.discovery.DiscoveryClient;
+import org.springframework.web.client.RestTemplate;
+
+/**
+ * @author Dave Syer
+ *
+ */
+public class DiscoveryChannelLocator implements ChannelLocator {
+
+ private DiscoveryClient discovery;
+
+ private RestTemplate restTemplate = new RestTemplate();
+
+ private String serviceId;
+
+ public DiscoveryChannelLocator(DiscoveryClient discovery, String serviceId) {
+ this.discovery = discovery;
+ this.serviceId = serviceId;
+ }
+
+ @Override
+ public String locate(String name) {
+ List instances = discovery.getInstances(serviceId);
+ if (instances==null || instances.isEmpty()) {
+ return null;
+ }
+ URI uri = pickUrl(instances);
+ try {
+ ChannelsMetadata channels = restTemplate.getForObject(uri, ChannelsMetadata.class);
+ for (OutputChannelSpec spec : channels.getOutputChannels()) {
+ if (name.equals(spec.getLocalName())) {
+ return spec.getName();
+ }
+ }
+ for (InputChannelSpec spec : channels.getInputChannels()) {
+ if (name.equals(spec.getLocalName())) {
+ return spec.getName();
+ }
+ }
+ } catch (Exception e) {
+ return null;
+ }
+ return null;
+ }
+
+ private URI pickUrl(List instances) {
+ return instances.get(new Random().nextInt(instances.size())).getUri();
+ }
+
+}
diff --git a/spring-bus-core/src/main/java/org/springframework/bus/runner/adapter/InputChannelSpec.java b/spring-bus-core/src/main/java/org/springframework/bus/runner/adapter/InputChannelSpec.java
index 949a77129..6e164b498 100644
--- a/spring-bus-core/src/main/java/org/springframework/bus/runner/adapter/InputChannelSpec.java
+++ b/spring-bus-core/src/main/java/org/springframework/bus/runner/adapter/InputChannelSpec.java
@@ -16,11 +16,6 @@
package org.springframework.bus.runner.adapter;
-import org.springframework.integration.support.context.NamedComponent;
-import org.springframework.messaging.MessageChannel;
-
-import com.fasterxml.jackson.annotation.JsonIgnore;
-
/**
* @author Dave Syer
*
@@ -28,25 +23,22 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
public class InputChannelSpec {
private String name;
- private MessageChannel channel;
+ private String localName;
- public InputChannelSpec(String name, MessageChannel channel) {
- this.name = name;
- this.channel = channel;
+ public InputChannelSpec(String localName) {
+ this.localName = localName;
}
public String getName() {
- return name;
+ return this.name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
}
public String getLocalName() {
- return (channel instanceof NamedComponent) ? ((NamedComponent) channel)
- .getComponentName() : channel.toString();
- }
-
- @JsonIgnore
- public MessageChannel getMessageChannel() {
- return channel;
+ return this.localName;
}
}
diff --git a/spring-bus-core/src/main/java/org/springframework/bus/runner/adapter/MessageBusAdapter.java b/spring-bus-core/src/main/java/org/springframework/bus/runner/adapter/MessageBusAdapter.java
index ab6ec1664..9c0a49262 100644
--- a/spring-bus-core/src/main/java/org/springframework/bus/runner/adapter/MessageBusAdapter.java
+++ b/spring-bus-core/src/main/java/org/springframework/bus/runner/adapter/MessageBusAdapter.java
@@ -19,6 +19,7 @@ package org.springframework.bus.runner.adapter;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
+import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.Map;
@@ -38,11 +39,13 @@ import org.springframework.integration.channel.DirectChannel;
import org.springframework.integration.channel.interceptor.WireTap;
import org.springframework.integration.support.DefaultMessageBuilderFactory;
import org.springframework.integration.support.MessageBuilderFactory;
+import org.springframework.integration.support.channel.BeanFactoryChannelResolver;
import org.springframework.jmx.export.annotation.ManagedAttribute;
import org.springframework.jmx.export.annotation.ManagedOperation;
import org.springframework.jmx.export.annotation.ManagedResource;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageChannel;
+import org.springframework.messaging.core.DestinationResolver;
import org.springframework.messaging.support.ChannelInterceptorAdapter;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
@@ -74,16 +77,38 @@ public class MessageBusAdapter implements Lifecycle, ApplicationContextAware {
private ConfigurableApplicationContext applicationContext;
+ private ChannelLocator inputChannelLocator;
+
+ private ChannelLocator outputChannelLocator;
+
+ private DestinationResolver channelResolver;
+
+ private Map bindings = new HashMap();
+
public MessageBusAdapter(MessageBusProperties module, MessageBus messageBus) {
this.module = module;
this.messageBus = messageBus;
+ this.inputChannelLocator = new DefaultChannelLocator(module);
+ this.outputChannelLocator = new DefaultChannelLocator(module);
+ }
+
+ public void setInputChannelLocator(ChannelLocator channelLocator) {
+ this.inputChannelLocator = channelLocator;
+ }
+
+ public void setOutputChannelLocator(ChannelLocator channelLocator) {
+ this.outputChannelLocator = channelLocator;
}
@Override
public void setApplicationContext(ApplicationContext applicationContext)
throws BeansException {
this.applicationContext = (ConfigurableApplicationContext) applicationContext;
+ this.channelResolver = new BeanFactoryChannelResolver(applicationContext);
+ }
+ public void setChannelResolver(DestinationResolver channelResolver) {
+ this.channelResolver = channelResolver;
}
public void setMessageBuilderFactory(MessageBuilderFactory messageBuilderFactory) {
@@ -94,20 +119,6 @@ public class MessageBusAdapter implements Lifecycle, ApplicationContextAware {
this.trackHistory = trackHistory;
}
- public void setOutputChannel(MessageChannel outputChannel) {
- if (outputChannel != null) {
- String name = module.getOutputChannelName();
- this.outputChannels.add(new OutputChannelSpec(name, outputChannel));
- }
- }
-
- public void setInputChannel(MessageChannel inputChannel) {
- if (inputChannel != null) {
- String name = module.getInputChannelName();
- this.inputChannels.add(new InputChannelSpec(name, inputChannel));
- }
- }
-
public void setOutputChannels(Collection outputChannels) {
this.outputChannels = new LinkedHashSet(outputChannels);
}
@@ -116,20 +127,25 @@ public class MessageBusAdapter implements Lifecycle, ApplicationContextAware {
this.inputChannels = new LinkedHashSet(inputChannels);
}
- public Collection getOutputChannels() {
- return outputChannels;
+ public ChannelsMetadata getChannelsMetadata() {
+ ChannelsMetadata channels = new ChannelsMetadata();
+ channels.setModule(this.module);
+ channels.setInputChannels(new LinkedHashSet(this.inputChannels));
+ channels.setOutputChannels(new LinkedHashSet(
+ this.outputChannels));
+ return channels;
}
public OutputChannelSpec getOutputChannel(String name) {
- if (name==null) {
+ if (name == null) {
return null;
}
- for (OutputChannelSpec spec : outputChannels) {
+ for (OutputChannelSpec spec : this.outputChannels) {
if (name.equals(spec.getName())) {
return spec;
}
}
- for (OutputChannelSpec spec : outputChannels) {
+ for (OutputChannelSpec spec : this.outputChannels) {
if (name.equals(spec.getLocalName())) {
return spec;
}
@@ -138,15 +154,15 @@ public class MessageBusAdapter implements Lifecycle, ApplicationContextAware {
}
public InputChannelSpec getInputChannel(String name) {
- if (name==null) {
+ if (name == null) {
return null;
}
- for (InputChannelSpec spec : inputChannels) {
+ for (InputChannelSpec spec : this.inputChannels) {
if (name.equals(spec.getName())) {
return spec;
}
}
- for (InputChannelSpec spec : inputChannels) {
+ for (InputChannelSpec spec : this.inputChannels) {
if (name.equals(spec.getLocalName())) {
return spec;
}
@@ -154,111 +170,153 @@ public class MessageBusAdapter implements Lifecycle, ApplicationContextAware {
return null;
}
- public Collection getInputChannels() {
- return inputChannels;
- }
-
public void tap(String outputChannel) {
OutputChannelSpec channel = getOutputChannel(outputChannel);
- if (channel==null || channel.isTapped()) {
+ if (channel == null || channel.isTapped()) {
return;
}
- createAndBindTapChannel(channel.getTapChannelName(), channel.getMessageChannel());
+ createAndBindTapChannel(channel.getTapChannelName(), channel.getLocalName());
channel.setTapped(true);
}
public void untap(String outputChannel) {
OutputChannelSpec channel = getOutputChannel(outputChannel);
- if (channel==null || !channel.isTapped()) {
+ if (channel == null || !channel.isTapped()) {
return;
}
String tapChannelName = channel.getTapChannelName();
- messageBus.unbindProducers(tapChannelName);
+ this.messageBus.unbindProducers(tapChannelName);
channel.setTapped(false);
}
@Override
@ManagedOperation
public void start() {
- if (!running) {
+ if (!this.running) {
// Start everything, but don't call ourselves
- if (!active.get()) {
- if (active.compareAndSet(false, true)) {
+ if (!this.active.get()) {
+ if (this.active.compareAndSet(false, true)) {
bindChannels();
- applicationContext.start();
- active.set(false);
+ this.applicationContext.start();
+ this.active.set(false);
}
}
}
- running = true;
+ this.running = true;
}
@Override
@ManagedOperation
public void stop() {
- if (running) {
- if (!active.get()) {
- if (active.compareAndSet(false, true)) {
+ if (this.running) {
+ if (!this.active.get()) {
+ if (this.active.compareAndSet(false, true)) {
unbindChannels();
- applicationContext.stop();
- active.set(false);
+ this.applicationContext.stop();
+ this.active.set(false);
}
}
}
- running = false;
+ this.running = false;
}
@Override
@ManagedAttribute
public boolean isRunning() {
- return running && applicationContext.isRunning();
+ return this.running && this.applicationContext.isRunning();
}
protected final void unbindChannels() {
- for (InputChannelSpec spec : inputChannels) {
- messageBus.unbindConsumers(spec.getName());
+ for (InputChannelSpec spec : this.inputChannels) {
+ String name = this.bindings.get(spec.getName());
+ if (name == null) {
+ continue;
+ }
+ this.messageBus.unbindConsumers(name);
}
- for (OutputChannelSpec spec : outputChannels) {
- messageBus.unbindProducers(spec.getName());
+ for (OutputChannelSpec spec : this.outputChannels) {
+ String name = this.bindings.get(spec.getName());
+ if (name == null) {
+ continue;
+ }
+ this.messageBus.unbindProducers(name);
if (spec.isTapped()) {
String tapChannelName = spec.getTapChannelName();
- messageBus.unbindProducers(tapChannelName);
+ this.messageBus.unbindProducers(tapChannelName);
}
}
}
protected final void bindChannels() {
Map historyProperties = new LinkedHashMap();
- if (trackHistory) {
+ if (this.trackHistory) {
// TODO: addHistoryTag();
}
- for (OutputChannelSpec spec : outputChannels) {
- String name = spec.getName();
- MessageChannel outputChannel = spec.getMessageChannel();
- bindMessageProducer(outputChannel, name, module.getProducerProperties());
+ for (OutputChannelSpec spec : this.outputChannels) {
+ String name = this.outputChannelLocator.locate(spec.getLocalName());
+ if (name == null) {
+ logger.info("No channel found for: " + spec.getLocalName());
+ continue;
+ }
+ spec.setName(name);
+ this.bindings.put(spec.getName(), name);
+ MessageChannel outputChannel = this.channelResolver.resolveDestination(spec
+ .getLocalName());
+ bindMessageProducer(outputChannel, name, this.module.getProducerProperties());
if (spec.isTapped()) {
- String tapChannelName = spec.getTapChannelName();
+ String tapChannelName = getTapChannelName(name);
+ spec.setTapChannelName(tapChannelName);
// tappableChannels.put(tapChannelName, outputChannel);
// if (isTapActive(tapChannelName)) {
- createAndBindTapChannel(tapChannelName, outputChannel);
+ createAndBindTapChannel(tapChannelName, name);
// }
}
- if (trackHistory) {
+ if (this.trackHistory) {
historyProperties.put("outputChannel", name);
track(outputChannel, historyProperties);
}
}
- for (InputChannelSpec spec : inputChannels) {
- String name = spec.getName();
- MessageChannel inputChannel = spec.getMessageChannel();
- bindMessageConsumer(inputChannel, name, module.getConsumerProperties());
- if (trackHistory && outputChannels.size() != 1) {
+ for (InputChannelSpec spec : this.inputChannels) {
+ String name = this.inputChannelLocator.locate(spec.getLocalName());
+ if (name == null) {
+ logger.info("No channel found for: " + spec.getLocalName());
+ continue;
+ }
+ spec.setName(name);
+ this.bindings.put(spec.getName(), name);
+ MessageChannel inputChannel = this.channelResolver.resolveDestination(spec.getLocalName());
+ bindMessageConsumer(inputChannel, name, this.module.getConsumerProperties());
+ if (this.trackHistory && this.outputChannels.size() != 1) {
historyProperties.put("inputChannel", name);
track(inputChannel, historyProperties);
}
}
}
+ // TODO: move this to ChannelLocator?
+ private String getTapChannelName(String name) {
+ return !isDefaultOuputChannel(name) ? this.module
+ .getTapChannelName(getPlainChannelName(name)) : this.module
+ .getTapChannelName();
+ }
+
+ // TODO: move this to ChannelLocator?
+ private String getPlainChannelName(String name) {
+ if (name.contains(":")) {
+ name = name.substring(name.indexOf(":") + 1);
+ }
+ return name;
+ }
+
+ // TODO: move this to ChannelLocator?
+ private boolean isDefaultOuputChannel(String channelName) {
+ if (channelName.contains(":")) {
+ String[] tokens = channelName.split(":", 2);
+ channelName = tokens[1];
+ }
+ return channelName.equals(this.module.getOutputChannelName());
+ }
+
/*
* Following methods copied from parent to support the bindChannels() method above
*/
@@ -266,22 +324,24 @@ public class MessageBusAdapter implements Lifecycle, ApplicationContextAware {
private void bindMessageConsumer(MessageChannel inputChannel,
String inputChannelName, Properties consumerProperties) {
if (isChannelPubSub(inputChannelName)) {
- messageBus.bindPubSubConsumer(inputChannelName, inputChannel,
+ this.messageBus.bindPubSubConsumer(inputChannelName, inputChannel,
consumerProperties);
}
else {
- messageBus.bindConsumer(inputChannelName, inputChannel, consumerProperties);
+ this.messageBus.bindConsumer(inputChannelName, inputChannel,
+ consumerProperties);
}
}
private void bindMessageProducer(MessageChannel outputChannel,
String outputChannelName, Properties producerProperties) {
if (isChannelPubSub(outputChannelName)) {
- messageBus.bindPubSubProducer(outputChannelName, outputChannel,
+ this.messageBus.bindPubSubProducer(outputChannelName, outputChannel,
producerProperties);
}
else {
- messageBus.bindProducer(outputChannelName, outputChannel, producerProperties);
+ this.messageBus.bindProducer(outputChannelName, outputChannel,
+ producerProperties);
}
}
@@ -296,18 +356,19 @@ public class MessageBusAdapter implements Lifecycle, ApplicationContextAware {
* {@link MessageBus}'s message target.
*
* @param tapChannelName the name of the tap channel
- * @param outputChannel the channel to tap
+ * @param localName the channel to tap
*/
- private void createAndBindTapChannel(String tapChannelName,
- MessageChannel outputChannel) {
+ private void createAndBindTapChannel(String tapChannelName, String localName) {
logger.info("creating and binding tap channel for {}", tapChannelName);
- if (outputChannel instanceof ChannelInterceptorAware) {
+ MessageChannel channel = this.channelResolver.resolveDestination(localName);
+ if (channel instanceof ChannelInterceptorAware) {
DirectChannel tapChannel = new DirectChannel();
tapChannel.setBeanName(tapChannelName + ".tap.bridge");
- messageBus.bindPubSubProducer(tapChannelName, tapChannel, null); // TODO tap
- // producer
- // props
- tapOutputChannel(tapChannel, (ChannelInterceptorAware) outputChannel);
+ this.messageBus.bindPubSubProducer(tapChannelName, tapChannel, null); // TODO
+ // tap
+ // producer
+ // props
+ tapOutputChannel(tapChannel, (ChannelInterceptorAware) channel);
}
else {
if (logger.isDebugEnabled()) {
@@ -325,29 +386,30 @@ public class MessageBusAdapter implements Lifecycle, ApplicationContextAware {
private void track(MessageChannel channel, final Map historyProps) {
if (channel instanceof ChannelInterceptorAware) {
((ChannelInterceptorAware) channel)
- .addInterceptor(new ChannelInterceptorAdapter() {
+ .addInterceptor(new ChannelInterceptorAdapter() {
- @Override
- public Message> preSend(Message> message,
- MessageChannel channel) {
- @SuppressWarnings("unchecked")
- Collection