Comments (6)
like add a invoker to props
and then :
private def processElement(element: T) = {
props.invoker.invoke{
producer.send(props.encoder.toBytes(element), props.partitionizer(element))
}
}
from alpakka-kafka.
You can supervise a KafkaActorSubscriber
and prevent it from restarting using code like this:
https://github.com/softwaremill/reactive-kafka/blob/master/src/test/scala/examples/examples.scala#L40
It's not perfect and I'm hoping get this refined but I guess that it can should work for now.
from alpakka-kafka.
yes I just found the refactory here
#23
will close it for now.
from alpakka-kafka.
There's another way to handle subscriber errors:
val sinkDecider: Supervision.Decider = {
case _ => Supervision.Resume // Your error handling
}
Source(publisher)
.map(_.message().toUpperCase)
.to(Sink(subscriber).withAttributes(ActorAttributes.supervisionStrategy(sinkDecider)))
.run()
from alpakka-kafka.
@kciesielski once I realized that I could return the props ,I just attach it as a child actor and the override the supervison strategy.
but from the doc,said that:
ZipWith, FlexiMerge, FlexiRoute junction, ActorPublisher source and ActorSubscriber sink components do not honour the supervision strategy attribute yet.
will the solution you described here works?
from alpakka-kafka.
@hepin1989 Thanks for finding this :) Indeed, I wrote some tests and looks like this decider will never be called. So it looks like the only way to catch exceptions now is to use something similar to the method described in the ReactiveKafkaIntegrationSpec:"close producer, kill actor and log error when in trouble"
test.
I'll update the examples and documentation accordingly.
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.