@ConditionalOnClass(value={KafkaSimulator.class,KafkaSimulatorFactory.class})
@ConditionalOnProperty(prefix="embedded.kafka.simulator",
name="enabled",
havingValue="true",
matchIfMissing=false)
@RestController
@RequestMapping(path="/simulator/producer/api/1.0",
produces="application/json",
consumes="application/json")
@Validated
public class ProducerController
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private KafkaSimulator |
kafkaSimulator
Simulateur KAFKA
|
| Constructor and Description |
|---|
ProducerController() |
| Modifier and Type | Method and Description |
|---|---|
void |
sendMessage(@NotEmpty java.lang.String topicName,
java.lang.String message)
Methode permettant d'envoyer un message sur un topic du simulateur
|
void |
sendMessage(@NotEmpty java.lang.String topicName,
@NotEmpty java.lang.String messageKey,
java.lang.String message)
Methode permettant d'envoyer un message sur un topic du simulateur
|
@Autowired private KafkaSimulator kafkaSimulator
@PostMapping(path="/send/{topicName}/{messageKey}",
consumes="application/json")
@ResponseStatus(value=OK,
reason="Message envoy\u00e9 dans la file")
public void sendMessage(@PathVariable(value="topicName") @NotEmpty
@NotEmpty java.lang.String topicName,
@PathVariable(value="topicName") @NotEmpty
@NotEmpty java.lang.String messageKey,
@RequestBody(required=true) @StringFormatValidator(format=JSON)
java.lang.String message)
topicName - Nom du topic d'envoiemessageKey - Clé du messagemessage - Contenu du message@PostMapping(path="/send/{topicName}",
consumes="application/json")
@ResponseStatus(value=OK,
reason="Message envoy\u00e9 dans la file")
public void sendMessage(@PathVariable(value="topicName") @NotEmpty
@NotEmpty java.lang.String topicName,
@RequestBody(required=true) @StringFormatValidator(format=JSON)
java.lang.String message)
topicName - Nom du topic d'envoiemessage - Contenu du messageCopyright © 2019 Leadware. All Rights Reserved.