Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Message Chunk Splitter And Aggregator With MuleSoft

Message Chunk Splitter And Aggregator With MuleSoft

Message Chunk Splitter And Aggregator With MuleSoft

Jitendra Bafna

May 21, 2017
Tweet

More Decks by Jitendra Bafna

Other Decks in Technology

Transcript

  1. Message Chunk Splitter And Aggregator With MuleSoft Message Chunk Splitter

    allows you to split the single message into number of fixed-length messages that will be sent to same message processor. It will be split up the messages into small chunks according to messageSize attribute that you configured for router. The message is split by first converting into byte array and splitting this arrays into small chunks. Message Chunk Aggregator Combine two or more messages into single message by matching message with a given Correlation ID. Message Splitter V/S Message Chunk Splitter Message Chunk Splitter splits the message into chunk of bytes you defined using messageSize attribute whereas Splitter split the message into various parts you defined using Mule Expression Language (MEL). For more details on Splitter, please go through Splitter and Collection Aggregator With Mulesoft.
  2. Message Chunk Splitter And Aggregator With MuleSoft Place the HTTP

    listener into the canvas and click to open the Properties console. Click the green + and configure as follows: •Host: localhost. •Port: 8081. •Method: POST. •Path: chunksplitter.
  3. Message Chunk Splitter And Aggregator With MuleSoft Place the Message

    Chunk Splitter component in Message processor region after HTTP Listener.
  4. Message Chunk Splitter And Aggregator With MuleSoft A message chunk

    splitter is useful if you have bandwidth problems (or size limitations) when using a particular transport. Configure the Splitter component as shown below. Finally, place the file connector at the end of message processor to save all split messages.
  5. Testing Application You can use Postman to post the message.

    The listening URL will be http://localhost:8081/chunksplitter. Sample input message:
  6. Testing Application Now, you can verify the file location and

    check if the message is properly split into various parts of size 512 bytes.
  7. Message Chunk Aggregator After a splitter such as the Message

    Chunk Splitter splits a message into parts, the message chunk aggregator router reassembles those parts back into a single message. The aggregator uses the message’s correlation ID to identify which parts belong to the same message. Checks the group tag (Correlation ID) of each message in a collection, selects all the messages whose group tag matches the specified value, then combines those messages into a single message which is then sent to the next message processor in an application flow. This is particularly useful for re-assembling the segments of a long message that has been received as multiple messages, each one consisting of a segment of fixed length created and sent by the Message Chunk Splitter.