Java Code Examples for org.springframework.integration.support.MessageBuilder#withPayload()

The following examples show how to use org.springframework.integration.support.MessageBuilder#withPayload() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TransactionalApplication.java    From rocketmq-binder-demo with Apache License 2.0 5 votes vote down vote up
@Override
public void run(String... args) throws Exception {
	int count = 5;
	for (int index = 1; index <= count; index++) {
		MessageBuilder builder = MessageBuilder
				.withPayload("transactional-msg-" + index);
		if (index % 2 == 0) {
			builder.setHeader("error", "1");
		}
		source.output().send(builder.build());
	}
}
 
Example 2
Source File: TagsApplication.java    From rocketmq-binder-demo with Apache License 2.0 5 votes vote down vote up
@Override
public void run(String... args) throws Exception {
	int count = 5;
	for (int index = 1; index <= count; index++) {
		MessageBuilder builder = MessageBuilder.withPayload("msg-" + index);
		if (index % 2 == 0) {
			builder.setHeader(RocketMQHeaders.TAGS, "order");
		}
		else {
			builder.setHeader(RocketMQHeaders.TAGS, "pay");
		}
		source.output().send(builder.build());
	}
}
 
Example 3
Source File: EmailToOrderTransformer.java    From spring-in-action-5-samples with Apache License 2.0 4 votes vote down vote up
@Override
protected AbstractIntegrationMessageBuilder<Order> 
              doTransform(Message mailMessage) throws Exception {
  Order tacoOrder = processPayload(mailMessage);
  return MessageBuilder.withPayload(tacoOrder);
}
 
Example 4
Source File: EmailToOrderTransformer.java    From spring-in-action-5-samples with Apache License 2.0 4 votes vote down vote up
@Override
protected AbstractIntegrationMessageBuilder<Order> 
              doTransform(Message mailMessage) throws Exception {
  Order tacoOrder = processPayload(mailMessage);
  return MessageBuilder.withPayload(tacoOrder);
}
 
Example 5
Source File: EmailToOrderTransformer.java    From spring-in-action-5-samples with Apache License 2.0 4 votes vote down vote up
@Override
protected AbstractIntegrationMessageBuilder<Order> 
              doTransform(Message mailMessage) throws Exception {
  Order tacoOrder = processPayload(mailMessage);
  return MessageBuilder.withPayload(tacoOrder);
}