Skip to content

Instantly share code, notes, and snippets.

@timjstewart
Created May 6, 2015 16:05
Show Gist options
  • Select an option

  • Save timjstewart/4dadfcc13ba213213f93 to your computer and use it in GitHub Desktop.

Select an option

Save timjstewart/4dadfcc13ba213213f93 to your computer and use it in GitHub Desktop.
public void create(final Request request, final Response response) throws Exception {
SubPubMessage subPubMessage = null;
try {
subPubMessage = SubPubMessage.fromFormPost(request);
} catch (Exception e) {
log.error("Could not parse SubPub message, message not ack'd from SubPub.", e);
throw new Exception("Could not parse SubPub message, message not ack'd from SubPub.", e);
}
try {
kafkaService.sendKafkaMessage(config.getTopicName(), subPubMessage.getPayload(), subPubMessage.getMessageType());
countsClient.incrementGambitCount(KAFKA_MSG);
} catch (Exception e) {
log.error("Could not send to Kafka, message not ack'd from SubPub.", e);
throw new Exception("Could not send to Kafka, message not ack'd from SubPub.", e);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment