mirror of
https://github.com/OtusTeam/Spring.git
synced 2026-05-30 10:50:42 +00:00
2023-03 spring-30-endpoints-flow-components updated
This commit is contained in:
+7
-12
@@ -2,13 +2,8 @@ package ru.otus.spring.integration.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.integration.channel.PublishSubscribeChannel;
|
||||
import org.springframework.integration.channel.QueueChannel;
|
||||
import org.springframework.integration.dsl.IntegrationFlow;
|
||||
import org.springframework.integration.dsl.MessageChannels;
|
||||
import org.springframework.integration.dsl.Pollers;
|
||||
import org.springframework.integration.dsl.*;
|
||||
import org.springframework.integration.scheduling.PollerMetadata;
|
||||
|
||||
import ru.otus.spring.integration.domain.Food;
|
||||
import ru.otus.spring.integration.services.KitchenService;
|
||||
|
||||
@@ -16,18 +11,18 @@ import ru.otus.spring.integration.services.KitchenService;
|
||||
public class IntegrationConfig {
|
||||
|
||||
@Bean
|
||||
public QueueChannel itemsChannel() {
|
||||
return MessageChannels.queue(10).get();
|
||||
public MessageChannelSpec<?, ?> itemsChannel() {
|
||||
return MessageChannels.queue(10);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public PublishSubscribeChannel foodChannel() {
|
||||
return MessageChannels.publishSubscribe().get();
|
||||
public MessageChannelSpec<?, ?> foodChannel() {
|
||||
return MessageChannels.publishSubscribe();
|
||||
}
|
||||
|
||||
@Bean(name = PollerMetadata.DEFAULT_POLLER)
|
||||
public PollerMetadata poller() {
|
||||
return Pollers.fixedRate(100).maxMessagesPerPoll(2).get();
|
||||
public PollerSpec poller() {
|
||||
return Pollers.fixedRate(100).maxMessagesPerPoll(2);
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
||||
+3
-1
@@ -51,11 +51,13 @@ public class GatewayApp {
|
||||
|
||||
@Bean
|
||||
public IntegrationFlow upcase() {
|
||||
return f -> f
|
||||
return f -> f//.channel("from-input-to-split")
|
||||
.split()
|
||||
// .split(list -> list.get().spliterator())
|
||||
// .split(getCustomSplitter(), "split")
|
||||
// .channel("from-split-to-transformer")
|
||||
.<String, String>transform(String::toUpperCase)
|
||||
// .channel("from-transformer-to-aggregate")
|
||||
.aggregate();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user