{"id":15101977,"url":"https://github.com/ademcatamak/messagestorage","last_synced_at":"2025-09-27T00:30:44.500Z","repository":{"id":42045434,"uuid":"231973852","full_name":"AdemCatamak/MessageStorage","owner":"AdemCatamak","description":"Message and Job Storage with Outbox Design Pattern","archived":true,"fork":false,"pushed_at":"2022-12-11T22:39:28.000Z","size":430,"stargazers_count":20,"open_issues_count":4,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-09-25T18:43:57.615Z","etag":null,"topics":["fire-and-forget","masstransit","nuget","nuget-package","outbox","outbox-pattern","postgres","postgresql","sql-server","sql-server-database","transactional-outbox","transactional-outbox-pattern"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AdemCatamak.png","metadata":{"files":{"readme":"ReadMe.md","changelog":null,"contributing":null,"funding":null,"license":"License","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-05T20:47:19.000Z","updated_at":"2024-04-08T20:05:28.000Z","dependencies_parsed_at":"2023-01-27T08:30:51.869Z","dependency_job_id":null,"html_url":"https://github.com/AdemCatamak/MessageStorage","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdemCatamak%2FMessageStorage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdemCatamak%2FMessageStorage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdemCatamak%2FMessageStorage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdemCatamak%2FMessageStorage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AdemCatamak","download_url":"https://codeload.github.com/AdemCatamak/MessageStorage/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219871828,"owners_count":16554457,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fire-and-forget","masstransit","nuget","nuget-package","outbox","outbox-pattern","postgres","postgresql","sql-server","sql-server-database","transactional-outbox","transactional-outbox-pattern"],"created_at":"2024-09-25T18:44:19.053Z","updated_at":"2025-09-27T00:30:44.089Z","avatar_url":"https://github.com/AdemCatamak.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Message Storage\n\nMessageStorage is a library prepared to be used in projects that want to apply the **Outbox** design pattern.\n\n| Platform | Status |\n| ------- | ----- |\n| `Travis` | ![Travis](https://travis-ci.com/AdemCatamak/MessageStorage.svg?branch=master) |\n| `GitHub` | ![.github/workflows/github.yml](https://github.com/AdemCatamak/MessageStorage/workflows/.github/workflows/github.yml/badge.svg?branch=master) |\n\n\n| NuGet Package Name | Version |\n| ------- | ----- |\n| MessageStorage.SqlServer | ![Nuget](https://img.shields.io/nuget/v/MessageStorage.SqlServer.svg) |\n| MessageStorage.Postgres | ![Nuget](https://img.shields.io/nuget/v/MessageStorage.Postgres.svg) |\n| MessageStorage.Integration.MassTransit | ![Nuget](https://img.shields.io/nuget/v/MessageStorage.Integration.MassTransit.svg) |\n\n## Structure Overview\n\n\u003cimg src=\"./Doc/MessageStorage.drawio.png\" alt=\"message-storage structure overview\"\u003e\n\n## Getting Started\n\nYou can download the _MessageStorage.SqlServer_ or _MessageStorage.Postgres_ package\naccording to the storage environment you will use.\n\n`UseSqlServer` / `UsePostgres` method lets you introduce SqlServer or Postgres is used for system's data storage.\n\n`RegisterHandler` / `RegisterHandlers` method lets you introduce MessageHandlers that is used. When the message is recorded, the tasks that will be\nexecuted in the background will be introduced through these classes.\n\n### Sample Startup\n\n ```\n services.AddMessageStorage(configurator =\u003e\n {\n    configurator.UseSqlServer(\"SqlServerConnectionString\");\n    configurator.RegisterHandlers(messageHandlerAssemblies);\n })\n ```\n\nAfter these steps, you can use the object that is an implementation of `IMessageStorageClient` interface.\n\n### Sample Service\n\nExample of registering SomeEntity and saving SomeEntityCreatedEvent message in the same transaction.\n\n```\nusing (IDbConnection connection = _connectionFactory.CreateConnection())\n{\n    using IDbTransaction dbTransaction = connection.BeginTransaction(IsolationLevel.ReadCommitted);\n    using IMessageStorageTransaction transaction = _messageStorageClient.UseTransaction(dbTransaction);\n    \n    await connection.ExecuteAsync( sqlCommandText, sqlCommandParameters, dbTransaction);\n\n    SomeEntityCreated someEntityCreated = new (someEntity.Id, someEntity.SomeProperty, someEntity.CreatedOn); \n    await _messageStorageClient.AddMessageAsync(someEntityCreated);\n\n    transaction.CommitAsync(cancellationToken);\n}\n```\n\nAfter `transaction.CommitAsync`, created job will be dispatched and executed","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fademcatamak%2Fmessagestorage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fademcatamak%2Fmessagestorage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fademcatamak%2Fmessagestorage/lists"}