reactive-kafka

How to integrate akka streams kafka (reactive-kafka) into akka http application?

只愿长相守 提交于 2020-01-14 06:42:11
问题 I have a basic scala akka http CRUD application. See below for the relevant classes. I'd simply like to write an entity id and some data (as json) to a Kafka topic whenever, for example, an entity is created/updated. I'm looking at http://doc.akka.io/docs/akka-stream-kafka/current/producer.html, but am new to scala and akka, and unsure of how to integrate it into my application? For example, from the docs above, this is the example of a producer writing to kafka, so I think I need to

Reactive Kafka : Exactly Once Processing with Transaction

孤者浪人 提交于 2019-12-11 00:34:58
问题 Initially triggered via api call 1. Service A produces m1 to topic1 (non transactional send) 2. Service B consumes topic1 and does some processing (begin tx) 3. Service B produces m2 to topic2 (commit tx) 4. Service A consumes topic2 (begin tx) Here is my producer config: final Map<String, Object> props = Maps.newConcurrentMap(); props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers); props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class); props.put

Reactor Kafka: Exactly Once Processing Sample

人走茶凉 提交于 2019-12-04 06:46:18
问题 I've read many articles where there are many different configurations to achieve exactly once processing. Here is my producer config: final Map<String, Object> props = Maps.newConcurrentMap(); props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers); props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class); props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, JsonSerializer.class); props.put(ProducerConfig.ENABLE_IDEMPOTENCE_CONFIG, "true"); props.put