long tradeId = 0;
int money = 1000;
while ((line = readLine(reader)) != null) {
// send message
final SendResult sendResult =
template.send(MessageBuilder.withTopic(topic).withBody(new Trade(tradeId++, line, money++, line)));
// check result
if (!sendResult.isSuccess()) {
System.err.println("Send message failed,error message:" + sendResult.getErrorMessage());
}
else {