Skip to content

Instantly share code, notes, and snippets.

@chocotan
Forked from garystafford/spring_post_05a.java
Created March 10, 2016 01:04
Show Gist options
  • Save chocotan/475b3cb67ca728384608 to your computer and use it in GitHub Desktop.
Save chocotan/475b3cb67ca728384608 to your computer and use it in GitHub Desktop.
@Autowired
@Output(OUTPUT)
private MessageChannel messageChannel;
@Value("${message}")
private String message;
@Description("Post new reservations using Spring Cloud Stream")
@RequestMapping(method = POST)
public void acceptNewReservations(@RequestBody Reservation r) {
Message<String> build = withPayload(r.getReservationName()).build();
this.messageChannel.send(build);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment