Sequencer not working with Splitter
Hi,
I am writing a Test Splitter which just sends the splitted message to the aggregator.The sequence no,correlation id and sequence size are set.
I pass the list of the aggregated messages to the sequencer.But it is not getting sequenced.
Here is my Splitter code:
Code:
public class MessageSplitter
{
public List<Message<String>> splitMessage(Message<Map<String, List<String>>> message)
{
List<Message<String>> result = new LinkedList<Message<String>>();
System.out.println("message is in splitter " + message.getPayload());
Message<String> firstMessage = MessageBuilder.withPayload("\"are you...\"}").setCorrelationId("ABC").setSequenceSize(2)
.setSequenceNumber(2).build();
Message<String> secondMessage = MessageBuilder.withPayload("{\"message\":\"Hello how ").setCorrelationId("ABC").setSequenceSize(2)
.setSequenceNumber(1).build();
result.add(firstMessage);
result.add(secondMessage);
return result;
}
}
This is my config file:
Code:
<int-http:inbound-channel-adapter id="smsInboundAdapter"
channel="smsChannel" name="/smsInboundAdapter.htm" supported-methods="GET" />
<int:channel id="smsChannel" />
<int:channel id="aggregationChannel" />
<int:channel id="errorChannel" />
<int:channel id="sequencerChannel" />
<int:splitter id ="messageSplitter" input-channel="smsChannel" output-channel="sequencerChannel">
<bean class="sms.communication.MessageSplitter" />
</int:splitter>
<int:resequencer input-channel="sequencerChannel"
output-channel="aggregationChannel" />
<int:aggregator method="add" input-channel="aggregationChannel"
output-channel="completeMessageChannel" discard-channel="errorChannel"
send-timeout="1" send-partial-result-on-expiry="false">
<bean class="sms.communication.MessageAggragator" />
</int:aggregator>
<int:channel id="completeMessageChannel" />
<int:service-activator id="gateway"
input-channel="errorChannel" ref="errorUnWrapper" />
<int:outbound-channel-adapter ref="messageProcessor"
channel="completeMessageChannel" />
<bean id="messageProcessor" class="sms.communication.MessageProcessor" />
<bean id="errorUnWrapper" class="sms.communication.ErrorUnWrapper" />
The output is :
Code:
message is in splitter {longcode=[9892457458], body=[{Hello how are you......}], msidn=[9833804]}
MessageAggragator : ["are you..."}, {"message":"Hello how ]
MessageProcessor : "are you..."}{"message":"Hello how
-------------------------------------------
Please help....