Skip to content

Commit

Permalink
extracted DittoCasbahPersistenceExtension to ditto "owned" package
Browse files Browse the repository at this point in the history
* required as otherwise releases cannot work with the custom read-journal
* duplicated all private and package private required code
* adjusted usage of readJournal in configs

Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch-si.com>
  • Loading branch information
thjaeckle committed Dec 18, 2017
1 parent 66c93a9 commit 67db207
Show file tree
Hide file tree
Showing 14 changed files with 334 additions and 97 deletions.
4 changes: 2 additions & 2 deletions 3RD-PARTY-NOTICES
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,8 @@ Apache License
See the License for the specific language governing permissions and
limitations under the License.

2) DittoMongoPersistenceExtension.scala
Lines 14-47 Copyright Brian Scully https://github.com/scullxbones
2) DittoMongoPersistenceExtension.scala, DittoCasbahPersistenceExtension.scala, DittoCasbahPersistenceReadJournaller.scala, DittoMongoReadJournal.scala
Copyright Brian Scully https://github.com/scullxbones

Apache License
Version 2.0, January 2004
Expand Down
2 changes: 1 addition & 1 deletion services/policies/persistence/src/test/resources/test.conf
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ akka.cluster {
}

akka.contrib.persistence.mongodb.mongo {
driver = "akka.contrib.persistence.mongodb.DittoCasbahPersistenceExtension"
driver = "akka.contrib.persistence.mongodb.CasbahPersistenceExtension"
}

akka-contrib-mongodb-persistence-policies-journal {
Expand Down
6 changes: 3 additions & 3 deletions services/policies/starter/src/main/resources/policies.conf
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ akka {
}

akka.contrib.persistence.mongodb.mongo {
driver = "akka.contrib.persistence.mongodb.DittoCasbahPersistenceExtension"
driver = "akka.contrib.persistence.mongodb.CasbahPersistenceExtension"

# Write concerns are one of: ErrorsIgnored, Unacknowledged, Acknowledged, Journaled, ReplicaAcknowledged
journal-write-concern = "Acknowledged" # By default was: "Journaled"
Expand Down Expand Up @@ -253,10 +253,10 @@ akka-contrib-mongodb-persistence-policies-snapshots {
}
}

# journal & snapshot collections for akka.contrib.persistence.mongodb.DittoMongoReadJournal
# journal & snapshot collections for MongoReadJournal
ditto-akka-persistence-mongo-readjournal {
# Class name of the plugin.
class = "akka.contrib.persistence.mongodb.DittoMongoReadJournal"
class = "akka.contrib.persistence.mongodb.MongoReadJournal"

overrides {
journal-collection = "policies_journal"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
import org.eclipse.ditto.services.models.things.commands.sudo.SudoRetrieveModifiedThingTags;
import org.eclipse.ditto.services.models.things.commands.sudo.SudoRetrieveModifiedThingTagsResponse;
import org.eclipse.ditto.services.utils.akka.LogUtil;
import org.eclipse.ditto.services.utils.akkapersistence.mongoaddons.DittoJavaDslMongoReadJournal;
import org.eclipse.ditto.services.utils.akkapersistence.mongoaddons.DittoMongoReadJournal;

import akka.actor.AbstractActor;
import akka.actor.ActorRef;
import akka.actor.Props;
import akka.contrib.persistence.mongodb.DittoJavaDslMongoReadJournal;
import akka.contrib.persistence.mongodb.DittoMongoReadJournal;
import akka.event.DiagnosticLoggingAdapter;
import akka.japi.Creator;
import akka.japi.pf.ReceiveBuilder;
Expand Down
4 changes: 2 additions & 2 deletions services/things/persistence/src/test/resources/test.conf
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ akka.cluster {
}

akka.contrib.persistence.mongodb.mongo {
driver = "akka.contrib.persistence.mongodb.DittoCasbahPersistenceExtension"
driver = "org.eclipse.ditto.services.utils.akkapersistence.mongoaddons.DittoCasbahPersistenceExtension"
}
ditto-akka-persistence-mongo-readjournal {
# Class name of the plugin.
class = "akka.contrib.persistence.mongodb.DittoMongoReadJournal"
class = "org.eclipse.ditto.services.utils.akkapersistence.mongoaddons.DittoMongoReadJournal"
}

akka-contrib-mongodb-persistence-things-journal {
Expand Down
4 changes: 2 additions & 2 deletions services/things/starter/src/main/resources/things.conf
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ akka.contrib.persistence.mongodb.mongo {
#mongouri = "mongodb://"${?ditto.things.mongo.authentication}${ditto.things.mongo.hostname}":"${ditto.things.mongo.port}"/"${ditto.things.mongo.database}
#mongouri = ${?ditto.things.mongo.uri} # if this is set, take the explict set uri

driver = "akka.contrib.persistence.mongodb.DittoCasbahPersistenceExtension"
driver = "org.eclipse.ditto.services.utils.akkapersistence.mongoaddons.DittoCasbahPersistenceExtension"

# Write concerns are one of: ErrorsIgnored, Unacknowledged, Acknowledged, Journaled, ReplicaAcknowledged
journal-write-concern = "Acknowledged" # By default was: "Journaled"
Expand Down Expand Up @@ -265,7 +265,7 @@ akka-contrib-mongodb-persistence-things-snapshots {

ditto-akka-persistence-mongo-readjournal {
# Class name of the plugin.
class = "akka.contrib.persistence.mongodb.DittoMongoReadJournal"
class = "org.eclipse.ditto.services.utils.akkapersistence.mongoaddons.DittoMongoReadJournal"

overrides {
journal-collection = "things_journal"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ private <T extends Command> void catchDittoRuntimeException(final Consumer<T> co
try {
consumer.accept(command);
} catch (final InvalidFilterException | InvalidOptionException e) {
logger.warning("Error when creating Query from Command: {}", e.getMessage());
LogUtil.enhanceLogWithCorrelationId(logger, command);
logger.info("Error when creating Query from Command: {}", e.getMessage());
getSender().tell(e, getSelf());
}
}
Expand Down

This file was deleted.

Loading

0 comments on commit 67db207

Please sign in to comment.