Git Product home page Git Product logo

Comments (8)

VaughnVernon avatar VaughnVernon commented on June 13, 2024 1

@RoadRunner120485 Sorry, my fault. This has been fixed/implemented in the PostgresJournalActor.

git pull and build, or get the latest binaries from Bintray; these are considered snapshots.

from xoom-symbio.

VaughnVernon avatar VaughnVernon commented on June 13, 2024

The default adapter is working. See the following test that uses Entity2, which does not have a specific StateAdapter registered.

https://github.com/vlingo/vlingo-symbio/blob/e7795eba9baf75f8ac411a901c7c67ac0f180736/src/test/java/io/vlingo/symbio/store/state/inmemory/InMemoryStateStoreTest.java#L244

Also note that although the StateAdapter can now be defaulted (assuming that the state is of type TextState) you must still register the store name:

https://github.com/vlingo/vlingo-symbio/blob/e7795eba9baf75f8ac411a901c7c67ac0f180736/src/test/java/io/vlingo/symbio/store/state/inmemory/InMemoryStateStoreTest.java#L270

from xoom-symbio.

sturmm avatar sturmm commented on June 13, 2024

But that now works just with the InMemoryStateStore or does this work for other TextState based stores too?

from xoom-symbio.

VaughnVernon avatar VaughnVernon commented on June 13, 2024

It should work for all. Can you please try it and let me know your results?

from xoom-symbio.

sturmm avatar sturmm commented on June 13, 2024

I've tested it with the PostgresJournalActor and it does not work. If I skip registration of all Info types containing the Adapters the I'm getting a NPE from the lattice module:

vlingo/actors: DefaultSupervisorOverride: Failure of: Address[id=15, name=(none)]
vlingo/actors: java.lang.NullPointerException
	at io.vlingo.lattice.model.sourcing.Sourced.restore(Sourced.java:353)
	at io.vlingo.lattice.model.sourcing.Sourced.start(Sourced.java:78)
	at io.vlingo.actors.LifeCycle.lambda$sendStart$0(LifeCycle.java:110)
	at io.vlingo.actors.LocalMessage.internalDeliver(LocalMessage.java:116)
	at io.vlingo.actors.LocalMessage.deliver(LocalMessage.java:49)
	at io.vlingo.actors.plugin.mailbox.concurrentqueue.ConcurrentQueueMailbox.run(ConcurrentQueueMailbox.java:96)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

When I register an Info for my test aggregate without any Adapter I'm getting this Exception:

	at io.vlingo.lattice.model.sourcing.Sourced.lambda$appendAllResultedIn$3(Sourced.java:307)
	at io.vlingo.common.Failure.otherwise(Failure.java:45)
	at io.vlingo.lattice.model.sourcing.Sourced.appendAllResultedIn(Sourced.java:303)
	at io.vlingo.symbio.store.journal.JournalAppendResultInterest__Proxy.lambda$appendAllResultedIn$1(JournalAppendResultInterest__Proxy.java:40)
	at io.vlingo.actors.LocalMessage.internalDeliver(LocalMessage.java:116)
	at io.vlingo.actors.LocalMessage.deliver(LocalMessage.java:49)
	at io.vlingo.actors.ResumingMailbox.run(ResumingMailbox.java:19)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: io.vlingo.symbio.store.StorageException: Adapter not registrered for: de.test.TestCreated
	at io.vlingo.symbio.store.journal.jdbc.postgres.PostgresJournalActor.appendAllResultedInFailure(PostgresJournalActor.java:299)
	at io.vlingo.symbio.store.journal.jdbc.postgres.PostgresJournalActor.lambda$appendAllWith$5(PostgresJournalActor.java:128)
	at io.vlingo.symbio.store.journal.jdbc.postgres.PostgresJournalActor.asEntry(PostgresJournalActor.java:175)
	at io.vlingo.symbio.store.journal.jdbc.postgres.PostgresJournalActor.asEntries(PostgresJournalActor.java:163)
	at io.vlingo.symbio.store.journal.jdbc.postgres.PostgresJournalActor.appendAllWith(PostgresJournalActor.java:129)
	at io.vlingo.symbio.store.journal.Journal__Proxy.lambda$appendAllWith$2(Journal__Proxy.java:57)
	at io.vlingo.actors.LocalMessage.internalDeliver(LocalMessage.java:116)
	at io.vlingo.actors.LocalMessage.deliver(LocalMessage.java:49)
	at io.vlingo.actors.plugin.mailbox.concurrentqueue.ConcurrentQueueMailbox.run(ConcurrentQueueMailbox.java:96)
	... 3 more
Caused by: java.lang.IllegalStateException: Adapter not registrered for: de.test.TestCreated
	at io.vlingo.symbio.store.journal.jdbc.postgres.PostgresJournalActor.adapter(PostgresJournalActor.java:157)
	at io.vlingo.symbio.store.journal.jdbc.postgres.PostgresJournalActor.asEntry(PostgresJournalActor.java:171)
	... 9 more

I will add a StateStore version to my test but for a Journal it does seem work. But I assume that the changes you made are not intended to work with a Journal

from xoom-symbio.

sturmm avatar sturmm commented on June 13, 2024

@VaughnVernon it is working now. I just need to register an empty Info in the SourceTypeRegistry but then it works without providing any custom Adapter. I like the AdapterProviders as they allow to mix up custom and default adapter implementations.

from xoom-symbio.

VaughnVernon avatar VaughnVernon commented on June 13, 2024

@RoadRunner120485 Great, I am glad it works and that you like how it works! The SourceTypeRegistry is necessary to tell the Sourced entity which Journal it uses even if you don't register any adapters.

Is it ok to close this issue?

from xoom-symbio.

VaughnVernon avatar VaughnVernon commented on June 13, 2024

Closing as fixed.

from xoom-symbio.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.