Comments (4)
I'm working on this now as a part of #21.
As I mentioned there:
Underneath the subscriber is an Akka actor. Errors can be handled with custom behavior using DeathWatch. I'm checking how one can pass more details on exceptions with that.
from alpakka-kafka.
@xelax Error handling can be realized using the API like in following example:
https://github.com/softwaremill/reactive-kafka/blob/master/src/test/scala/examples/examples.scala#L40
You can shut down the source by sending a ActorSubscriberMessage.OnComplete
to a KafkaActorSubscriber
actor.
from alpakka-kafka.
@xelax you can also use more idiomatic way to handle errors. I'm hoping to add some documentation soon. Here's a quick example:
val decider: Supervision.Decider = {
case _ => Supervision.Resume
}
Source(kafkaPublisher)
.withAttributes(ActorAttributes.supervisionStrategy(decider))
.runWith(someSink)
from alpakka-kafka.
@xelax looks like I gave a wrong example. A source will not restart on errors, it will just propagate the error further by calling onError() on its subscribers. Here's a better example of custom error, handling, which is meaningful for a Sink:
val decider: Supervision.Decider = {
case _ => Supervision.Resume // Your custom handling
}
Source(publisher)
.map(_.message().toUpperCase)
.to(Sink(kafkaSubscribe).withAttributes(ActorAttributes.supervisionStrategy(decider)))
.run()
from alpakka-kafka.
Related Issues (20)
- New method for a completeable `takeWhile`
- Have to ability to configure the schema registry in the test kit HOT 1
- Calling methods which use `cluster` under the hood can cause `NullPointerExecption`
- Possiblity to inject a Strategy to KafkaClusterSharding
- Consumer clientId=consumer-A-1, groupId=A] Adding newly assigned partitions:
- Release Alpakka Kafka 3.0.1
- failed: AtLeastOnceTest
- Release Alpakka Kafka HOT 1
- Release Alpakka Kafka 4.0.0
- akka.kafka.internal.KafkaConsumerActor logs credentials on debug level HOT 6
- get metrics from SendProducer
- Release Alpakka Kafka 4.0.1
- Failed: AtLeastOnce HOT 1
- Released 4.0.1 artifact does not work with JDK 8
- Release Alpakka Kafka 4.0.2
- DrainingControl.isShutdown memory leak HOT 1
- CommittingProducerSinkStageLogic incorrectly counts awaitingCommitResult HOT 1
- Release Alpakka Kafka 5.0.0-M1
- Release Alpakka Kafka 5.0.0
- failed: RebalanceExtSpec
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alpakka-kafka.