I think you got your imports wrong. Given the call to .asJava(),
I'm guessing you've imported Consumer from the scaladsl.
If you use javadsl you'll get akka.stream.javadsl.Source, not akka.stream.scaladsl.Source in the Tuple2.
committablePartitionedSource() is giving you a Source of tuples, one per partition, the second element of each tuple is the actual Source of messages.
If you just want to a simple app, then committableSource()
directly gives you a Source of messages, without the breakdown per
partition which you probably don't need at this stage, but it's up
to you.
Examples are in the docs:
http://doc.akka.io/docs/akka-stream-kafka/current/consumer.html
Hope that helps,
Michal
--
>>>>>>>>>> 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+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.
![]() |
Michal Borowiecki | ||||||||||||||||||||||||||||
| Senior Software Engineer L4 | |||||||||||||||||||||||||||||
|
|
|
|||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||
| This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postm...@openbet.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by OpenBet for employment and security purposes. To protect the environment please do not print this e-mail unless necessary. OpenBet Ltd. Registered Office: Chiswick Park Building 9, 566 Chiswick High Road, London, W4 5XT, United Kingdom. A company registered in England and Wales. Registered no. 3134634. VAT no. GB927523612 |
| Consumer.Control c = | |
| Consumer.committablePartitionedSource(consumerSettings, Subscriptions.topics("topic1")) | |
| .map(pair -> pair.second().via(business()).toMat(Sink.ignore(), Keep.both()).run(materializer)) | |
| .mapAsyncUnordered(maxPartitions, (pair) -> pair.second()).to(Sink.ignore()).run(materializer); |