findDelegate(Class> type) {
- if (delegates == null) {
- return null;
- }
-
- Class> clazz = ClassUtils.findClosestMatch(type, delegates.keySet(), false);
- return delegates.get(clazz);
- }
-}
diff --git a/spring-cloud-stream-codec/src/main/java/org/springframework/xd/dirt/integration/bus/serializer/MultiTypeCodec.java b/spring-cloud-stream-codec/src/main/java/org/springframework/xd/dirt/integration/bus/serializer/MultiTypeCodec.java
deleted file mode 100644
index a4d8028e2..000000000
--- a/spring-cloud-stream-codec/src/main/java/org/springframework/xd/dirt/integration/bus/serializer/MultiTypeCodec.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright 2013 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.xd.dirt.integration.bus.serializer;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.springframework.core.serializer.Serializer;
-
-
-/**
- * Interface for classes that perform both serialization and deserialization.
- * @author David Turanski
- */
-public interface MultiTypeCodec extends Serializer {
-
- /**
- * Deserialize an object of a given type
- * @param inputStream the input stream containing the serialized object
- * @param type the object's class
- * @return the object
- * @throws IOException
- */
- public abstract T deserialize(InputStream inputStream, Class extends T> type) throws IOException;
-
- /**
- * Deserialize an object of a given type
- * @param bytes the byte array containing the serialized object
- * @param type the object's class
- * @return the object
- * @throws IOException
- */
- public abstract T deserialize(byte[] bytes, Class extends T> type) throws IOException;
-}
diff --git a/spring-cloud-stream-codec/src/main/java/org/springframework/xd/dirt/integration/bus/serializer/kryo/AbstractKryoCodec.java b/spring-cloud-stream-codec/src/main/java/org/springframework/xd/dirt/integration/bus/serializer/kryo/AbstractKryoCodec.java
deleted file mode 100644
index a967f22b6..000000000
--- a/spring-cloud-stream-codec/src/main/java/org/springframework/xd/dirt/integration/bus/serializer/kryo/AbstractKryoCodec.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright 2013 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.xd.dirt.integration.bus.serializer.kryo;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-
-import com.esotericsoftware.kryo.Kryo;
-import com.esotericsoftware.kryo.io.Input;
-import com.esotericsoftware.kryo.io.Output;
-import com.esotericsoftware.kryo.pool.KryoCallback;
-import com.esotericsoftware.kryo.pool.KryoFactory;
-import com.esotericsoftware.kryo.pool.KryoPool;
-
-import org.springframework.util.Assert;
-import org.springframework.xd.dirt.integration.bus.serializer.MultiTypeCodec;
-
-/**
- * Base class for Codecs using {@link com.esotericsoftware.kryo.Kryo}
- * @author David Turanski
- */
-public abstract class AbstractKryoCodec implements MultiTypeCodec {
-
- protected final KryoPool pool;
-
- protected AbstractKryoCodec() {
- KryoFactory factory = new KryoFactory() {
- public Kryo create() {
- Kryo kryo = new Kryo();
- // configure kryo instance, customize settings
- configureKryoInstance(kryo);
- return kryo;
- }
- };
- // Build pool with SoftReferences enabled (optional)
- pool = new KryoPool.Builder(factory).softReferences().build();
- }
-
- /**
- * Serialize an object using an existing output stream
- * @param object the object to be serialized
- * @param outputStream the output stream, e.g. a FileOutputStream
- * @throws IOException
- */
-
- public void serialize(final Object object, OutputStream outputStream) throws IOException {
- Assert.notNull(outputStream, "\'outputSteam\' cannot be null");
- final Output output = (outputStream instanceof Output ? (Output) outputStream : new Output(outputStream));
- this.pool.run(new KryoCallback() {
- @SuppressWarnings("unchecked")
- public Object execute(Kryo kryo) {
- doSerialize(kryo, object, output);
- return Void.class;
- }
- });
- output.close();
- }
-
- protected abstract void doSerialize(Kryo kryo, Object object, Output output);
-
- protected abstract Object doDeserialize(Kryo kryo, Input input, Class> type);
-
- protected abstract void configureKryoInstance(Kryo kryo);
-
- /**
- * Deserialize an object of a given type given a byte array
- * @param bytes the byte array containing the serialized object
- * @param type the object's class
- * @return the object
- * @throws IOException
- */
- @Override
- public Object deserialize(byte[] bytes, Class> type) throws IOException {
- final Input input = new Input(bytes);
- try {
- return deserialize(input, type);
- }
- finally {
- input.close();
- }
- }
-
- @Override
- public Object deserialize(InputStream inputStream, final Class> type) throws IOException {
- Assert.notNull(inputStream, "\'inputStream\' cannot be null");
- final Input input = (inputStream instanceof Input ? (Input) inputStream : new Input(inputStream));
- Object result = null;
- try {
- result = this.pool.run(new KryoCallback() {
- @SuppressWarnings("unchecked")
- public Object execute(Kryo kryo) {
- return doDeserialize(kryo, input, type);
- }
- });
- }
- finally {
- input.close();
- }
- return result;
- }
-
-}
diff --git a/spring-cloud-stream-codec/src/main/java/org/springframework/xd/dirt/integration/bus/serializer/kryo/AbstractKryoRegistrar.java b/spring-cloud-stream-codec/src/main/java/org/springframework/xd/dirt/integration/bus/serializer/kryo/AbstractKryoRegistrar.java
deleted file mode 100644
index 1436a0bd5..000000000
--- a/spring-cloud-stream-codec/src/main/java/org/springframework/xd/dirt/integration/bus/serializer/kryo/AbstractKryoRegistrar.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * 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.xd.dirt.integration.bus.serializer.kryo;
-
-import java.util.List;
-
-import com.esotericsoftware.kryo.Kryo;
-import com.esotericsoftware.kryo.Registration;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.springframework.core.serializer.support.SerializationFailedException;
-
-/**
- * @author David Turanski
- */
-public abstract class AbstractKryoRegistrar implements KryoRegistrar {
- protected final Logger log = LoggerFactory.getLogger(this.getClass());
-
- protected final static Kryo kryo = new Kryo();
-
- @Override
- public void registerTypes(Kryo kryo) {
- for (Registration registration : getRegistrations()) {
- register(kryo, registration);
- }
- }
-
- public abstract List getRegistrations();
-
- protected void register(Kryo kryo, Registration registration) {
- int id = registration.getId();
-
- Registration existing = kryo.getRegistration(id);
-
- if (existing != null) {
- throw new SerializationFailedException(String.format("registration already exists %s", existing));
- }
-
- log.info("registering {} with serializer {}", registration, registration.getSerializer().getClass()
- .getName());
-
- kryo.register(registration);
- }
-}
diff --git a/spring-cloud-stream-codec/src/main/java/org/springframework/xd/dirt/integration/bus/serializer/kryo/CompositeKryoRegistrar.java b/spring-cloud-stream-codec/src/main/java/org/springframework/xd/dirt/integration/bus/serializer/kryo/CompositeKryoRegistrar.java
deleted file mode 100644
index e7d1d5d18..000000000
--- a/spring-cloud-stream-codec/src/main/java/org/springframework/xd/dirt/integration/bus/serializer/kryo/CompositeKryoRegistrar.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * 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.xd.dirt.integration.bus.serializer.kryo;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import com.esotericsoftware.kryo.Registration;
-
-import org.springframework.core.serializer.support.SerializationFailedException;
-import org.springframework.util.Assert;
-import org.springframework.util.CollectionUtils;
-
-/**
- * A {@link KryoRegistrar} that delegates and validates
- * registrations across all components.
- * @author David Turanski
- * @since 1.2
- */
-public class CompositeKryoRegistrar extends AbstractKryoRegistrar {
-
- private final List delegates;
-
- public CompositeKryoRegistrar(List delegates) {
- super();
- this.delegates = delegates;
-
- if (!CollectionUtils.isEmpty(this.delegates)) {
- validateRegistrations();
- }
- }
-
- @Override
- public List getRegistrations() {
- List registrations = new ArrayList<>();
- for (KryoRegistrar registrar : delegates) {
- registrations.addAll(registrar.getRegistrations());
- }
- return registrations;
- }
-
- private void validateRegistrations() {
- List ids = new ArrayList<>();
- List> types = new ArrayList<>();
-
- for (Registration registration : getRegistrations()) {
- Assert.isTrue(registration.getId() >= MIN_REGISTRATION_VALUE, "registration ID must be >= " +
- MIN_REGISTRATION_VALUE);
- if (ids.contains(registration.getId())) {
- throw new SerializationFailedException(String.format("Duplicate registration ID found: %d",
- registration.getId()));
- }
- ids.add(registration.getId());
-
- if (types.contains(registration.getType())) {
- throw new SerializationFailedException(String.format("Duplicate registration found for type: %s",
- registration.getType()));
- }
- types.add(registration.getType());
-
- log.info("configured Kryo registration {} with serializer {}", registration,
- registration.getSerializer().getClass().getName());
-
- }
-
- }
-}
diff --git a/spring-cloud-stream-codec/src/main/java/org/springframework/xd/dirt/integration/bus/serializer/kryo/FileKryoRegistrar.java b/spring-cloud-stream-codec/src/main/java/org/springframework/xd/dirt/integration/bus/serializer/kryo/FileKryoRegistrar.java
deleted file mode 100644
index 1f483540b..000000000
--- a/spring-cloud-stream-codec/src/main/java/org/springframework/xd/dirt/integration/bus/serializer/kryo/FileKryoRegistrar.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * 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.xd.dirt.integration.bus.serializer.kryo;
-
-import java.util.Collections;
-import java.util.List;
-
-import com.esotericsoftware.kryo.Registration;
-
-/**
- * A {@link KryoRegistrar} used to register a File serializer.
- * @author David Turanski
- * @since 1.2
- */
-public class FileKryoRegistrar extends AbstractKryoRegistrar {
-
- private final static int FILE_REGISTRATION_ID = 40;
-
- private final FileSerializer fileSerializer = new FileSerializer();
-
- @Override
- public List getRegistrations() {
- return Collections.singletonList(new Registration(java.io.File.class, fileSerializer, FILE_REGISTRATION_ID));
- }
-}
diff --git a/spring-cloud-stream-codec/src/main/java/org/springframework/xd/dirt/integration/bus/serializer/kryo/FileSerializer.java b/spring-cloud-stream-codec/src/main/java/org/springframework/xd/dirt/integration/bus/serializer/kryo/FileSerializer.java
deleted file mode 100644
index 607af6444..000000000
--- a/spring-cloud-stream-codec/src/main/java/org/springframework/xd/dirt/integration/bus/serializer/kryo/FileSerializer.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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.xd.dirt.integration.bus.serializer.kryo;
-
-import java.io.File;
-
-import com.esotericsoftware.kryo.Kryo;
-import com.esotericsoftware.kryo.Serializer;
-import com.esotericsoftware.kryo.io.Input;
-import com.esotericsoftware.kryo.io.Output;
-
-/**
- * @author David Turanski
- * @since 1.2
- */
-public class FileSerializer extends Serializer {
-
- @Override
- public void write(Kryo kryo, Output output, File file) {
- output.writeString(file.getPath());
- }
-
- @Override
- public File read(Kryo kryo, Input input, Class type) {
- String path = input.readString();
- return new File(path);
- }
-}
diff --git a/spring-cloud-stream-codec/src/main/java/org/springframework/xd/dirt/integration/bus/serializer/kryo/KryoClassListRegistrar.java b/spring-cloud-stream-codec/src/main/java/org/springframework/xd/dirt/integration/bus/serializer/kryo/KryoClassListRegistrar.java
deleted file mode 100644
index a90ddd1c6..000000000
--- a/spring-cloud-stream-codec/src/main/java/org/springframework/xd/dirt/integration/bus/serializer/kryo/KryoClassListRegistrar.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * 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.xd.dirt.integration.bus.serializer.kryo;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import com.esotericsoftware.kryo.Registration;
-
-
-import org.springframework.util.Assert;
-import org.springframework.util.CollectionUtils;
-
-/**
- * A {@link KryoRegistrar} used to register a
- * list of Java classes. This assigns a sequential registration ID starting with an initial value (50 by default), but
- * may be configured. This is easiest to set up but requires that every server node be configured with the identical
- * list in the same order.
- * @author David Turanski
- * @since 1.1
- */
-public class KryoClassListRegistrar extends AbstractKryoRegistrar {
-
- private final List registeredClasses;
-
- private int initialValue = 50;
-
- /**
- * @param classes the list of classes to register
- */
- public KryoClassListRegistrar(List classes) {
- this.registeredClasses = classes;
- }
-
- /**
- * Set the inital ID value. Classes in the list will be sequentially assigned an ID starting with this value
- * (default is 50).
- * @param initialValue the initial value
- */
- public void setInitialValue(int initialValue) {
- Assert.isTrue(initialValue >= MIN_REGISTRATION_VALUE, "'initialValue' must be >= " +
- MIN_REGISTRATION_VALUE);
- this.initialValue = initialValue;
- }
-
-
- @Override
- public List getRegistrations() {
- List registrations = new ArrayList<>();
- if (!CollectionUtils.isEmpty(registeredClasses)) {
- for (int i = 0; i < registeredClasses.size(); i++) {
- registrations.add(new Registration(registeredClasses.get(i), kryo.getSerializer(registeredClasses.get
- (i)), i + initialValue));
- }
- }
- return registrations;
- }
-
-}
diff --git a/spring-cloud-stream-codec/src/main/java/org/springframework/xd/dirt/integration/bus/serializer/kryo/KryoClassMapRegistrar.java b/spring-cloud-stream-codec/src/main/java/org/springframework/xd/dirt/integration/bus/serializer/kryo/KryoClassMapRegistrar.java
deleted file mode 100644
index a26e24e64..000000000
--- a/spring-cloud-stream-codec/src/main/java/org/springframework/xd/dirt/integration/bus/serializer/kryo/KryoClassMapRegistrar.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright 2014 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.xd.dirt.integration.bus.serializer.kryo;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import com.esotericsoftware.kryo.Registration;
-
-import org.springframework.util.CollectionUtils;
-
-
-/**
- * A {@link KryoRegistrar} implementation backed by a Map
- * used to explicitly set the registration ID for each class.
- * @author David Turanski
- * @since 1.1
- */
-public class KryoClassMapRegistrar extends AbstractKryoRegistrar {
-
- final private Map> registeredClasses;
-
- public KryoClassMapRegistrar(Map> kryoRegisteredClasses) {
- this.registeredClasses = kryoRegisteredClasses;
- }
-
-
- @Override
- public List getRegistrations() {
- List registrations = new ArrayList<>();
- if (!CollectionUtils.isEmpty(registeredClasses)) {
- for (Map.Entry> entry : registeredClasses.entrySet()) {
- registrations.add(new Registration(entry.getValue(), kryo.getSerializer(entry.getValue()), entry.getKey()));
- }
- }
- return registrations;
- }
-}
diff --git a/spring-cloud-stream-codec/src/main/java/org/springframework/xd/dirt/integration/bus/serializer/kryo/KryoRegistrar.java b/spring-cloud-stream-codec/src/main/java/org/springframework/xd/dirt/integration/bus/serializer/kryo/KryoRegistrar.java
deleted file mode 100644
index 15af67a48..000000000
--- a/spring-cloud-stream-codec/src/main/java/org/springframework/xd/dirt/integration/bus/serializer/kryo/KryoRegistrar.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * 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.xd.dirt.integration.bus.serializer.kryo;
-
-import java.util.List;
-
-import com.esotericsoftware.kryo.Kryo;
-import com.esotericsoftware.kryo.Registration;
-
-/**
- * Strategy interface used by {@link PojoCodec} to register
- * classes consistently across {@link Kryo} instances. An XD user may register an instance of this type in the Spring XD
- * Application Context to enable kryo class registration which results in efficiency gains if you know the types your
- * application needs in advance. Note that Kryo serialization only applies to types used as message payloads in XD
- * streams.
- * By default, user defined types are not registered to Kryo. Registration allows a unique ID (small positive integer is
- * ideal) to represent the type in the byte stream. In a distributed environment, all Kryo instances must maintain the
- * same registration state in order to properly take advantage of this feature.
- * This is can result in better performance in demanding situations, but requires some care to maintain. Only use this
- * if you really need it. Otherwise, it is a great example of premature optimization.
- * This interface applies a strategy to register a statically configured, one-to-one mapping of a Java type to an
- * integer. Basic implementations are provided backed by a Map> or a List>. These are simple
- * and require the user to manually configure a bean in each XD server and ensure that the configuration is always
- * consistent.*
- * The container looks in classpath*:META-INF/spring-xd/xd/bus/ext/*.xml for an instance of this type named
- * "kryoRegistrar". The KryoRegistrar provides the registration mapping and the strategy to apply the mapping to every
- * Kryo instance. Note that statically declared Java types must also be present in the XD class path (xd/lib) else the
- * container will fail to initialize. Only one instance may be registered and identically configured across all
- * containers.
- *
- * @author David Turanski
- * @since 1.1
- */
-public interface KryoRegistrar {
-
- static final int MIN_REGISTRATION_VALUE = 10;
-
- /**
- * This method is invoked by the {@link PojoCodec} and
- * applied to the {@link Kryo} instance whenever one is provided. This is currently done using an object pool so it
- * is inevitable that this method will be invoked repeatedly on the same instance. Kryo registration is idempotent,
- * but this could become inefficient if registering a large amount of types.
- *
- * @param kryo the provided instance
- */
- void registerTypes(Kryo kryo);
-
- /**
- *
- * @return the list of {@link com.esotericsoftware.kryo.Registration} provided
- */
- List getRegistrations();
-}
diff --git a/spring-cloud-stream-codec/src/main/java/org/springframework/xd/dirt/integration/bus/serializer/kryo/KryoRegistrationRegistrar.java b/spring-cloud-stream-codec/src/main/java/org/springframework/xd/dirt/integration/bus/serializer/kryo/KryoRegistrationRegistrar.java
deleted file mode 100644
index 9e69f3e3c..000000000
--- a/spring-cloud-stream-codec/src/main/java/org/springframework/xd/dirt/integration/bus/serializer/kryo/KryoRegistrationRegistrar.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * 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.xd.dirt.integration.bus.serializer.kryo;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import com.esotericsoftware.kryo.Registration;
-
-/**
- * A {@link KryoRegistrar } implementation backed by a List of {@link com.esotericsoftware.kryo.Registration}.
- * @author David Turanski
- * @since 1.2
- */
-public class KryoRegistrationRegistrar extends AbstractKryoRegistrar {
- private final List registrations;
-
- public KryoRegistrationRegistrar(List registrations) {
- this.registrations = registrations != null ? registrations : new ArrayList();
- }
-
- @Override
- public List getRegistrations() {
- return registrations;
- }
-}
diff --git a/spring-cloud-stream-codec/src/main/java/org/springframework/xd/dirt/integration/bus/serializer/kryo/PojoCodec.java b/spring-cloud-stream-codec/src/main/java/org/springframework/xd/dirt/integration/bus/serializer/kryo/PojoCodec.java
deleted file mode 100644
index a532ba8e3..000000000
--- a/spring-cloud-stream-codec/src/main/java/org/springframework/xd/dirt/integration/bus/serializer/kryo/PojoCodec.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright 2013 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.xd.dirt.integration.bus.serializer.kryo;
-
-
-import java.util.Collections;
-import java.util.List;
-
-import com.esotericsoftware.kryo.Kryo;
-import com.esotericsoftware.kryo.io.Input;
-import com.esotericsoftware.kryo.io.Output;
-
-import org.springframework.util.CollectionUtils;
-
-/**
- * Kryo Codec that can serialize and deserialize arbitrary types. Classes and associated
- * {@link com.esotericsoftware.kryo.Serializer}s may be registered via
- * {@link org.springframework.xd.dirt.integration.bus.serializer.kryo.KryoRegistrar}s.
- * @author David Turanski
- * @since 1.0
- */
-public class PojoCodec extends AbstractKryoCodec {
- private final CompositeKryoRegistrar kryoRegistrar;
-
- private final boolean useReferences;
-
- public PojoCodec() {
- this.kryoRegistrar = null;
- this.useReferences = true;
- }
-
- /**
- * Create an instance with a single KryoRegistrar.
- * @param kryoRegistrar the registrar.
- */
- public PojoCodec(KryoRegistrar kryoRegistrar) {
- this(kryoRegistrar != null ? Collections.singletonList(kryoRegistrar) : null, true);
- }
-
- /**
- * Create an instance with zero to many KryoRegistrars.
- * @param kryoRegistrars a list KryoRegistrars.
- */
- public PojoCodec(List kryoRegistrars) {
- this.kryoRegistrar = CollectionUtils.isEmpty(kryoRegistrars) ? null :
- new CompositeKryoRegistrar(kryoRegistrars);
- this.useReferences = true;
- }
-
- /**
- * Create an instance with a single KryoRegistrar.
- * @param kryoRegistrar the registrar.
- * @param useReferences set to false if references are not required (if the object graph is known to be acyclical).
- * The default is 'true' which is less performant but more flexible.
- */
- public PojoCodec(KryoRegistrar kryoRegistrar, boolean useReferences) {
- this(kryoRegistrar != null ? Collections.singletonList(kryoRegistrar) : null, useReferences);
- }
-
- /**
- * Create an instance with zero to many KryoRegistrars.
- * @param kryoRegistrars a list KryoRegistrars.
- * @param useReferences set to false if references are not required (if the object graph is known to be acyclical).
- * The default is 'true' which is less performant but more flexible.
- */
- public PojoCodec(List kryoRegistrars, boolean useReferences) {
- kryoRegistrar = CollectionUtils.isEmpty(kryoRegistrars) ? null :
- new CompositeKryoRegistrar(kryoRegistrars);
- this.useReferences = useReferences;
- }
-
- @Override
- protected void doSerialize(Kryo kryo, Object object, Output output) {
- kryo.writeObject(output, object);
- }
-
-
- @Override
- protected Object doDeserialize(Kryo kryo, Input input, Class> type) {
- return kryo.readObject(input, type);
- }
-
- @Override
- protected void configureKryoInstance(Kryo kryo) {
- if (kryoRegistrar != null) {
- kryoRegistrar.registerTypes(kryo);
- }
- kryo.setReferences(useReferences);
- }
-}
diff --git a/spring-cloud-stream-codec/src/main/java/org/springframework/xd/dirt/integration/bus/serializer/kryo/package-info.java b/spring-cloud-stream-codec/src/main/java/org/springframework/xd/dirt/integration/bus/serializer/kryo/package-info.java
deleted file mode 100644
index a80e77575..000000000
--- a/spring-cloud-stream-codec/src/main/java/org/springframework/xd/dirt/integration/bus/serializer/kryo/package-info.java
+++ /dev/null
@@ -1,5 +0,0 @@
-/**
- * Contains classes that provide kryo serialization support to/from {@link org.springframework.xd.dirt.integration.bus.MessageBus}.
- */
-
-package org.springframework.xd.dirt.integration.bus.serializer.kryo;
diff --git a/spring-cloud-stream-codec/src/test/java/org/springframework/xd/dirt/integration/bus/serializer/kryo/CompositeCodecTests.java b/spring-cloud-stream-codec/src/test/java/org/springframework/xd/dirt/integration/bus/serializer/kryo/CompositeCodecTests.java
deleted file mode 100644
index 789ad1729..000000000
--- a/spring-cloud-stream-codec/src/test/java/org/springframework/xd/dirt/integration/bus/serializer/kryo/CompositeCodecTests.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright 2013 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.xd.dirt.integration.bus.serializer.kryo;
-
-import static org.junit.Assert.assertEquals;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.junit.Before;
-import org.junit.Test;
-
-import org.springframework.xd.dirt.integration.bus.serializer.AbstractCodec;
-import org.springframework.xd.dirt.integration.bus.serializer.CompositeCodec;
-import org.springframework.xd.dirt.integration.bus.serializer.MultiTypeCodec;
-
-/**
- * @author David Turanski
- */
-public class CompositeCodecTests {
-
- private MultiTypeCodec codec;
-
-
- @SuppressWarnings({ "unchecked", "rawtypes" })
- @Before
- public void setup() {
- Map, AbstractCodec>> codecs = new HashMap<>();
- codec = new CompositeCodec(codecs, new PojoCodec());
- }
-
- @Test
- public void testPojoSerialization() throws IOException {
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- SomeClassWithNoDefaultConstructors foo = new SomeClassWithNoDefaultConstructors("hello", 123);
- codec.serialize(foo, bos);
- SomeClassWithNoDefaultConstructors foo2 = (SomeClassWithNoDefaultConstructors) codec.deserialize(
- bos.toByteArray(),
- SomeClassWithNoDefaultConstructors.class);
- assertEquals(foo, foo2);
- }
-
- static class SomeClassWithNoDefaultConstructors {
-
- private String val1;
-
- private int val2;
-
- public SomeClassWithNoDefaultConstructors(String val1) {
- this.val1 = val1;
- }
-
- public SomeClassWithNoDefaultConstructors(String val1, int val2) {
- this.val1 = val1;
- this.val2 = val2;
- }
-
- @Override
- public boolean equals(Object other) {
- if (!(other instanceof SomeClassWithNoDefaultConstructors)) {
- return false;
- }
- SomeClassWithNoDefaultConstructors that = (SomeClassWithNoDefaultConstructors) other;
- return (this.val1.equals(that.val1) && val2 == that.val2);
- }
-
- @Override
- public int hashCode() {
- int result = this.val1.hashCode();
- result = 31 * result + val2;
- return result;
- }
- }
-}
diff --git a/spring-cloud-stream-codec/src/test/java/org/springframework/xd/dirt/integration/bus/serializer/kryo/KryoCodecTests.java b/spring-cloud-stream-codec/src/test/java/org/springframework/xd/dirt/integration/bus/serializer/kryo/KryoCodecTests.java
deleted file mode 100644
index 94601713d..000000000
--- a/spring-cloud-stream-codec/src/test/java/org/springframework/xd/dirt/integration/bus/serializer/kryo/KryoCodecTests.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * Copyright 2013 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.xd.dirt.integration.bus.serializer.kryo;
-
-import static org.junit.Assert.assertEquals;
-
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.junit.Test;
-
-/**
- * @author David Turanski
- * @since 1.0
- */
-public class KryoCodecTests {
-
- @Test
- public void testStringSerialization() throws IOException {
- String str = "hello";
- PojoCodec serializer = new PojoCodec();
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
-
- serializer.serialize(str, bos);
-
- String s2 = (String)serializer.deserialize(bos.toByteArray(), String.class);
- assertEquals(str, s2);
- }
-
- @Test
- public void testSerializationWithStreams() throws IOException {
- String str = "hello";
- File file = new File("test.ser");
- PojoCodec serializer = new PojoCodec();
- FileOutputStream fos = new FileOutputStream(file);
- serializer.serialize(str, fos);
- fos.close();
-
- FileInputStream fis = new FileInputStream(file);
- String s2 = (String) serializer.deserialize(fis, String.class);
- file.delete();
- assertEquals(str, s2);
- }
-
- @Test
- public void testPojoSerialization() throws IOException {
- PojoCodec serializer = new PojoCodec();
- SomeClassWithNoDefaultConstructors foo = new SomeClassWithNoDefaultConstructors("foo", 123);
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- serializer.serialize(foo, bos);
- Object foo2 = serializer.deserialize(bos.toByteArray(), SomeClassWithNoDefaultConstructors.class);
- assertEquals(foo, foo2);
- }
-
- static class SomeClassWithNoDefaultConstructors {
-
- private String val1;
-
- private int val2;
-
- public SomeClassWithNoDefaultConstructors(String val1, int val2) {
- this.val1 = val1;
- this.val2 = val2;
- }
-
- @Override
- public boolean equals(Object other) {
- if (!(other instanceof SomeClassWithNoDefaultConstructors)) {
- return false;
- }
- SomeClassWithNoDefaultConstructors that = (SomeClassWithNoDefaultConstructors) other;
- return (this.val1.equals(that.val1) && val2 == that.val2);
- }
-
- @Override
- public int hashCode() {
- int result = val1.hashCode();
- result = 31 * result + val2;
- return result;
- }
- }
-
- @Test
- public void testPrimitiveSerialization() throws IOException {
- PojoCodec serializer = new PojoCodec();
-
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- serializer.serialize(true, bos);
- boolean b = (Boolean) serializer.deserialize(bos.toByteArray(), Boolean.class);
- assertEquals(true, b);
- b = (Boolean) serializer.deserialize(bos.toByteArray(), boolean.class);
- assertEquals(true, b);
-
- bos = new ByteArrayOutputStream();
- serializer.serialize(3.14159, bos);
-
- double d = (Double) serializer.deserialize(bos.toByteArray(), double.class);
- assertEquals(3.14159, d, 0.00001);
-
- bos = new ByteArrayOutputStream();
- serializer.serialize(new Double(3.14159), bos);
-
- d = (Double) serializer.deserialize(bos.toByteArray(), Double.class);
- assertEquals(3.14159, d, 0.00001);
-
- }
-
- @Test
- public void testMapSerialization() throws IOException {
- PojoCodec serializer = new PojoCodec();
- Map map = new HashMap();
- map.put("one", 1);
- map.put("two", 2);
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- serializer.serialize(map, bos);
- Map, ?> m2 = (Map, ?>) serializer.deserialize(bos.toByteArray(), HashMap.class);
- assertEquals(2, m2.size());
- assertEquals(1, m2.get("one"));
- assertEquals(2, m2.get("two"));
- }
-
- @Test
- public void testComplexObjectSerialization() throws IOException {
- PojoCodec serializer = new PojoCodec();
- Foo foo = new Foo();
- foo.put("one", 1);
- foo.put("two", 2);
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- serializer.serialize(foo, bos);
-
- Foo foo2 = (Foo) serializer.deserialize(bos.toByteArray(), Foo.class);
- assertEquals(1, foo2.get("one"));
- assertEquals(2, foo2.get("two"));
- }
-
-
-
- static class Foo {
-
- private Map map;
-
- public Foo() {
- map = new HashMap();
- }
-
- public void put(Object key, Object value) {
- map.put(key, value);
- }
-
- public Object get(Object key) {
- return map.get(key);
- }
- }
-}
diff --git a/spring-cloud-stream-codec/src/test/java/org/springframework/xd/dirt/integration/bus/serializer/kryo/KryoFileCodecTests.java b/spring-cloud-stream-codec/src/test/java/org/springframework/xd/dirt/integration/bus/serializer/kryo/KryoFileCodecTests.java
deleted file mode 100644
index 6bd38eb88..000000000
--- a/spring-cloud-stream-codec/src/test/java/org/springframework/xd/dirt/integration/bus/serializer/kryo/KryoFileCodecTests.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright 2013 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.xd.dirt.integration.bus.serializer.kryo;
-
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.IOException;
-
-import org.junit.Test;
-
-import static org.junit.Assert.assertEquals;
-
-
-/**
- * @author David Turanski
- */
-public class KryoFileCodecTests {
-
- @Test
- public void test() throws IOException {
-
- PojoCodec pc = new PojoCodec(new FileKryoRegistrar());
- File file = new File("/foo/bar");
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- pc.serialize(file, bos);
- File file2 = (File) pc.deserialize(bos.toByteArray(), File.class);
- assertEquals(file, file2);
- }
-}
diff --git a/spring-cloud-stream/pom.xml b/spring-cloud-stream/pom.xml
index 5085ff967..6b1fb51eb 100644
--- a/spring-cloud-stream/pom.xml
+++ b/spring-cloud-stream/pom.xml
@@ -43,10 +43,6 @@
org.springframework.cloudspring-cloud-lattice-connector
-
- org.springframework.cloud
- spring-cloud-stream-codec
- org.springframework.cloudspring-cloud-stream-binder-local
diff --git a/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/annotation/EnableModule.java b/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/annotation/EnableModule.java
index b5af638c1..db18b30e1 100644
--- a/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/annotation/EnableModule.java
+++ b/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/annotation/EnableModule.java
@@ -25,7 +25,6 @@ import java.lang.annotation.Target;
import org.springframework.cloud.stream.config.AggregateBuilderConfiguration;
import org.springframework.cloud.stream.config.ChannelBindingAdapterConfiguration;
-import org.springframework.cloud.stream.config.CodecConfiguration;
import org.springframework.cloud.stream.config.ModuleRegistrar;
import org.springframework.cloud.stream.config.ChannelBindingAdapterRunner;
import org.springframework.cloud.stream.config.RabbitServiceConfiguration;
@@ -47,7 +46,7 @@ import org.springframework.integration.annotation.MessageEndpoint;
@Configuration
@MessageEndpoint
@Import({RedisServiceConfiguration.class, RabbitServiceConfiguration.class,
- ChannelBindingAdapterConfiguration.class, CodecConfiguration.class, ChannelBindingAdapterRunner.class,
+ ChannelBindingAdapterConfiguration.class, ChannelBindingAdapterRunner.class,
AggregateBuilderConfiguration.class, ModuleRegistrar.class})
public @interface EnableModule {
diff --git a/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/config/RabbitServiceConfiguration.java b/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/config/RabbitServiceConfiguration.java
index 85024c0d1..315f35ead 100644
--- a/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/config/RabbitServiceConfiguration.java
+++ b/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/config/RabbitServiceConfiguration.java
@@ -21,12 +21,13 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.cloud.Cloud;
import org.springframework.cloud.CloudFactory;
+import org.springframework.cloud.stream.binder.rabbit.RabbitMessageChannelBinder;
+import org.springframework.cloud.stream.binder.rabbit.config.RabbitMessageChannelBinderConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.ImportResource;
+import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.Profile;
import org.springframework.context.annotation.PropertySource;
-import org.springframework.cloud.stream.binder.rabbit.RabbitMessageChannelBinder;
/**
* Bind to services, either locally or in a Lattice environment.
@@ -34,11 +35,12 @@ import org.springframework.cloud.stream.binder.rabbit.RabbitMessageChannelBinder
* @author Mark Fisher
* @author Dave Syer
* @author Glenn Renfro
+ * @author David Turanski
*/
@Configuration
@ConditionalOnClass(RabbitMessageChannelBinder.class)
@ConditionalOnMissingBean(RabbitMessageChannelBinder.class)
-@ImportResource("classpath*:/META-INF/spring-cloud-stream/binder/rabbit-binder.xml")
+@Import(RabbitMessageChannelBinderConfiguration.class)
@PropertySource("classpath:/META-INF/spring-cloud-stream/rabbit-binder.properties")
public class RabbitServiceConfiguration {
@Configuration
@@ -48,6 +50,7 @@ public class RabbitServiceConfiguration {
public Cloud cloud() {
return new CloudFactory().getCloud();
}
+
@Bean
ConnectionFactory rabbitConnectionFactory(Cloud cloud) {
return cloud.getSingletonServiceConnector(ConnectionFactory.class, null);
diff --git a/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/config/RedisServiceConfiguration.java b/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/config/RedisServiceConfiguration.java
index b0f6066eb..174d1db47 100644
--- a/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/config/RedisServiceConfiguration.java
+++ b/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/config/RedisServiceConfiguration.java
@@ -21,8 +21,10 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
import org.springframework.cloud.Cloud;
import org.springframework.cloud.CloudFactory;
import org.springframework.cloud.stream.binder.redis.RedisMessageChannelBinder;
+import org.springframework.cloud.stream.binder.redis.config.RedisMessageChannelBinderConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.ImportResource;
import org.springframework.context.annotation.Profile;
import org.springframework.context.annotation.PropertySource;
@@ -33,12 +35,13 @@ import org.springframework.data.redis.connection.RedisConnectionFactory;
*
* @author Mark Fisher
* @author Dave Syer
+ * @author David Turanski
*/
@Configuration
@ConditionalOnClass(RedisMessageChannelBinder.class)
@ConditionalOnMissingBean(RedisMessageChannelBinder.class)
-@ImportResource({ "classpath*:/META-INF/spring-cloud-stream/binder/redis-binder.xml",
-"classpath*:/META-INF/spring-xd/analytics/redis-analytics.xml" })
+@Import(RedisMessageChannelBinderConfiguration.class)
+@ImportResource("classpath*:/META-INF/spring-xd/analytics/redis-analytics.xml")
@PropertySource("classpath:/META-INF/spring-cloud-stream/redis-binder.properties")
public class RedisServiceConfiguration {
diff --git a/spring-cloud-stream/src/main/resources/META-INF/spring-cloud-stream/rabbit-binder.properties b/spring-cloud-stream/src/main/resources/META-INF/spring-cloud-stream/rabbit-binder.properties
index 18cdb037b..d7f95153d 100644
--- a/spring-cloud-stream/src/main/resources/META-INF/spring-cloud-stream/rabbit-binder.properties
+++ b/spring-cloud-stream/src/main/resources/META-INF/spring-cloud-stream/rabbit-binder.properties
@@ -1,24 +1,23 @@
-#TODO: New naming convention
-xd.messagebus.rabbit.default.ackMode: AUTO
-xd.messagebus.rabbit.default.autoBindDLQ: false
-xd.messagebus.rabbit.default.backOffInitialInterval: 1000
-xd.messagebus.rabbit.default.backOffMaxInterval: 10000
-xd.messagebus.rabbit.default.backOffMultiplier: 2.0
-xd.messagebus.rabbit.default.batchBufferLimit: 10000
-xd.messagebus.rabbit.default.batchingEnabled: false
-xd.messagebus.rabbit.default.batchSize: 100
-xd.messagebus.rabbit.default.batchTimeout: 5000
-xd.messagebus.rabbit.default.compress: false
-xd.messagebus.rabbit.default.concurrency: 1
-xd.messagebus.rabbit.default.deliveryMode: PERSISTENT
-xd.messagebus.rabbit.default.durableSubscription: false
-xd.messagebus.rabbit.default.maxAttempts: 3
-xd.messagebus.rabbit.default.maxConcurrency: 1
-xd.messagebus.rabbit.default.prefix: xdbus.
-xd.messagebus.rabbit.default.prefetch: 1
-xd.messagebus.rabbit.default.replyHeaderPatterns: STANDARD_REPLY_HEADERS,*
-xd.messagebus.rabbit.default.republishToDLQ: false
-xd.messagebus.rabbit.default.requestHeaderPatterns: STANDARD_REQUEST_HEADERS,*
-xd.messagebus.rabbit.default.requeue: true
-xd.messagebus.rabbit.default.transacted:false
-xd.messagebus.rabbit.default.txSize: 1
+spring.cloud.stream.binder.rabbit.default.acknowledgeMode: AUTO
+spring.cloud.stream.binder.rabbit.default.autoBindDLQ: false
+spring.cloud.stream.binder.rabbit.default.backOffInitialInterval: 1000
+spring.cloud.stream.binder.rabbit.default.backOffMaxInterval: 10000
+spring.cloud.stream.binder.rabbit.default.backOffMultiplier: 2.0
+spring.cloud.stream.binder.rabbit.default.batchBufferLimit: 10000
+spring.cloud.stream.binder.rabbit.default.batchingEnabled: false
+spring.cloud.stream.binder.rabbit.default.batchSize: 100
+spring.cloud.stream.binder.rabbit.default.batchTimeout: 5000
+spring.cloud.stream.binder.rabbit.default.compress: false
+spring.cloud.stream.binder.rabbit.default.concurrency: 1
+spring.cloud.stream.binder.rabbit.default.deliveryMode: PERSISTENT
+spring.cloud.stream.binder.rabbit.default.durableSubscription: false
+spring.cloud.stream.binder.rabbit.default.maxAttempts: 3
+spring.cloud.stream.binder.rabbit.default.maxConcurrency: 1
+spring.cloud.stream.binder.rabbit.default.prefix: xdbus.
+spring.cloud.stream.binder.rabbit.default.prefetch: 1
+spring.cloud.stream.binder.rabbit.default.replyHeaderPatterns: STANDARD_REPLY_HEADERS,*
+spring.cloud.stream.binder.rabbit.default.republishToDLQ: false
+spring.cloud.stream.binder.rabbit.default.requestHeaderPatterns: STANDARD_REQUEST_HEADERS,*
+spring.cloud.stream.binder.rabbit.default.requeue: true
+spring.cloud.stream.binder.rabbit.default.transacted:false
+spring.cloud.stream.binder.rabbit.default.txSize: 1
diff --git a/spring-cloud-stream/src/main/resources/META-INF/spring-cloud-stream/redis-binder.properties b/spring-cloud-stream/src/main/resources/META-INF/spring-cloud-stream/redis-binder.properties
index 578bb5712..dd78f8e81 100644
--- a/spring-cloud-stream/src/main/resources/META-INF/spring-cloud-stream/redis-binder.properties
+++ b/spring-cloud-stream/src/main/resources/META-INF/spring-cloud-stream/redis-binder.properties
@@ -1,6 +1,5 @@
-#TODO: New naming convention
-xd.messagebus.redis.default.backOffInitialInterval: 1000
-xd.messagebus.redis.default.backOffMaxInterval: 10000
-xd.messagebus.redis.default.backOffMultiplier: 2.0
-xd.messagebus.redis.default.concurrency: 1
-xd.messagebus.redis.default.maxAttempts: 3
+spring.cloud.stream.binder.redis.default.backOffInitialInterval: 1000
+spring.cloud.stream.binder.redis.default.backOffMaxInterval: 10000
+spring.cloud.stream.binder.redis.default.backOffMultiplier: 2.0
+spring.cloud.stream.binder.redis.default.concurrency: 1
+spring.cloud.stream.binder.redis.default.maxAttempts: 3