Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In-Memory storage support #296

Closed
yang-xiaodong opened this issue Mar 12, 2019 · 19 comments

Comments

@yang-xiaodong
Copy link
Member

commented Mar 12, 2019

After feedback from our users, we decided to join the memory storage feature of the event.

Memory storage is mainly used in the following scenarios :

  • Low data consistency requirements, acceptable for data loss
  • Test projects or get started quickly

Disadvantages :

  • No support for transactions
yang-xiaodong added a commit that referenced this issue Mar 12, 2019

@yang-xiaodong yang-xiaodong added the fixed label Mar 13, 2019

@wu-yafeng

This comment has been minimized.

Copy link
Contributor

commented Mar 22, 2019

Is it support In-Memory message queue?

@yang-xiaodong

This comment has been minimized.

Copy link
Member Author

commented Mar 22, 2019

@1015450578 No, Why do you need this feature?

@wu-yafeng

This comment has been minimized.

Copy link
Contributor

commented Mar 22, 2019

@1015450578 No, Why do you need this feature?

In my integration-test,I use EntityFrameworkCore In-Memory provider.

Now,CAP has In-Memory Database ,I can run my integration test without any Real-Database,but it seems need Real-Message-Queue?

@yang-xiaodong

This comment has been minimized.

Copy link
Member Author

commented Mar 22, 2019

Hello @1015450578 ,

I have created an in-memory message queue project for CAP in my own repository, which is only for development and test scenarios, not production.

https://github.com/yang-xiaodong/Savorboard.CAP.InMemoryMessageQueue

Hope it helpful for you!

@wu-yafeng

This comment has been minimized.

Copy link
Contributor

commented Mar 22, 2019

Excellent!May publish to NuGet or any MyGet server address ?

@bao2314483

This comment has been minimized.

Copy link

commented Mar 27, 2019

作者什么时候修复这个问题,我测试单元的时候也出现这个错误

@yang-xiaodong

This comment has been minimized.

Copy link
Member Author

commented Mar 27, 2019

@1015450578

Excellent!May publish to NuGet or any MyGet server address ?

https://www.nuget.org/packages/Savorboard.CAP.InMemoryMessageQueue

@canertosuner

This comment has been minimized.

Copy link

commented Mar 28, 2019

Do you think to develop a such feature; publish message to queue even if the db connection is broken ? I mean publishing a message to queue is depented to database, if the database conn is broken publishing message to queue independently would be greate. (managing it a property in AddCap() method)

@yang-xiaodong

This comment has been minimized.

Copy link
Member Author

commented Mar 28, 2019

@canertosuner This feature I think should be considered, we should generate an exception as soon as possible when the database connection is lost, instead of letting it continue to work. This may lead to the loss of important messages, and the consistency of data is also one of the characteristics of CAP.

@yang-xiaodong

This comment has been minimized.

Copy link
Member Author

commented Mar 30, 2019

Supported in v2.5.0

@bao2314483

This comment has been minimized.

Copy link

commented Apr 2, 2019

请问2.5.0版本哪里有支持内存demo,我发现EF改用内存数据库会报错,我已经升级了2.5.0版本了

@yang-xiaodong

This comment has been minimized.

@wu-yafeng

This comment has been minimized.

Copy link
Contributor

commented Apr 2, 2019

请问2.5.0版本哪里有支持内存demo,我发现EF改用内存数据库会报错,我已经升级了2.5.0版本了

translate from google

I would like to ask where the 2.5.0 version has support for memory demo, I found that EF will use the memory database to report an error, I have upgraded the 2.5.0 version.

hope it helpful for other people

@bao2314483

This comment has been minimized.

Copy link

commented Apr 2, 2019

为什么不直接支持EF内存数据库内?,一定要在x.UseInMemoryStorage();这一种方式吗?
services.AddDbContextPool<ChyContext>(options => { options.UseInMemoryDatabase("test"); });
`
services.AddCap(x =>
{

            x.UseEntityFramework<ChyContext>();
            x.UseRabbitMQ(k => {
              .....省略
            });
        });`

我还有一个疑问就是x.UseInMemoryStorage();和 x.UseEntityFramework();同时存在,最终cap是采用EF配置还是内存数据配置

@wu-yafeng

This comment has been minimized.

Copy link
Contributor

commented Apr 2, 2019

为什么不直接支持EF内存数据库内?,一定要在x.UseInMemoryStorage();这一种方式吗?
services.AddDbContextPool<ChyContext>(options => { options.UseInMemoryDatabase("test"); });
`
services.AddCap(x =>
{

            x.UseEntityFramework<ChyContext>();
            x.UseRabbitMQ(k => {
              .....省略
            });
        });`

我还有一个疑问就是x.UseInMemoryStorage();和 x.UseEntityFramework();同时存在,最终cap是采用EF配置还是内存数据配置

When use x.UseEntityFramework(),CAP will create a EntityFramework Core DbContext and get connectionString from DbContext,CAP doesn't using EFCore to access database.

@bao2314483

This comment has been minimized.

Copy link

commented Apr 2, 2019

明白,一直以为x.UseEntityFramework();这个是用EF连接池来操作,原来这是取连接字符串而已

@bao2314483

This comment has been minimized.

Copy link

commented Apr 2, 2019

我在操作过程中,发现使用内存数据库创建事务会报错

@yang-xiaodong

This comment has been minimized.

Copy link
Member Author

commented Apr 2, 2019

@bao2314483 This is expected. Please describe your question in English. Thanks

@bao2314483

This comment has been minimized.

Copy link

commented Apr 2, 2019

During my operation, I found that creating transactions using an in-memory database would cause errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.