---made some changes, still with mapAsync, in the apply() the input is 
Source not Message, how can i get the message from it, i cannot find 
anything.


TopicPartition par = new TopicPartition("test", 3);
 
Source<Tuple2<TopicPartition, 
akka.stream.scaladsl.Source<CommittableMessage<SpecificRecord, 
SpecificRecord>, NotUsed>>, Control> s 
= Consumer.committablePartitionedSource(consumerSettings, 
Subscriptions.topics("test")).asJava();
  
s.mapAsync(3, new 
Function<Tuple2<TopicPartition,akka.stream.scaladsl.Source<CommittableMessage<SpecificRecord,SpecificRecord>,NotUsed>>,
 
CompletionStage<ProducerMessage.Message<SpecificRecord,SpecificRecord, 
ConsumerMessage.Committable>>>() {

public CompletionStage<Message<SpecificRecord, SpecificRecord, 
Committable>> apply(
Tuple2<TopicPartition, 
akka.stream.scaladsl.Source<CommittableMessage<SpecificRecord, 
SpecificRecord>, NotUsed>> param)
throws Exception {
System.out.println("thread == " + Thread.currentThread().getName() + " part 
is ----------------" + param._1); 
System.out.println("thread == " + Thread.currentThread().getName() + " 
value  is ----------------" + param._2.asJava()); 
//System.out.println("thread == " + Thread.currentThread().getName() + 
"msg----------------" + msg); 
return null;
//return new ProducerMessage.Message<SpecificRecord, SpecificRecord, 
ConsumerMessage.Committable>(
// new ProducerRecord<SpecificRecord, SpecificRecord>("akkatest", 
param._2.record().key(), msg.record().value()), msg.committableOffset());
}

}).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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to