Skip to content

Commit

Permalink
Outbox Improvements for Relation Database (BrighterCommand#3464)
Browse files Browse the repository at this point in the history
* Fixes MySQL queries for Dispatched Commands

* Fixes MySQL Outbox queries

* Fixes Postgres outbox

* Fix Sqlite outbox

* Fixes MsSQL outbox

* Fixes compilation issue

* Fixes MSSQL when convert the message id
  • Loading branch information
lillo42 authored Jan 15, 2025
1 parent d2b1921 commit cff67fd
Show file tree
Hide file tree
Showing 40 changed files with 2,331 additions and 333 deletions.
4 changes: 2 additions & 2 deletions samples/WebAPI/WebAPI_Common/DbMaker/SchemaCreation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -388,14 +388,14 @@ private static void CreateOutboxPostgres(string? connectionString, bool hasBinar
sqlConnection.Open();

using NpgsqlCommand existsQuery = sqlConnection.CreateCommand();
existsQuery.CommandText = PostgreSqlOutboxBulder.GetExistsQuery(OUTBOX_TABLE_NAME);
existsQuery.CommandText = PostgreSqlOutboxBuilder.GetExistsQuery(OUTBOX_TABLE_NAME);
object? findOutbox = existsQuery.ExecuteScalar();
bool exists = findOutbox is long and > 0;

if (exists) return;

using NpgsqlCommand command = sqlConnection.CreateCommand();
command.CommandText = PostgreSqlOutboxBulder.GetDDL(OUTBOX_TABLE_NAME, hasBinaryPayload);
command.CommandText = PostgreSqlOutboxBuilder.GetDDL(OUTBOX_TABLE_NAME, hasBinaryPayload);
command.ExecuteScalar();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public async Task<ReceivedResult<T>> TryReceiveAsync(string topic,
return ReceivedResult<T>.Empty;
var json = (string) reader[0];
var messageType = (string) reader[1];
var id = (int) reader[3];
var id = (long) reader[3];
var message = JsonSerializer.Deserialize<T>(json, JsonSerialisationOptions.Options);
return new ReceivedResult<T>(true, json, topic, messageType, id, message);
}
Expand Down
Loading

0 comments on commit cff67fd

Please sign in to comment.