Resolve new tangles

- `MessagePublishingErrorHandler <-> IntegrationContextUtils`
This commit is contained in:
Gary Russell
2019-04-10 12:16:47 -04:00
committed by Artem Bilan
parent 6c3ffcb1d5
commit a40f20f40d
17 changed files with 146 additions and 71 deletions

View File

@@ -33,7 +33,7 @@ import org.springframework.data.redis.serializer.RedisSerializer;
import org.springframework.data.redis.serializer.StringRedisSerializer;
import org.springframework.integration.MessageDispatchingException;
import org.springframework.integration.channel.AbstractMessageChannel;
import org.springframework.integration.context.IntegrationContextUtils;
import org.springframework.integration.channel.ChannelUtils;
import org.springframework.integration.context.IntegrationProperties;
import org.springframework.integration.dispatcher.BroadcastingDispatcher;
import org.springframework.integration.support.converter.SimpleMessageConverter;
@@ -149,7 +149,7 @@ public class SubscribableRedisChannel extends AbstractMessageChannel
}
this.container.setConnectionFactory(this.connectionFactory);
if (!(this.taskExecutor instanceof ErrorHandlingTaskExecutor)) {
ErrorHandler errorHandler = IntegrationContextUtils.getErrorHandler(beanFactory);
ErrorHandler errorHandler = ChannelUtils.getErrorHandler(beanFactory);
this.taskExecutor = new ErrorHandlingTaskExecutor(this.taskExecutor, errorHandler);
}
this.container.setTaskExecutor(this.taskExecutor);

View File

@@ -31,9 +31,9 @@ import org.springframework.data.redis.serializer.JdkSerializationRedisSerializer
import org.springframework.data.redis.serializer.RedisSerializer;
import org.springframework.data.redis.serializer.StringRedisSerializer;
import org.springframework.integration.channel.MessagePublishingErrorHandler;
import org.springframework.integration.context.IntegrationContextUtils;
import org.springframework.integration.endpoint.MessageProducerSupport;
import org.springframework.integration.redis.event.RedisExceptionEvent;
import org.springframework.integration.support.channel.ChannelResolverUtils;
import org.springframework.integration.support.management.IntegrationManagedResource;
import org.springframework.integration.util.ErrorHandlingTaskExecutor;
import org.springframework.jmx.export.annotation.ManagedMetric;
@@ -177,7 +177,7 @@ public class RedisQueueMessageDrivenEndpoint extends MessageProducerSupport impl
BeanFactory beanFactory = getBeanFactory();
if (!(this.taskExecutor instanceof ErrorHandlingTaskExecutor) && beanFactory != null) {
MessagePublishingErrorHandler errorHandler =
new MessagePublishingErrorHandler(IntegrationContextUtils.getChannelResolver(beanFactory));
new MessagePublishingErrorHandler(ChannelResolverUtils.getChannelResolver(beanFactory));
errorHandler.setDefaultErrorChannel(this.errorChannel);
this.taskExecutor = new ErrorHandlingTaskExecutor(this.taskExecutor, errorHandler);
}