Created
December 29, 2018 13:12
-
-
Save fmachado091/5bd9b2e1cc25757c9087efeb78635161 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RestController | |
@RequestMapping("/hello") | |
public class HelloPubSubController { | |
private static final Logger LOGGER = LoggerFactory.getLogger(HelloPubSubController.class); | |
private final HelloPubSubPublisher publisher; | |
@Autowired | |
public HelloPubSubController(HelloPubSubPublisher publisher) { | |
this.publisher = publisher; | |
} | |
@PostMapping("/publish") | |
public void publish(@RequestBody String message) { | |
LOGGER.info("Received a POST at /hello/publish with message=[{}]", message); | |
publisher.publish(message); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment