Skip to content

Instantly share code, notes, and snippets.

@chathurangat
Last active July 30, 2018 14:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chathurangat/a5341adb8c5139fbda66953ceea2de1c to your computer and use it in GitHub Desktop.
Save chathurangat/a5341adb8c5139fbda66953ceea2de1c to your computer and use it in GitHub Desktop.
@Slf4j
@EnableBinding(OrderSource.class)
@RestController
public class OrderController
{
@Autowired
private OrderSource source;
@PostMapping("/orders/publish")
public String publishOrder(@RequestBody Order order, @RequestParam("payment_mode") String paymentMode)
{
source.create().send(MessageBuilder.withPayload(order).setHeader("payment_mode",paymentMode).build());
log.info(order.toString());
return "order_published";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment