Git Product home page Git Product logo

Comments (25)

danilo-ambrosio avatar danilo-ambrosio commented on August 25, 2024 7

@Florian122
The starter is now fixed in regard to Projection Actors generation. You won't need to regenerate your project. Just consider the following changes I pushed on a fork so you can do the same in your project:

  1. https://github.com/danilo-ambrosio/stocktrader/commit/24bad8e272f8c9206d1839ac5447221adfe21f2c#diff-8f52192feb6aed80cc914bbb53c225165ac2a7f37f60dc76e50fdc64589a64c4

  2. https://github.com/danilo-ambrosio/stocktrader/commit/24bad8e272f8c9206d1839ac5447221adfe21f2c#diff-cac2b978cb8063b0be98164f047a9c424709b5ed5688975b4f48927263514c94

  3. https://github.com/danilo-ambrosio/stocktrader/commit/24bad8e272f8c9206d1839ac5447221adfe21f2c#diff-478ac510c47bb310f49325c8a6110c2d6ccfb19d5b3476349a46dd4dac44c2d6

4.https://github.com/danilo-ambrosio/stocktrader/commit/24bad8e272f8c9206d1839ac5447221adfe21f2c#diff-bd4132c7fc3f7a8810aadeb14cc45b1ead54d0897a4ae5fe8679b62c4f36b7d9

5.https://github.com/danilo-ambrosio/stocktrader/commit/24bad8e272f8c9206d1839ac5447221adfe21f2c#diff-2642de3425bf156a95a7ba4a7465d099d0ba5533faaf1e577dd71471cbe25079

from xoom-designer.

danilo-ambrosio avatar danilo-ambrosio commented on August 25, 2024 3

Yes, the most recent versions do it, @VaughnVernon.

I'm going to debug the Portfolio app and see what's happening.

from xoom-designer.

Florian122 avatar Florian122 commented on August 25, 2024 3

Thank you very much, the GET request is working now!

from xoom-designer.

danilo-ambrosio avatar danilo-ambrosio commented on August 25, 2024 2

Hey @Florian122

Thanks for sharing the details. Today I'll take look at portfolio project and find out what's happening.

Let you know what I've got very soon.

from xoom-designer.

danilo-ambrosio avatar danilo-ambrosio commented on August 25, 2024 2

@Florian122

I've found an issue regarding the ProjectionActor generation. This is preventing the query model data from being stored.

I'm going to fix it. Keep you posted.

from xoom-designer.

VaughnVernon avatar VaughnVernon commented on August 25, 2024 2

@Florian122 Today @danilo-ambrosio and I discussed some significant simplifications of the projection generation. It should be ready very soon.

from xoom-designer.

fgr avatar fgr commented on August 25, 2024 2

@VaughnVernon and @danilo-ambrosio thanks for the fix. The team had on of those happy "fantastic, it works"-moments yesterday :-)

from xoom-designer.

VaughnVernon avatar VaughnVernon commented on August 25, 2024

@Florian122 Thanks. Does the table exist?

from xoom-designer.

Florian122 avatar Florian122 commented on August 25, 2024

No, we took a look in the database but there is no such table.
We tried to create the table by hand but it didn't work ether.

from xoom-designer.

VaughnVernon avatar VaughnVernon commented on August 25, 2024

@Florian122 Are other tables auto created? What are your expectations? In what ways are your attempts to create the table failing?

You must provide full context and any supporting information. For example, is this the command model or query model? This is certainly not all the context we need, but there is no way to act on the information currently provided.

from xoom-designer.

Florian122 avatar Florian122 commented on August 25, 2024

We created the tables with the migration script in the resource/db/migration folder. Is there a way to generate them automatically?
We expected a mechanism that creates all the necessary tables for us.
The error occurs when we call the /portfolio GET endpoint.
We are using the query model.
In general we created the project with the xoom-starter and used the implementations from the hello world example as template.

Thank you for the fast support! 👍

from xoom-designer.

VaughnVernon avatar VaughnVernon commented on August 25, 2024

@danilo-ambrosio Do you have any ideas on this? I don't know exactly how to interpret this, either as a bug or as user misunderstanding. Should the database table be created on first run?

from xoom-designer.

Florian122 avatar Florian122 commented on August 25, 2024

We have created the missing table in the database by hand with the following script:
(The Portfolio consists of an id and a string 'owner')

CREATE TABLE tbl_portfoliodata (
  id				VARCHAR(128)	PRIMARY KEY,
  owner				VARCHAR(256),
  s_type 			VARCHAR(256),
  s_type_version 		VARCHAR(256),
  s_data 			VARCHAR(256),
  s_data_version 		VARCHAR(256),
  s_metadata_value 		VARCHAR(256),
  s_metadata_value_version 	VARCHAR(256),
  s_metadata_op 		VARCHAR(256),
  s_id 				VARCHAR(256)
);

We got several error messages so we added the above listed 's_'-columns:
Is this script okay like this?

After a POST request the PortfolioCreated event gets saved in the vlingo_symbio_journal table but the tbl_portfoliodata table is still empty.
We have noticed that the merge method in the PortfolioDataProjector is never being called.

The query method (GET request) returns with an empty PortfolioData object.

We expected to have the current state written into the tbl_portfoliodata table.

@danilo-ambrosio

from xoom-designer.

VaughnVernon avatar VaughnVernon commented on August 25, 2024

Hi @danilo-ambrosio Where does this stand?

from xoom-designer.

danilo-ambrosio avatar danilo-ambrosio commented on August 25, 2024

@VaughnVernon
Perhaps we'll need to fix something on vlingo-symbio-jdbc . I noticed here is where the state store tables are created:

    for (final String storeName : StateTypeStateStoreMap.allStoreNames()) {
      final String tableName = tableNameFor(storeName);
      try {
        if (!tableExists(tableName)) {
          createStateStoreTable(tableName);
        }
      }
     ....

However, StateTypeStateStoreMap is never populated, so it's always empty. There is no occurrence of the StateTypeStateStoreMap.stateTypeToStoreName invocation which is responsible for adding each state type for the table creation.

Any thoughts?

from xoom-designer.

VaughnVernon avatar VaughnVernon commented on August 25, 2024

That should be part of the code generation.

from xoom-designer.

danilo-ambrosio avatar danilo-ambrosio commented on August 25, 2024

Oh, I see. Should it be invoked in the *StateStoreProvider classes?

from xoom-designer.

VaughnVernon avatar VaughnVernon commented on August 25, 2024

Seems correct. You could see where it is in schemata, but what you indicate sounds best.

from xoom-designer.

danilo-ambrosio avatar danilo-ambrosio commented on August 25, 2024

@Florian122

xoom-starter is now fixed and tested for full table creation.

As a shortcut, if you want xoom + symbio to take care of the table creation, check this small change I made on your portfolio project.

from xoom-designer.

Florian122 avatar Florian122 commented on August 25, 2024

The auto creation of the table is working now, thanks for the fix!
But.. the table tbl_portfoliodata is still empty after the post call. The get request returns with empty json.
I'm not sure if this was supposed to be fixed already.

Thank you for the help! 👍

from xoom-designer.

VaughnVernon avatar VaughnVernon commented on August 25, 2024

@Florian122 Are you projecting the events into the query StateStore?

from xoom-designer.

Florian122 avatar Florian122 commented on August 25, 2024

When the project was generated there was a class called PlaceholderDefined.
I assumed it is basically the PortfolioCreated event, so i just renamed it.
Furthermore I assumed that this code would call all necessary functions in the background to trigger the PortfolioCreated event:

Portfolio.defineWith(stage, "some name");

The event is persisted in the vlingo_symbio_journal table but when I try to get the Object with:

private final PortfolioQueries portfolioQueries;
portfolioQueries.portfolioOf(id);

..the returned object is empty.

from xoom-designer.

VaughnVernon avatar VaughnVernon commented on August 25, 2024

The PlaceholderDefined was generated by an earlier version of the Starter, and you were correct to rename it. IIRC you must editor the code named AggregatenameProjection, where Aggregatename is probably Portfolio. (I assume that is the name of the aggregate generated because you reference that name.) You will need to edit the PortfolioProjection class and map the data from PortfolioCreated into PortfolioData and upsert that into the query model database. Once that is done you can query from that database.

@danilo-ambrosio Does the latest version of Starter generate the code to map the events to data and upsert the data into the query model database?

from xoom-designer.

Florian122 avatar Florian122 commented on August 25, 2024

@danilo-ambrosio

Thank you for the effort!
Do you have any news regarding the issue?
We are looking forward to continue our work once everything is working.

from xoom-designer.

VaughnVernon avatar VaughnVernon commented on August 25, 2024

@Florian122 Thanks for your patience! We've had a lot of conflicting priorities the past month and a few on the team were dealing with personal things.

from xoom-designer.

Related Issues (20)

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.