๐Ÿงฉ

Spring Integration ์น˜ํŠธ์‹œํŠธ

์Šคํ”„๋ง ๊ธฐ๋ฐ˜ ์—”ํ„ฐํ”„๋ผ์ด์ฆˆ ํ†ตํ•ฉ ํŒจํ„ด(EIP) ์™„๋ฒฝ ๊ฐ€์ด๋“œ: Spring Integration 6.x ์•„ํ‚คํ…์ฒ˜, ๋ฉ”์‹œ์ง€(Message)ยท์ฑ„๋„(MessageChannel)ยท์—”๋“œํฌ์ธํŠธ ๋ชจ๋ธ, Java DSL(IntegrationFlow) ํŒŒ์ดํ”„๋ผ์ธ, ๋ณ€ํ™˜(Transformer)ยทํ•„ํ„ฐ(Filter)ยท๋ผ์šฐํ„ฐ(Router)ยท๋ถ„ํ• (Splitter)ยท์ง‘๊ณ„(Aggregator), ํŒŒ์ผ/SFTP ํด๋Ÿฌ ์–ด๋Œ‘ํ„ฐ ๋ฐ ์—๋Ÿฌ ์ฑ„๋„(errorChannel) ์ฒ˜๋ฆฌ

--views
๋‹จ์ˆ˜:
#spring-integration#spring-boot#eip#enterprise-integration#messaging#java-dsl#router#splitter#aggregator#backend์ตœ์ข… ์—…๋ฐ์ดํŠธ: 2026-10-11

1. ํ•„์ˆ˜ ์‚ฌ์ „ ์„ค์น˜ ์š”๊ฑด & ๊ฐœ๋ฐœ ํ™˜๊ฒฝ ๊ตฌ์„ฑ (Prerequisites)

๐Ÿ’ป ์‹œ์Šคํ…œ ์„ค์น˜ ๋ฐ ์‹คํ–‰ ์š”๊ตฌ์‚ฌ์–‘ (System Requirements)

ํ•ญ๋ชฉ์ตœ์†Œ ์‚ฌ์–‘ (Minimum)๊ถŒ์žฅ ์‚ฌ์–‘ (Recommended)์ฐธ๊ณ  ๋ฐ ๋น„๊ณ 
์šด์˜์ฒด์ œ (OS)Windows 10/11, macOS 11+, LinuxUbuntu 22.04 LTS / macOS Sonoma / Windows 11๋ชจ๋“  ํ‘œ์ค€ JVM ํ™˜๊ฒฝ ์ง€์›
CPU2 ์ฝ”์–ด ์ด์ƒ4 ์ฝ”์–ด ~ 8 ์ฝ”์–ด ์ด์ƒ๋Œ€์šฉ๋Ÿ‰ ๋ฉ”์‹œ์ง€ ๋ฐฐ์น˜ ๋ถ„ํ• /์ง‘๊ณ„ ๋ฐ ๋ฉ€ํ‹ฐ์Šค๋ ˆ๋“œ ํด๋Ÿฌ ์ฒ˜๋ฆฌ
๋ฉ”๋ชจ๋ฆฌ (RAM)2 GB ์ด์ƒ4 GB ~ 8 GB ์ด์ƒํ ์ฑ„๋„(QueueChannel) ์ธ๋ฉ”๋ชจ๋ฆฌ ๋ฒ„ํผ๋ง ๋ฐ JVM ํž™ ๊ณต๊ฐ„
๋””์Šคํฌ (Storage)500 MB ์ด์ƒ ์—ฌ์œ  ๊ณต๊ฐ„5 GB ์ด์ƒ (SSD ๊ถŒ์žฅ)ํŒŒ์ผ/SFTP ์–ด๋Œ‘ํ„ฐ ๋กœ์ปฌ ์ž„์‹œ ์ˆ˜์‹  ๋””๋ ‰ํ† ๋ฆฌ
์ž๋ฐ” & ๋Ÿฐํƒ€์ž„Java 17 LTS ์ด์ƒJava 21 LTSSpring Boot 3.x ๋ฐ Spring Integration 6.x ํ˜ธํ™˜
๋นŒ๋“œ ๋„๊ตฌGradle 8.x+ ๋˜๋Š” Maven 3.8+Gradle 8.5+ (Kotlin/Groovy DSL)spring-boot-starter-integration ์˜์กด์„ฑ

2. ํ•ต์‹ฌ ๋ฉ˜ํƒˆ ๋ชจ๋ธ: ์—”ํ„ฐํ”„๋ผ์ด์ฆˆ ํ†ตํ•ฉ ํŒจํ„ด(EIP) ํŒŒ์ดํ”„๋ผ์ธ (Mental Model & Architecture)

Spring Integration์€ Gregor Hohpe์˜ ์—”ํ„ฐํ”„๋ผ์ด์ฆˆ ํ†ตํ•ฉ ํŒจํ„ด(EIP) ์„ ์Šคํ”„๋ง ํ”„๋ ˆ์ž„์›Œํฌ ๊ธฐ๋ฐ˜์œผ๋กœ ๊ตฌํ˜„ํ•˜์—ฌ, ์‹œ์Šคํ…œ ๊ฐ„์˜ ๊ฒฐํ•ฉ๋„๋ฅผ ๋‚ฎ์ถ”๊ณ  ๋ฉ”์‹œ์ง€ ๊ธฐ๋ฐ˜์˜ ์ด๋ฒคํŠธ ํŒŒ์ดํ”„๋ผ์ธ์„ ๊ตฌ์ถ•ํ•ฉ๋‹ˆ๋‹ค.

+-----------------------------------------------------------------------------------+
|                        Message Producer / Inbound Adapter                         |
|     File Watcher, HTTP Inbound, Kafka Topic, or @MessagingGateway ํ˜ธ์ถœ            |
+-----------------------------------------------------------------------------------+
                                         โ”‚
                                         โ–ผ
+-----------------------------------------------------------------------------------+
|                      Spring Message Structure (๋ถˆ๋ณ€ ๊ฐ์ฒด)                         |
|  - Message Headers: ID, Timestamp, CorrelationId, ReplyChannel, CustomHeaders    |
|  - Message Payload: <T> (์‹ค์ œ ๋น„์ฆˆ๋‹ˆ์Šค ๋ฐ์ดํ„ฐ ๊ฐ์ฒด ๋˜๋Š” byte[] / String)          |
+-----------------------------------------------------------------------------------+
                                         โ”‚
                                         โ–ผ
+-----------------------------------------------------------------------------------+
|                    Message Channel (๋ฉ”์‹œ์ง€ ์ „์†ก ํ†ต๋กœ)                              |
|  [DirectChannel]            ๋‹จ์ผ ์Šค๋ ˆ๋“œ ๋™๊ธฐ์‹ Point-to-Point (๊ธฐ๋ณธ๊ฐ’)             |
|  [QueueChannel]             ์ธ๋ฉ”๋ชจ๋ฆฌ FIFO ๋ฒ„ํผ๋ง ๋น„๋™๊ธฐ ์ฑ„๋„ (Backpressure)        |
|  [PublishSubscribeChannel] 1:N ๋ธŒ๋กœ๋“œ์บ์ŠคํŠธ ๋ธŒ๋กœ๋“œ์บ์ŠคํŒ… ์ฑ„๋„                     |
+-----------------------------------------------------------------------------------+
                                         โ”‚
             EIP Core Endpoints (๋ณ€ํ™˜, ํ•„ํ„ฐ๋ง, ๋ผ์šฐํŒ…, ๋ถ„ํ•  & ์ง‘๊ณ„)
                                         โ–ผ
+โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€+
|  .filter(...)        --> ์กฐ๊ฑด์— ๋งž์ง€ ์•Š๋Š” ๋ถˆ๋Ÿ‰ ๋ฉ”์‹œ์ง€ ํ๊ธฐ ๋˜๋Š” discardChannel ํ–‰  |
|  .transform(...)     --> ๋ฐ์ดํ„ฐ ํฌ๋งท ๋ณ€ํ™˜ (JSON <-> DTO, ๋ณตํ˜ธํ™”, ๋Œ€์†Œ๋ฌธ์ž)        |
|  .split(...)         --> ๋ฆฌ์ŠคํŠธ/๋ฐฐ์—ด ํŽ˜์ด๋กœ๋“œ๋ฅผ ๋‹จ์ผ ๋ฉ”์‹œ์ง€๋“ค๋กœ ์ชผ๊ฐœ๊ธฐ            |
|  .aggregate(...)     --> ์ƒ๊ด€๊ด€๊ณ„(CorrelationId) ๊ธฐ๋ฐ˜์œผ๋กœ ์ฒ˜๋ฆฌ ๊ฒฐ๊ณผ ๋ฌถ๊ธฐ         |
|  .route(...)         --> ํ—ค๋”/ํŽ˜์ด๋กœ๋“œ ์กฐ๊ฑด์— ๋”ฐ๋ผ ๋ชฉ์ ์ง€ ์ฑ„๋„ ๋™์  ๋ถ„๊ธฐ          |
+โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€+
                                         โ”‚
                                         โ–ผ
+-----------------------------------------------------------------------------------+
|                  Service Activator / Outbound Channel Adapter                     |
|         ๋น„์ฆˆ๋‹ˆ์Šค ์„œ๋น„์Šค ๋ฉ”์„œ๋“œ ์‹คํ–‰, DB ์˜์†ํ™”, ์™ธ๋ถ€ REST API ๋˜๋Š” ํŒŒ์ผ ์ €์žฅ       |
+-----------------------------------------------------------------------------------+

3. ๋‹จ๊ณ„๋ณ„ ์‹ค์Šต ๊ฐ€์ด๋“œ (Step-by-Step Walkthrough)

[์ดˆ๋ณด์ž 1๋‹จ๊ณ„] ํ—ฌ๋กœ์›”๋“œ: IntegrationFlow์™€ ๊ฒŒ์ดํŠธ์›จ์ด ํŒŒ์ดํ”„๋ผ์ธ

๋‹จ์ˆœํ•˜๊ณ  ์ง๊ด€์ ์ธ Java DSL๋กœ ๋ฉ”์‹œ์ง€๋ฅผ ์ˆ˜์‹ ํ•˜์—ฌ ๋Œ€๋ฌธ์ž๋กœ ๋ณ€ํ™˜ํ•œ ๋’ค ๋กœ๊น…ํ•˜๋Š” ํŒŒ์ดํ”„๋ผ์ธ์„ ๊ตฌ์ถ•ํ•ฉ๋‹ˆ๋‹ค.

1) ๋นŒ๋“œ ์˜์กด์„ฑ ์ถ”๊ฐ€ (build.gradle)

// build.gradle
plugins {
    id 'java'
    id 'org.springframework.boot' version '3.3.4'
    id 'io.spring.dependency-management' version '1.1.6'
}

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-integration'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'
    testImplementation 'org.springframework.integration:spring-integration-test'
}

2) ๋ฉ”์‹œ์ง• ๊ฒŒ์ดํŠธ์›จ์ด ์ธํ„ฐํŽ˜์ด์Šค ์ •์˜

ํด๋ผ์ด์–ธํŠธ ์ฝ”๋“œ๊ฐ€ ์Šคํ”„๋ง ์ธํ‹ฐ๊ทธ๋ ˆ์ด์…˜์˜ ๋‚ด๋ถ€ ๋ณต์žก๋„๋ฅผ ๋ชฐ๋ผ๋„ ์ž๋ฐ” ๋ฉ”์„œ๋“œ ํ˜ธ์ถœ์ฒ˜๋Ÿผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•ด์ฃผ๋Š” ์ง„์ž…์ ์ž…๋‹ˆ๋‹ค.

package com.lucky.integration;

import org.springframework.integration.annotation.Gateway;
import org.springframework.integration.annotation.MessagingGateway;

@MessagingGateway
public interface TextOrderGateway {
    // textInputChannel๋กœ ๋ฉ”์‹œ์ง€๋ฅผ ๋ฐœํ–‰ํ•˜๊ณ  ์ตœ์ข… ๊ฒฐ๊ณผ๋ฅผ ๋™๊ธฐ์‹์œผ๋กœ ๋ฐ˜ํ™˜๋ฐ›์Œ
    @Gateway(requestChannel = "textInputChannel")
    String processText(String rawText);
}

3) Java DSL ๊ธฐ๋ฐ˜ IntegrationFlow ๊ตฌ์„ฑ ๋ฐ ๋ฉ”์ธ ์‹คํ–‰ ํด๋ž˜์Šค

package com.lucky.integration;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.integration.annotation.IntegrationComponentScan;
import org.springframework.integration.dsl.IntegrationFlow;
import org.springframework.integration.dsl.MessageChannels;
import org.springframework.messaging.MessageChannel;

@SpringBootApplication
@IntegrationComponentScan
public class SpringIntegrationApplication {

    private static final Logger log = LoggerFactory.getLogger(SpringIntegrationApplication.class);

    public static void main(String[] args) {
        SpringApplication.run(SpringIntegrationApplication.class, args);
    }

    // 1. ์ง„์ž…์  DirectChannel ๋นˆ ๋“ฑ๋ก
    @Bean
    public MessageChannel textInputChannel() {
        return MessageChannels.direct().getObject();
    }

    // 2. ๋‹จ์ผ Java DSL ํŒŒ์ดํ”„๋ผ์ธ ํ๋ฆ„ ์ •์˜
    @Bean
    public IntegrationFlow uppercaseFlow() {
        return IntegrationFlow.from(textInputChannel())
                // 1๋‹จ๊ณ„: ๋ฌธ์ž์—ด ํŽ˜์ด๋กœ๋“œ๋ฅผ ๋Œ€๋ฌธ์ž๋กœ ๋ณ€ํ™˜ (Transformer)
                .<String, String>transform(String::toUpperCase)
                // 2๋‹จ๊ณ„: ๋กœ๊ทธ ์ถœ๋ ฅ ๋ฐ ์ตœ์ข… ๊ฒฐ๊ณผ ๋ฐ˜ํ™˜ (Service Activator)
                .handle((payload, headers) -> {
                    log.info("์ตœ์ข… ์ฒ˜๋ฆฌ๋œ ํŽ˜์ด๋กœ๋“œ: {}", payload);
                    return "PROCESSED: " + payload;
                })
                .get();
    }

    // 3. ๊ธฐ๋™ ์ฆ‰์‹œ ํ…Œ์ŠคํŠธ ๋ฉ”์‹œ์ง€ ๋ฐœํ–‰
    @Bean
    public CommandLineRunner runner(TextOrderGateway gateway) {
        return args -> {
            String result = gateway.processText("hello luckytechworld integration");
            log.info("๊ฒŒ์ดํŠธ์›จ์ด ๋ฐ˜ํ™˜๊ฐ’: {}", result);
        };
    }
}

์˜ˆ์ƒ ์ฝ˜์†” ์ถœ๋ ฅ ๋กœ๊ทธ(Output):

[main] c.l.i.SpringIntegrationApplication : ์ตœ์ข… ์ฒ˜๋ฆฌ๋œ ํŽ˜์ด๋กœ๋“œ: HELLO LUCKYTECHWORLD INTEGRATION
[main] c.l.i.SpringIntegrationApplication : ๊ฒŒ์ดํŠธ์›จ์ด ๋ฐ˜ํ™˜๊ฐ’: PROCESSED: HELLO LUCKYTECHWORLD INTEGRATION

[2๋‹จ๊ณ„] ํ•ต์‹ฌ EIP ํŒจํ„ด: ๋ผ์šฐํŒ…(Router), ๋ถ„ํ• (Splitter) & ์ง‘๊ณ„(Aggregator)

์‹ค๋ฌด์—์„œ ์ž์ฃผ ์“ฐ์ด๋Š” ์ฃผ๋ฌธ ๋ฐ์ดํ„ฐ ๋ถ„ํ•  ์ฒ˜๋ฆฌ ๋ฐ ์šฐ์„ ์ˆœ์œ„ ๋ผ์šฐํŒ… ํŒจํ„ด์ž…๋‹ˆ๋‹ค.

package com.lucky.integration;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.integration.dsl.IntegrationFlow;
import org.springframework.integration.dsl.MessageChannels;

import java.util.List;

@Configuration
public class AdvancedEipFlowConfig {

    private static final Logger log = LoggerFactory.getLogger(AdvancedEipFlowConfig.class);

    public record OrderItem(String id, int amount, String category) {}

    @Bean
    public IntegrationFlow orderBatchFlow() {
        return IntegrationFlow.from("orderBatchInputChannel")
                // [Splitter] List<OrderItem> ๋ชฉ๋ก์„ ๊ฐ๊ฐ์˜ ๋‹จ์ผ OrderItem ๋ฉ”์‹œ์ง€๋กœ ์ชผ๊ฐฌ
                .split()
                // [Filter] 1000์› ์ดํ•˜์˜ ๋ฌดํšจ ์ฃผ๋ฌธ์€ ํ๊ธฐ
                .<OrderItem>filter(item -> item.amount() > 1000, 
                        f -> f.discardChannel("discardLogChannel"))
                // [Router] ์นดํ…Œ๊ณ ๋ฆฌ์— ๋”ฐ๋ผ ์„œ๋กœ ๋‹ค๋ฅธ ์ฒ˜๋ฆฌ ์ฑ„๋„๋กœ ๋™์  ๋ถ„๊ธฐ
                .<OrderItem, String>route(
                        OrderItem::category,
                        mapping -> mapping
                                .subFlowMapping("VIP", sf -> sf.handle(m -> log.info("[VIP ํŠน๊ธ‰ ๋ฐฐ์†ก] {}", m.getPayload())))
                                .subFlowMapping("NORMAL", sf -> sf.handle(m -> log.info("[์ผ๋ฐ˜ ๋ฐฐ์†ก] {}", m.getPayload())))
                                .defaultOutputToParentFlow()
                )
                // [Aggregator] ๋ถ„ํ• ๋˜์—ˆ๋˜ ์ฃผ๋ฌธ ํ•ญ๋ชฉ๋“ค์„ ๋‹ค์‹œ ๋‹จ์ผ ๋ฆฌ์ŠคํŠธ๋กœ ๋ณ‘ํ•ฉ
                .aggregate()
                .handle(m -> log.info("๋ฐฐ์น˜ ์ฃผ๋ฌธ ์ „์ฒด ์ง‘๊ณ„ ์™„๋ฃŒ: ์ด {}๊ฑด", ((List<?>) m.getPayload()).size()))
                .get();
    }

    @Bean
    public IntegrationFlow discardLogFlow() {
        return IntegrationFlow.from(MessageChannels.direct("discardLogChannel"))
                .handle(m -> log.warn("์ตœ์†Œ ๊ธˆ์•ก ๋ฏธ๋‹ฌ๋กœ ์ฃผ๋ฌธ ํ๊ธฐ: {}", m.getPayload()))
                .get();
    }
}

[3๋‹จ๊ณ„] ์‹ค๋ฌด ์‘์šฉ ํŒจํ„ด: ํŒŒ์ผ ์‹œ์Šคํ…œ ํด๋ง ์–ด๋Œ‘ํ„ฐ & ๊ธ€๋กœ๋ฒŒ ์—๋Ÿฌ ํ•ธ๋“ค๋ง

ํŠน์ • ๋””๋ ‰ํ† ๋ฆฌ์— ์ƒˆ๋กœ์šด ํŒŒ์ผ์ด ์ƒ์„ฑ๋˜๋ฉด ๊ฐ์ง€ํ•˜์—ฌ ์ฝ๊ณ , ์‹คํŒจ ์‹œ errorChannel๋กœ ๊ฒฉ๋ฆฌํ•˜๋Š” ํ”„๋กœ๋•์…˜ ํŒจํ„ด์ž…๋‹ˆ๋‹ค.

package com.lucky.integration;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.integration.dsl.IntegrationFlow;
import org.springframework.integration.dsl.Pollers;
import org.springframework.integration.file.dsl.Files;
import org.springframework.messaging.MessageHandlingException;

import java.io.File;

@Configuration
public class FilePollerFlowConfig {

    private static final Logger log = LoggerFactory.getLogger(FilePollerFlowConfig.class);

    // 1. ๋กœ์ปฌ ๋””๋ ‰ํ† ๋ฆฌ ๊ฐ์‹œ ์ธ๋ฐ”์šด๋“œ ํŒŒ์ผ ์–ด๋Œ‘ํ„ฐ
    @Bean
    public IntegrationFlow fileReadingFlow() {
        return IntegrationFlow.from(
                Files.inboundAdapter(new File("/data/incoming-orders"))
                        .patternFilter("*.csv")
                        .preventDuplicates(true),
                // 3์ดˆ ์ฃผ๊ธฐ๋กœ ํด๋งํ•˜๋ฉฐ ์ตœ๋Œ€ 10๊ฐœ ํŒŒ์ผ์”ฉ ๋ฐฐ์น˜ ์ฒ˜๋ฆฌ
                e -> e.poller(Pollers.fixedDelay(3000).maxMessagesPerPoll(10))
        )
        // ํŒŒ์ผ ๋‚ด์šฉ์„ ๋ฌธ์ž์—ด๋กœ ์ž๋™ ๋ณ€ํ™˜
        .transform(Files.toStringTransformer())
        .handle(message -> {
            String content = (String) message.getPayload();
            log.info("CSV ์ˆ˜์‹  ์™„๋ฃŒ (๊ธธ์ด: {}์ž)", content.length());
            if (content.contains("ERROR_TRIGGER")) {
                throw new IllegalArgumentException("๋ถˆ๋Ÿ‰ ์ฃผ๋ฌธ ํŒŒ์ผ ๊ฐ์ง€!");
            }
        })
        .get();
    }

    // 2. ํŒŒ์ดํ”„๋ผ์ธ ์˜ˆ์™ธ ๋ฐœ์ƒ ์‹œ ํ˜ธ์ถœ๋˜๋Š” ๊ธ€๋กœ๋ฒŒ ์—๋Ÿฌ ์ฑ„๋„
    @Bean
    public IntegrationFlow globalErrorHandlingFlow() {
        return IntegrationFlow.from("errorChannel")
                .handle(message -> {
                    MessageHandlingException ex = (MessageHandlingException) message.getPayload();
                    log.error("ํ†ตํ•ฉ ํŒŒ์ดํ”„๋ผ์ธ ์žฅ์•  ๋ฐœ์ƒ! ์‹คํŒจ ๋ฉ”์‹œ์ง€: {}, ์›์ธ: {}", 
                            ex.getFailedMessage(), ex.getMessage());
                    // ๊ด€๋ฆฌ์ž ์•Œ๋ฆผ ๋˜๋Š” Dead Letter Queue(DLQ) ์ ์žฌ ๋กœ์ง ์ˆ˜ํ–‰
                })
                .get();
    }
}

4. ์‹ค๋ฌด ์ฃผ์˜์‚ฌํ•ญ & ํ”„๋กœ๋•์…˜ ์ฒดํฌ๋ฆฌ์ŠคํŠธ

์ ๊ฒ€ ํ•ญ๋ชฉ๊ถŒ์žฅ ์ง€์นจ ๋ฐ ํ•ด๊ฒฐ์ฑ…์œ„๋ฐ˜ ์‹œ ์ž ์žฌ ์œ„ํ—˜
์ธ๋ฐ”์šด๋“œ ์–ด๋Œ‘ํ„ฐ Poller ๋ˆ„๋ฝFiles.inboundAdapter ๋“ฑ ์†Œ๊ทน์  ์ˆ˜์‹  ์ปดํฌ๋„ŒํŠธ๋Š” ๋ฐ˜๋“œ์‹œ poller() ์„ค์ • ๋ช…์‹œ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ๊ธฐ๋™ ์‹œ IllegalArgumentException: No poller has been defined ์—๋Ÿฌ๋กœ ์ปจํ…์ŠคํŠธ ๋กœ๋”ฉ ์‹คํŒจ
DirectChannel vs QueueChannelI/O ์ง€์—ฐ์ด ํฐ ์ž‘์—…์€ QueueChannel + TaskExecutor๋กœ ๋ฐฑํ”„๋ ˆ์…” ๋ฒ„ํผ ๋ถ„๋ฆฌ๋ชจ๋“  ์ž‘์—…์ด ํ˜ธ์ถœ์ž ์Šค๋ ˆ๋“œ(DirectChannel)์—์„œ ๋™๊ธฐ ์‹คํ–‰๋˜์–ด ์›น ์š”์ฒญ ์Šค๋ ˆ๋“œ ํ’€ ๊ณ ๊ฐˆ
๋ฉ”์‹œ์ง€ ๋ถˆ๋ณ€์„ฑ(Immutability) ์ค€์ˆ˜๊ธฐ์กด ๋ฉ”์‹œ์ง€์˜ ํ—ค๋”๋‚˜ ํŽ˜์ด๋กœ๋“œ๋ฅผ ์ˆ˜์ •ํ•  ๋•Œ๋Š” ๋ฐ˜๋“œ์‹œ MessageBuilder.fromMessage(m) ํ™œ์šฉ๋ฉ”์‹œ์ง€ ๊ฐ์ฒด๋ฅผ ์ง์ ‘ ์ˆ˜์ •ํ•˜๋ ค๊ณ  ์‹œ๋„ ์‹œ ์ƒํƒœ ์™œ๊ณก ๋ฐ ๋ฉ€ํ‹ฐ์Šค๋ ˆ๋“œ ๋™์‹œ์„ฑ ๋ฒ„๊ทธ ๋ฐœ์ƒ
๊ธ€๋กœ๋ฒŒ errorChannel ๊ตฌ์„ฑ๋ชจ๋“  ๋น„๋™๊ธฐ ์ฑ„๋„ ํ๋ฆ„์—๋Š” ๋ฐ˜๋“œ์‹œ errorChannel ๊ตฌ๋… ๋ฆฌ์Šค๋„ˆ ๋“ฑ๋ก๋น„๋™๊ธฐ ํ ์Šค๋ ˆ๋“œ์—์„œ ๋ฐœ์ƒํ•œ ์˜ˆ์™ธ๊ฐ€ ์ŠคํƒํŠธ๋ ˆ์ด์Šค ์—†์ด ์ฆ๋ฐœํ•˜์—ฌ ์žฅ์•  ์›์ธ ๋ถ„์„ ๋ถˆ๊ฐ€
๋ฉฑ๋“ฑ์„ฑ(Idempotent) ์ค‘๋ณต ์ˆ˜์‹  ๋ฐฉ์ง€ํŒŒ์ผ/๋ฉ”์‹œ์ง€ ์ˆ˜์‹  ์‹œ IdempotentReceiverInterceptor ๋˜๋Š” ์ค‘๋ณต ๋ฐฉ์ง€ ํ•„ํ„ฐ ์ ์šฉ๋™์ผ ํŒŒ์ผ์ด๋‚˜ ์ค‘๋ณต ์ด๋ฒคํŠธ ์ˆ˜์‹  ์‹œ ๊ฒฐ์ œ/์ฃผ๋ฌธ์ด ์ค‘๋ณต ์ฒ˜๋ฆฌ๋˜๋Š” ์‹ฌ๊ฐํ•œ ๋น„์ฆˆ๋‹ˆ์Šค ์˜ค๋ฅ˜ ๋ฐœ์ƒ
๐Ÿ’ฌ

์˜๊ฒฌ ๋ฐ ์งˆ๋ฌธ

0
0 / 1500