๐Ÿ’ป
Albert's Til
GitHub
  • ๋งค์ผ๋งค์ผ ์กฐ๊ธˆ์”ฉ ์„ฑ์žฅํ•˜๊ธฐ
    • README
    • CS
      • Network
      • HTTP
        • NO-CACHE
      • ์˜ค๋ฅ˜ ์ฝ”๋“œ
      • ORM ๋„๊ตฌ
      • Design Pattern
        • CQRS Pattern
          • Event Sourcing and CQRS pattern
        • Builder Pattern
    • DB
      • MySQL
        • Timeline
        • Pagination
        • Index
        • Database Performance Optimization Strategies
        • B+ tree
        • MySQL Connectors VS MySQL Shell(Scripting) VS MySQL Workbench
        • MySQL Storage Engine Architecture
      • Normalization & Denormalization
      • JPA
        • @Transactional
        • Why JPA?
        • About JPA
        • N+1 Issue
        • Index
        • ElementCollection&CollectionTable
        • orphanRemoval
        • CascadeType
        • Use Subselect
        • Dynamic Instance Creation
        • Paging
        • Order
        • Spefication
        • mappedBy
      • MongoDB
        • ObjectId
      • Why MySQL?
      • ACID properties of transactions
      • Between JPA and JDBC
      • Identifiers in Hibernate/JPA
    • Java
      • Jackson de/serialize
      • Collections.singletonList() vs List.of()
      • Manage dependencies in Gradle
      • Logging Level
      • Bean Validation
      • JVM Internals
        • Threads
          • Frame
        • Shared Between Threads
          • Classloader
            • Class Loader Hierarchy
            • Loading Linking Initialization
      • Java Collection Framework
      • Annotation
      • Generic
      • ๋””๋ฏธํ„ฐ ๋ฒ•์น™
    • Spring
      • Caching
      • Spring Integration Overview
        • ThreadPollTaskExecutor
        • Messaging Bridge
        • Channel Adapter
        • Poller
        • Configuration and @EnableIntegration
        • Message Endpoints
        • Message Channels
      • HATEOAS
      • @Autowired vs Constructor Dependency Injection
      • Spring Security
        • JWT ํ† ํฐ ์‚ฌ์šฉํ•œ ์ธ๊ฐ€
        • OAuth 2 Login
        • OAuth 2 ์ธ์ฆ
        • ์ธ๊ฐ€
        • ์ธ์ฆ
        • PasswordEncoder
      • IoC Container
      • Filter,Interceptor,AOP,Argument Resolver
      • Spring Annotation
      • About Spring
    • Kafka
      • Error Channel
    • Infra
      • Scale Up || Scale Out
      • Docker
        • Dockerfile
        • Docker Hub Deploy
        • Command
      • Cloud ์œ ํ˜•
        • Infrastructure as a Service
        • Platform as a Service
        • Software as a Service
      • ๋ฌด์ค‘๋‹จ ๋ฐฐํฌ
        • ์—”์ง„์—‘์Šค(Nginx)
      • ์ฝ”๋“œ ์ž๋™ ๋ฐฐํฌ
        • Technical
      • AWS EC2
        • PEM(Privacy Enhanced Mail) ํ‚ค
      • AWS RDS
      • AWS S3
    • CodeSquad
      • Spring Boot Project 1์ฃผ์ฐจ ํšŒ๊ณ 
      • Spring Boot Project 2์ฃผ์ฐจ ํšŒ๊ณ 
      • Spirng Boot Project 3์ฃผ์ฐจ ํšŒ๊ณ 
      • Spring Boot Project 4์ฃผ์ฐจ ํšŒ๊ณ 
    • Foody Moody ํ”„๋กœ์ ํŠธ
      • Query Performance Comparison
      • HeartCount Asynchronous Issue
      • DeferredResult
      • ResponseBodyEmitter
      • SseEmitter (Spring)
      • Server-Sent Events (SSE)
      • ๊ธฐ์ˆ  ์Šคํƒ ์ ์šฉ ์ด์œ 
      • NO-CACHE(HTTP)
      • Transactional
    • DDD
      • AggregateId
    • Test
      • RestAssured
    • Coding and Algorithmic Problems
      • 819. Most Common Word
      • 344. Reverse String
      • 125. Valid Palindrome
      • 937. Reorder Data in Log Files
    • Node
      • Async... Await...
      • Custom Transactional Decorator Challenger
    • Python
      • Python Basic Grammar
        • Comments and Input/Output
        • Variable
        • Data type
        • Operations and syntax
        • List,Tuple,Dictionary,Set
        • Function
        • Conditional statement
        • Loop
    • HTML
      • HTML Basic
      • HTML Basic Tags
      • HTML Form Tags
      • HTML Table Tags
    • CSS
      • CSS Basic
      • CSS Practice
Powered by GitBook
On this page
  • Message Transformer
  • Message Filter
  • Message Router
  • Splitter
  • Aggregator
  • Service Activator
  • Channel Adapter
  • Endpoint Bean Names
  • Consumer๋Š” ๋ฉ”์‹œ์ง€ ํ•ธ๋“ค๋Ÿฌ์— ๋Œ€ํ•œ ์ฐธ์กฐ๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ์œผ๋ฉฐ ๋ฉ”์‹œ์ง€๊ฐ€ ๋„์ฐฉํ•˜๋ฉด ์ด๋ฅผ ํ˜ธ์ถœํ•ฉ๋‹ˆ๋‹ค
  • ๋งˆ์ฐฌ๊ฐ€์ง€๋กœ ํด๋ง ๊ฐ€๋Šฅ ๋ฉ”์‹œ์ง€ ์†Œ์Šค๋Š” SPCA(SourcePollingChannelAdapter)์™€ MessageSource๋ผ๋Š” ๋‘ ๊ฐœ์˜ ๋นˆ์„ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค
  • Reference

Was this helpful?

  1. ๋งค์ผ๋งค์ผ ์กฐ๊ธˆ์”ฉ ์„ฑ์žฅํ•˜๊ธฐ
  2. Spring
  3. Spring Integration Overview

Message Endpoints

Last updated 1 year ago

Was this helpful?

Message Transformer

๋ฉ”์‹œ์ง€ ๋ณ€ํ™˜๊ธฐ๋Š” ๋ฉ”์‹œ์ง€์˜ ๋‚ด์šฉ์ด๋‚˜ ๊ตฌ์กฐ๋ฅผ ๋ณ€ํ™˜ํ•˜๊ณ  ์ˆ˜์ •๋œ ๋ฉ”์‹œ์ง€๋ฅผ ๋ฐ˜ํ™˜ํ•˜๋Š” ์—ญํ• ์„ ํ•ฉ๋‹ˆ๋‹ค.

Message Filter

๋ฉ”์‹œ์ง€ ํ•„ํ„ฐ๋Š” ๋ฉ”์‹œ์ง€๋ฅผ ์ถœ๋ ฅ ์ฑ„๋„๋กœ ์ „๋‹ฌํ•ด์•ผ ํ•˜๋Š”์ง€ ์—ฌ๋ถ€๋ฅผ ๊ฒฐ์ •ํ•ฉ๋‹ˆ๋‹ค.

๋ฉ”์‹œ์ง€ ํ•„ํ„ฐ๋Š” ์—ฌ๋Ÿฌ ์†Œ๋น„์ž๊ฐ€ ๋™์ผํ•œ ๋ฉ”์‹œ์ง€๋ฅผ ์ˆ˜์‹ ํ•˜๊ณ  ํ•„ํ„ฐ ๊ธฐ์ค€์„ ์‚ฌ์šฉํ•˜์—ฌ ์ฒ˜๋ฆฌํ•  ๋ฉ”์‹œ์ง€ ์ง‘ํ•ฉ์˜ ๋ฒ”์œ„๋ฅผ ์ขํž ์ˆ˜ ์žˆ๋Š” publish-subscribe channel๊ณผ ํ•จ๊ป˜ ์‚ฌ์šฉ๋˜๋Š” ๊ฒฝ์šฐ๊ฐ€ ๋งŽ์Šต๋‹ˆ๋‹ค.

Message Router

๋ฉ”์‹œ์ง€ ๋ผ์šฐํ„ฐ๋Š” ๋‹ค์Œ์— ๋ฉ”์‹œ์ง€๋ฅผ ์ˆ˜์‹ ํ•ด์•ผ ํ•˜๋Š” ์ฑ„๋„(์žˆ๋Š” ๊ฒฝ์šฐ)์„ ๊ฒฐ์ •ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

์ผ๋ฐ˜์ ์œผ๋กœ ๋ฉ”์‹œ์ง€ ๋‚ด์šฉ ๋˜๋Š” ๋ฉ”์‹œ์ง€ ํ—ค๋”์—์„œ ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ์— ๋”ฐ๋ผ ๊ฒฐ์ •๋ฉ๋‹ˆ๋‹ค.

๋ฉ”์‹œ์ง€ ๋ผ์šฐํ„ฐ๋Š” ํšŒ์‹  ๋ฉ”์‹œ์ง€๋ฅผ ๋ณด๋‚ผ ์ˆ˜ ์žˆ๋Š” ์„œ๋น„์Šค ์•กํ‹ฐ๋ฒ ์ดํ„ฐ ๋˜๋Š” ๊ธฐํƒ€ ์—”๋“œํฌ์ธํŠธ์—์„œ ์ •์ ์œผ๋กœ ๊ตฌ์„ฑ๋œ ์ถœ๋ ฅ ์ฑ„๋„์— ๋Œ€ํ•œ ๋™์  ๋Œ€์•ˆ์œผ๋กœ ์ž์ฃผ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค.

Splitter

์Šคํ”Œ๋ฆฌํ„ฐ๋Š” ์ž…๋ ฅ ์ฑ„๋„์—์„œ ๋ฉ”์‹œ์ง€๋ฅผ ์ˆ˜๋ฝํ•˜๊ณ  ํ•ด๋‹น ๋ฉ”์‹œ์ง€๋ฅผ ์—ฌ๋Ÿฌ ๋ฉ”์‹œ์ง€๋กœ ๋ถ„ํ• ํ•˜๊ณ  ๊ฐ ๋ฉ”์‹œ์ง€๋ฅผ ์ถœ๋ ฅ ์ฑ„๋„๋กœ ๋ณด๋‚ด๋Š” ๋˜ ๋‹ค๋ฅธ ์œ ํ˜•์˜ ๋ฉ”์‹œ์ง€ ๋์ ์ž…๋‹ˆ๋‹ค

Aggregator

์• ๊ทธ๋ฆฌ๊ฒŒ์ดํ„ฐ๋Š” ์—ฌ๋Ÿฌ ๋ฉ”์‹œ์ง€๋ฅผ ์ˆ˜์‹ ํ•˜์—ฌ ๋‹จ์ผ ๋ฉ”์‹œ์ง€๋กœ ๊ฒฐํ•ฉํ•˜๋Š” ์ผ์ข…์˜ ๋ฉ”์‹œ์ง€ ์—”๋“œํฌ์ธํŠธ์ž…๋‹ˆ๋‹ค.

Service Activator

Service Activator๋Š” ์„œ๋น„์Šค ์ธ์Šคํ„ด์Šค๋ฅผ ๋ฉ”์‹œ์ง• ์‹œ์Šคํ…œ์— ์—ฐ๊ฒฐํ•˜๊ธฐ ์œ„ํ•œ ์ผ๋ฐ˜ ๋์ ์ž…๋‹ˆ๋‹ค.

๋ฉ”์‹œ์ง€ ์ฑ„๋„์—์„œ ์ฑ„๋„์€ ํด๋ง ๊ฐ€๋Šฅํ•˜๊ฑฐ๋‚˜ ๊ตฌ๋… ๊ฐ€๋Šฅํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์œ„ ๋‹ค์ด์–ด๊ทธ๋žจ์—์„œ ์ด๊ฒƒ์€ "์‹œ๊ณ„" ๊ธฐํ˜ธ์™€ ์‹ค์„  ํ™”์‚ดํ‘œ(poll) ๋ฐ ์ ์„  ํ™”์‚ดํ‘œ(subscribe)๋กœ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค

Channel Adapter

์ฑ„๋„ ์–ด๋Œ‘ํ„ฐ๋Š” ๋ฉ”์‹œ์ง€ ์ฑ„๋„์„ ๋‹ค๋ฅธ ์‹œ์Šคํ…œ์ด๋‚˜ ์ „์†ก์— ์—ฐ๊ฒฐํ•˜๋Š” ๋์ ์ž…๋‹ˆ๋‹ค.

๋ฉ”์‹œ์ง€ ์†Œ์Šค๋Š” pollable(์˜ˆ: POP3) ๋˜๋Š” message-driven(์˜ˆ: IMAP Idle) ํ•  ์ˆ˜์žˆ๋‹ˆ๋‹ค. ์•ž์˜ ๋‹ค์ด์–ด๊ทธ๋žจ์—์„œ ์ด๋Š” "์‹œ๊ณ„" ๊ธฐํ˜ธ์™€ ์‹ค์„  ํ™”์‚ดํ‘œ(poll) ๋ฐ ์ ์„  ํ™”์‚ดํ‘œ(message-driven)๋กœ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค

๋ฉ”์‹œ์ง€ ์ฑ„๋„์—์„œ ์ฑ„๋„์€ ํด๋ง ๊ฐ€๋Šฅํ•˜๊ฑฐ๋‚˜ ๊ตฌ๋… ๊ฐ€๋Šฅํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์œ„ ๋‹ค์ด์–ด๊ทธ๋žจ์—์„œ ์ด๊ฒƒ์€ "์‹œ๊ณ„" ๊ธฐํ˜ธ์™€ ์‹ค์„  ํ™”์‚ดํ‘œ(poll) ๋ฐ ์ ์„  ํ™”์‚ดํ‘œ(subscribe)๋กœ ํ‘œ์‹œ๋ฉ๋‹ˆ๋‹ค

Endpoint Bean Names

์†Œ๋น„ ์—”๋“œํฌ์ธํŠธ(inputChannel์ด ์žˆ๋Š” ๋ชจ๋“  ๊ฒƒ)๋Š” consumer์™€ message ํ•ธ๋“ค๋Ÿฌ๋ผ๋Š” ๋‘ ๊ฐœ์˜ ๋นˆ์œผ๋กœ ๊ตฌ์„ฑ๋ฉ๋‹ˆ๋‹ค.

Consumer๋Š” ๋ฉ”์‹œ์ง€ ํ•ธ๋“ค๋Ÿฌ์— ๋Œ€ํ•œ ์ฐธ์กฐ๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ์œผ๋ฉฐ ๋ฉ”์‹œ์ง€๊ฐ€ ๋„์ฐฉํ•˜๋ฉด ์ด๋ฅผ ํ˜ธ์ถœํ•ฉ๋‹ˆ๋‹ค

XML ๊ตฌ์„ฑ:

<int:service-activator id = "someService" ... />

์•ž์˜ ์˜ˆ์—์„œ bean ์ด๋ฆ„์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค

  • Consumer: someService (the id)

  • Handler: someService.handler

EIP(Enterprise Integration Pattern) ์–ด๋…ธํ…Œ์ด์…˜์„ ์‚ฌ์šฉํ•  ๋•Œ ์ด๋ฆ„์€ ์—ฌ๋Ÿฌ ์š”์ธ์— ๋”ฐ๋ผ ๋‹ฌ๋ผ์ง‘๋‹ˆ๋‹ค. ์–ด๋…ธํ…Œ์ด์…˜์ด ๋‹ฌ๋ฆฐ POJO์˜ ๋‹ค์Œ ์˜ˆ:

@Component
public class SomeComponent {

    @ServiceActivator(inputChannel = ...)
    public String someMethod(...) {
        ...
    }

}

์•ž์˜ ์˜ˆ์—์„œ bean ์ด๋ฆ„์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค

  • Consumer: someComponent.someMethod.serviceActivator

  • Handler: someComponent.someMethod.serviceActivator.handler

๋ฒ„์ „ 5.0.4๋ถ€ํ„ฐ ๋‹ค์Œ ์˜ˆ์ œ์™€ ๊ฐ™์ด @EndpointId์ฃผ์„์„ ์‚ฌ์šฉํ•˜์—ฌ ์ด๋Ÿฌํ•œ ์ด๋ฆ„์„ ์ˆ˜์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

@Component
public class SomeComponent {

    @EndpointId("someService")
    @ServiceActivator(inputChannel = ...)
    public String someMethod(...) {
        ...
    }

}

์•ž์˜ ์˜ˆ์—์„œ bean ์ด๋ฆ„์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค:

  • Consumer: someService

  • Handler: someService.handler

@EndpointId๋Š” XML ๊ตฌ์„ฑ์„ ์‚ฌ์šฉํ•˜์—ฌ id ์†์„ฑ์— ์˜ํ•ด ์ƒ์„ฑ๋œ ์ด๋ฆ„์„ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.

@Configuration
public class SomeConfiguration {

    @Bean
    @ServiceActivator(inputChannel = ...)
    public MessageHandler someHandler() {
        ...
    }

}

์•ž์˜ ์˜ˆ์—์„œ bean ์ด๋ฆ„์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค:

  • Consumer: someConfiguration.someHandler.serviceActivator

  • Handler: someHandler (the @Bean name)

๋ฒ„์ „ 5.0.4๋ถ€ํ„ฐ ๋‹ค์Œ ์˜ˆ์ œ์™€ ๊ฐ™์ด @EndpointId ์ฃผ์„์„ ์‚ฌ์šฉํ•˜์—ฌ ์ด๋Ÿฌํ•œ ์ด๋ฆ„์„ ์ˆ˜์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

@Configuration
public class SomeConfiguration {

    @Bean("someService.handler")             (1)
    @EndpointId("someService")               (2)
    @ServiceActivator(inputChannel = ...)
    public MessageHandler someHandler() {
        ...
    }

}

์•ž์˜ ์˜ˆ์—์„œ bean ์ด๋ฆ„์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค:

  • Consumer: someService (the endpoint ID)

  • Handler: someService.handler (the bean name)

๋งˆ์ฐฌ๊ฐ€์ง€๋กœ ํด๋ง ๊ฐ€๋Šฅ ๋ฉ”์‹œ์ง€ ์†Œ์Šค๋Š” SPCA(SourcePollingChannelAdapter)์™€ MessageSource๋ผ๋Š” ๋‘ ๊ฐœ์˜ ๋นˆ์„ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค

XML ๊ตฌ์„ฑ:

<int:inbound-channel-adapter id = "someAdapter" ... />

Given the preceding XML configuration, the bean names are as follows:

  • SPCA: someAdapter (the id)

  • Handler: someAdapter.source

Java configuration of a POJO to define an @EndpointId

@EndpointId("someAdapter")
@InboundChannelAdapter(channel = "channel3", poller = @Poller(fixedDelay = "5000"))
public String pojoSource() {
    ...
}

Given the preceding Java configuration example, the bean names are as follows:

  • SPCA: someAdapter

  • Handler: someAdapter.source

Java configuration of a bean to define an @EndpointID:

@Bean("someAdapter.source")
@EndpointId("someAdapter")
@InboundChannelAdapter(channel = "channel3", poller = @Poller(fixedDelay = "5000"))
public MessageSource<?> source() {
    return () -> {
        ...
    };
}

Given the preceding example, the bean names are as follows:

  • SPCA: someAdapter

  • Handler: someAdapter.source (as long as you use the convention of appending .source to the @Bean name)

Reference

Overview of Spring Integration Framework
Logo
Message Router
Service Activator
์ธ๋ฐ”์šด๋“œ ์ฑ„๋„ ์–ด๋Œ‘ํ„ฐ ์—”๋“œํฌ์ธํŠธ๋Š” ์†Œ์Šค ์‹œ์Šคํ…œ์„ MessageChannel์— ์—ฐ๊ฒฐํ•ฉ๋‹ˆ๋‹ค.
์•„์›ƒ๋ฐ”์šด๋“œ ์ฑ„๋„ ์–ด๋Œ‘ํ„ฐ ๋์ ์€ MessageChannel์„ ๋Œ€์ƒ ์‹œ์Šคํ…œ์— ์—ฐ๊ฒฐํ•ฉ๋‹ˆ๋‹ค.