Fix ElasticsearchSink index name header (#446)

- Use `Consumer<Message<?>>` on IntegrationFlow
  rather than `Consumer`

Fixes #440
This commit is contained in:
Chris Bono
2023-04-11 15:50:59 -05:00
committed by GitHub
parent 9adb9c9256
commit afe608a0fe

View File

@@ -47,7 +47,6 @@ import org.springframework.integration.aggregator.MessageCountReleaseStrategy;
import org.springframework.integration.config.AggregatorFactoryBean;
import org.springframework.integration.dsl.IntegrationFlow;
import org.springframework.integration.dsl.IntegrationFlowBuilder;
import org.springframework.integration.dsl.IntegrationFlows;
import org.springframework.integration.expression.ValueExpression;
import org.springframework.integration.store.MessageGroup;
import org.springframework.integration.store.MessageGroupStore;
@@ -126,7 +125,7 @@ public class ElasticsearchConsumerConfiguration {
) {
final IntegrationFlowBuilder builder =
IntegrationFlows.from(Consumer.class, gateway -> gateway.beanName("elasticsearchConsumer"));
IntegrationFlow.from(MessageConsumer.class, gateway -> gateway.beanName("elasticsearchConsumer"));
if (properties.getBatchSize() > 1) {
builder.handle(aggregator);
}
@@ -297,4 +296,9 @@ public class ElasticsearchConsumerConfiguration {
return message;
}
}
private interface MessageConsumer extends Consumer<Message<?>> {
}
}