Skip to content

Commit

Permalink
fix IllegalArgumentException during initialization of root actors
Browse files Browse the repository at this point in the history
Error message:
java.lang.IllegalArgumentException: no matching constructor found on class
org.eclipse.ditto.services.utils.persistence.mongo.DefaultPersistenceStreamingActor
for arguments
[class org.eclipse.ditto.services.utils.persistence.mongo.DefaultPersistenceStreamingActor$1]

Signed-off-by: Cai Yufei <Yufei.Cai@bosch-si.com>
  • Loading branch information
yufei-cai committed Dec 19, 2017
1 parent 7b7fb97 commit 4ffb50d
Showing 1 changed file with 4 additions and 10 deletions.
Expand Up @@ -27,7 +27,8 @@
public final class DefaultPersistenceStreamingActor<T extends EntityIdWithRevision>
extends AbstractPersistenceStreamingActor<T> {

private DefaultPersistenceStreamingActor(final int streamingCacheSize, final Function<PidWithSeqNr, T> entityMapper) {
private DefaultPersistenceStreamingActor(final int streamingCacheSize,
final Function<PidWithSeqNr, T> entityMapper) {
this(streamingCacheSize, entityMapper, null);
}

Expand All @@ -42,20 +43,13 @@ private DefaultPersistenceStreamingActor(final int streamingCacheSize,
* @param streamingCacheSize the size of the streaming cache.
* @param entityMapper the mapper used to map {@link PidWithSeqNr} to {@code T}. The resulting entity will be
* streamed to the recipient actor.
*
* @return the Akka configuration Props object.
*/
public static <T extends EntityIdWithRevision> Props props(final int streamingCacheSize,
final Function<PidWithSeqNr, T> entityMapper) {

return Props.create(DefaultPersistenceStreamingActor.class, new Creator<DefaultPersistenceStreamingActor<T>>() {
private static final long serialVersionUID = 1L;

@Override
public DefaultPersistenceStreamingActor<T> create() {
return new DefaultPersistenceStreamingActor<>(streamingCacheSize, entityMapper);
}
});
return Props.create(DefaultPersistenceStreamingActor.class,
() -> new DefaultPersistenceStreamingActor<>(streamingCacheSize, entityMapper));
}

static <T extends EntityIdWithRevision> Props props(final int streamingCacheSize,
Expand Down

0 comments on commit 4ffb50d

Please sign in to comment.