Thanks you are right, once i used all javadsl classes it gets compiled.
I got the simple app works, i like to try how the partition works. The
inner apply() is similar to the simple logic (no partition), now what i am
not sure if
1, what should completionStage contain, i am putting
CompletionStage<ProducerMessage.Message<SpecificRecord, SpecificRecord,
ConsumerMessage.Committable>>>
not sure if this is right.If so how/what should i return. Or should i
return CompletionStage<Done>, that leads to my 2nd question
2, where should i put runwith(), in the outer apply() or inner(), i have
been looking at the examples, but still not clear to me.
Source<Pair<TopicPartition, Source<CommittableMessage<SpecificRecord,
SpecificRecord>, NotUsed>>, Control> s
= Consumer.committablePartitionedSource(consumerSettings,
Subscriptions.topics("sanitation"));
s.mapAsync(3, new
Function<Pair<TopicPartition,Source<CommittableMessage<SpecificRecord,SpecificRecord>,NotUsed>>,
CompletionStage<ProducerMessage.Message<SpecificRecord, SpecificRecord,
ConsumerMessage.Committable>>>() {
public CompletionStage<ProducerMessage.Message<SpecificRecord,
SpecificRecord, ConsumerMessage.Committable>> apply(
Pair<TopicPartition,
Source<ConsumerMessage.CommittableMessage<SpecificRecord, SpecificRecord>,
NotUsed>> param)
throws Exception {
param.second().map(new
Function<ConsumerMessage.CommittableMessage<SpecificRecord,SpecificRecord>,
ProducerMessage.Message<SpecificRecord, SpecificRecord,
ConsumerMessage.Committable>>() {
public ProducerMessage.Message<SpecificRecord, SpecificRecord,
ConsumerMessage.Committable> apply(
CommittableMessage<SpecificRecord, SpecificRecord> msg)
throws Exception {
System.out.println(Thread.currentThread().getName() + "msg----------------"
+ msg);
return new ProducerMessage.Message<SpecificRecord, SpecificRecord,
ConsumerMessage.Committable>(
new ProducerRecord<SpecificRecord, SpecificRecord>("akkatest",
msg.record().key(), msg.record().value()), msg.committableOffset());
}
});
CompletableFuture<ProducerMessage.Message<SpecificRecord,SpecificRecord,Committable>>
fu = new
CompletableFuture<ProducerMessage.Message<SpecificRecord,SpecificRecord,Committable>>();;
return fu;
}
}).runWith(Producer.commitableSink(producerSettings), materializer);
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ:
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.