2017-10-16 19:33:15 +02:00
|
|
|
---
|
|
|
|
layout: pattern
|
|
|
|
title: EIP Splitter
|
|
|
|
folder: eip-splitter
|
|
|
|
permalink: /patterns/eip-splitter/
|
2017-12-25 11:30:24 +02:00
|
|
|
categories: Integration
|
2017-10-16 19:33:15 +02:00
|
|
|
tags:
|
|
|
|
- Java
|
|
|
|
- Difficulty-Intermittent
|
2017-12-25 11:30:24 +02:00
|
|
|
- EIP
|
2017-10-16 19:33:15 +02:00
|
|
|
---
|
|
|
|
|
|
|
|
## Intent
|
2017-10-17 12:42:41 +02:00
|
|
|
It is very common in integration systems that incoming messages consists of many items bundled together. For example
|
|
|
|
an invoice document contains multiple invoice lines describing transaction (quantity, name of provided
|
|
|
|
service/sold goods, price etc.). Such bundled messages may not be accepted by other systems. This is where splitter
|
|
|
|
pattern comes in handy. It will take the whole document, split it based on given criteria and send individual
|
|
|
|
items to the endpoint.
|
2017-10-16 19:33:15 +02:00
|
|
|
|
2017-10-17 12:42:41 +02:00
|
|
|

|
2017-10-16 19:33:15 +02:00
|
|
|
|
|
|
|
## Applicability
|
2017-10-17 12:42:41 +02:00
|
|
|
Use the Splitter pattern when
|
2017-10-16 19:33:15 +02:00
|
|
|
|
2017-10-17 12:42:41 +02:00
|
|
|
* You need to split received data into smaller pieces to process them individually
|
|
|
|
* You need to control the size of data batches you are able to process
|
2017-10-16 19:33:15 +02:00
|
|
|
|
|
|
|
## Credits
|
|
|
|
|
2017-10-17 12:42:41 +02:00
|
|
|
* [Gregor Hohpe, Bobby Woolf - Enterprise Integration Patterns](http://www.enterpriseintegrationpatterns.com/patterns/messaging/Sequencer.html)
|
|
|
|
* [Apache Camel - Documentation](http://camel.apache.org/splitter.html)
|
|
|
|
|