Comments (4)
Hi @SeanKilleen,
could you post your exact HOCON configuration - without the connection strings, if they're sensitive?
from akka.persistence.postgresql.
@Aaronontheweb sure thing, it's below -- sorry, should have done that up front. The conn strings aren't sensitive at all, so no worries:
<akka>
<hocon>
<![CDATA[
akka {
loglevel=INFO,
loggers=["Akka.Logger.Serilog.SerilogLogger, Akka.Logger.Serilog"]
}
akka.persistence{
journal {
plugin = "akka.persistence.journal.postgresql"
postgresql {
# qualified type name of the PostgreSql persistence journal actor
class = "Akka.Persistence.PostgreSql.Journal.PostgreSqlJournal, Akka.Persistence.PostgreSql"
# dispatcher used to drive journal actor
plugin-dispatcher = "akka.actor.default-dispatcher"
# connection string used for database access
connection-string = "Server=localhost;Port=5432;User Id=admin;Password=example;Database=portfolioss;"
# default SQL commands timeout
connection-timeout = 30s
# PostgreSql schema name to table corresponding with persistent journal
schema-name = public
# PostgreSql table corresponding with persistent journal
table-name = event_journal
# should corresponding journal table be initialized automatically
auto-initialize = off
# timestamp provider used for generation of journal entries timestamps
timestamp-provider = "Akka.Persistence.Sql.Common.Journal.DefaultTimestampProvider, Akka.Persistence.Sql.Common"
# metadata table
metadata-table-name = metadata
# defines column db type used to store payload. Available option: BYTEA (default), JSON, JSONB
stored-as = BYTEA
}
}
snapshot-store {
plugin = "akka.persistence.snapshot-store.postgresql"
postgresql {
# qualified type name of the PostgreSql persistence journal actor
class = "Akka.Persistence.PostgreSql.Snapshot.PostgreSqlSnapshotStore, Akka.Persistence.PostgreSql"
# dispatcher used to drive journal actor
plugin-dispatcher = ""akka.actor.default-dispatcher""
# connection string used for database access
connection-string = "Server=localhost;Port=5432;User Id=admin;Password=example;Database=portfolioss;"
# default SQL commands timeout
connection-timeout = 30s
# PostgreSql schema name to table corresponding with persistent journal
schema-name = public
# PostgreSql table corresponding with persistent journal
table-name = snapshot_store
# should corresponding journal table be initialized automatically
auto-initialize = on
# defines column db type used to store payload. Available option: BYTEA (default), JSON, JSONB
stored-as = BYTEA
}
}
}
]]>
</hocon>
</akka>
from akka.persistence.postgresql.
More code for reference --
The code to init the actor, running inside of a quick console app:
var rando = actorSystem.ActorOf(Props.Create<MyActor>(), "rando-actor");
rando.Tell("Message1");
rando.Tell("message2");
And the actor code, which I think is straight out of the example:
public class MyActor : ReceivePersistentActor
{
public class GetMessages { }
private List<string> _msgs = new List<string>(); //INTERNAL STATE
public override string PersistenceId
{
get
{
return "HardCoded";
}
}
public MyActor()
{
// recover
Recover<string>(str => _msgs.Add(str));
// commands
Command<string>(str => Persist(str, s =>
{
_msgs.Add(str); //add msg to in-memory event store after persisting
}));
Command<GetMessages>(get => Sender.Tell(new List<string>(_msgs)));
}
}
}
from akka.persistence.postgresql.
Didn't realize postrges was spitting out helpful errors in the console.
It looks like there's a query attempting to hit a payload
column in the snapshot table.
portfolioss-db | 2018-02-23 14:39:50.902 UTC [115] ERROR: column "payload" does not exist at character 159
portfolioss-db | 2018-02-23 14:39:50.902 UTC [115] STATEMENT:
portfolioss-db | SELECT persistence_id,
portfolioss-db | sequence_nr,
portfolioss-db | created_at,
portfolioss-db | manifest,
portfolioss-db | payload,
portfolioss-db | serializer_id
portfolioss-db | FROM public.snapshot_store
portfolioss-db | WHERE persistence_id = $1
portfolioss-db | AND sequence_nr <= $2
portfolioss-db | AND created_at <= $3
portfolioss-db | ORDER BY sequence_nr DESC
This column is not included in the SQL setup in the docs.
So it seems either:
- There's a bug in the code looking for that column in that table
- There's a missing line in the
README
creation docs - There's a missing step in the
README
migration docs.
Running an ALTER
and adding the column appears to get it to work correctly..
@Aaronontheweb when you determine which of the above is the issue, let me know and I'll try to do a quick PR to address.
from akka.persistence.postgresql.
Related Issues (20)
- Broken license link in NuGet Package HOT 1
- [Regression] Updating Npgsql to 6.0.1 broke netcoreapp3.1 support for Entity Framework
- Recovery can return items out of order
- [PERF] Use DbBatch to increase PersistAll performance
- [BUG] Akka.Persistence.PostgreSql does not support `writerUUID` field
- Snapshot deletion: null value in column "is_deleted" of relation "snapshot_store" violates not-null constraint HOT 1
- Implement DbDataSource HOT 1
- jsonb serialization snapshot manifest instead of qualified name uses manifest of SerializerWithStringManifest
- Please indicate that this project is scheduled for deprecation in Akka.Net 1.16 HOT 3
- Support the driver returning JObject instead of string for Jsonb HOT 1
- Used table format leaks to SnapshotOffer HOT 3
- Intermittently, only latest journal entry is sent to actor as SnapshotOffer HOT 8
- Move to IDENTITY column for ordering? HOT 4
- Akka 1.4 support HOT 1
- Migrate PostgreSql tests to Docker.NET
- Implement modern Akka.Persistence.Query for Postgres HOT 1
- Snapshots - Deserialize Serialization.WithTransport missing?
- Identical tests? HOT 1
- Setting SerializerId twice HOT 2
- Snapshots Deserialize to JObject and then ignored HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from akka.persistence.postgresql.