eventsourced | building reliable , scalable and distributed event | Microservice library
kandi X-RAY | eventsourced Summary
kandi X-RAY | eventsourced Summary
The Eventsourced library adds scalable actor state persistence and at-least-once message delivery guarantees to [Akka] With Eventsourced, stateful actors. In other words, Eventsourced implements a write-ahead log (WAL) that is used to keep track of messages an actor receives and to recover its state by replaying logged messages. Appending messages to a log instead of persisting actor state directly allows for actor state persistence at very high transaction rates and supports efficient replication. In contrast to other WAL-based systems, Eventsourced usually keeps the whole message history in the log and makes usage of state snapshots optional. Logged messages represent intended changes to an actor’s state. Logging changes instead of updating current state is one of the core concept of [event sourcing] Eventsourced can be used to implement event sourcing concepts but it is not limited to that. More details about Eventsourced and its relation to event sourcing can be found at [How does Eventsourced persist actor state and how is this related to event sourcing] Eventsourced can also be used to make message exchanges between actors reliable so that they can be resumed after crashes, for example. For that purpose, channels with at-least-once message delivery guarantees are provided. Channels also prevent that output messages, sent by persistent actors, are redundantly delivered during replays which is relevant for message exchanges between these actors and other services.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of eventsourced
eventsourced Key Features
eventsourced Examples and Code Snippets
Community Discussions
Trending Discussions on eventsourced
QUESTION
I have been exploring Microservice Architecture, and even though the technologies I use are in Microsoft Domain, the question is generic.
I get the Idea of API Gateway esp for things like Authentication. The pattern I am roughly following is based on CQRS + Event Sourcing
Request-> Command ##CommandBus##->CommandHandler -> Change Aggregate State->Store Events-> PublishDomainEvents ->Publish Integration events ##Event Bus## -----> Update Read Models
Many times initial Command will be handled by ProcessManager (consumer) to Orchestrate workflow.
All Microservices Application Layer consume Command from Bus and work on changing Aggregate state. Once done, the Read model store is updated. Currently, there is only a single Read Database which is updated
When I started with Command Bus, The REST API per microservices were for mainly Get requests ( Read ), which would dip into the same Read Database as all other Services and rest for accepting Command from Gateway.
Based on my current Scenario, Is there a logic in having REST API's per Microservice? I know we can do Async with Rest API to push commands, but what is the point when I am already using a Bus.
But now I am thinking of not having API per Service but rather API's based on usage. It's then not limited to single Gateway but few Gateway API projects.
Are there any Cons/ pitfalls with this approach?
Edit 2-- **Trying to rephrase if it gives context ** My microservice structure is very similar (to what @mrdnk commented) . As you In I will introduce technology to make it more clear. I use Mass transit over RabbitMQ for inter service communication.
As of now I have API gateway used by client applications, which would then call appropriate microsservice API to push a command object. the API method itself acts as a Command Handler (acting as Application layer) calls Aggregate and make it undergo changes. Domain Events based on the change are published within the process with Mediatr. Any events that outside (microservice) world needs to know is published on the bus. I started to look at the communication and said to myself why not use the Bus also for commands (as command bus). That way I can have more reselient and async process.
Application layer will listen to command and handle appropriately. This way I feel the service is more encapsulated. On API side (individual microservce) I dont need to expose any rest api for use by gateway. API in Gateway wil listen to request and create command object. this will be queued to bus. Consumer (command handler) on Microservice will consume Command and so on.
Currently all Writes are eventsourced (mongodb). Reads go to SQL Server. I can create API just for Queries from Read side. No more need to have Http API from Microservice at all.
I know technically it would work but Dont know if there are any pitfalls.
Regards, Mar
...ANSWER
Answered 2020-Aug-19 at 07:13I think it is a good idea to have Microservices communicate with each other asynchronously and in practice I also use this appraoch with a mix of orchestration and choreography depending on the use cases.
Concerning the public API which you expose to your clients (e.g. web clients) over the internet it really depends on the determining factors and the options you are given. If your clients require REST based communication I would recommend to provide a fast response to the client synchronously by just providing the information that it went through Ok and some kind of unique id.
So if you think of an order request of an online shop the API gateway would forward the request to the order Microservice (either via REST or in your case via Messaging and some translation from asynchronous to synchronous response at the API gateway layer). Anyway, there should be some kind of immediate response to the client the order service can provide which could simply contain the id of the new order. Everything else for processing the order will than happen asynchronously either completely via an event-based choreography (started by an OrderRequestReceived event or whatever name fits the domain language) or via some kind of workflow orchestrated by the order service (but still with asynchronous messaging).
The client can then always use the order id to query the current state of the order which you will than provide based on the read model you are building.
If you are free to implement the client the way want you can also look into WebSockets, using HTTP/2 to allow for pushing of status changes rather than requiring the clients to poll for the current state. Or you could even look into gRPC...
QUESTION
Situation
I'm using Prooph for my commandbus, eventbus and eventstore within Symfony 4.3. Since not every aggregate needs to be eventsourced, we also use Doctrine DBAL to just simply CRUD those simple aggregates.
Within a given domain I have commands / handlers configured in my commandbus which use either eventsourced repositories OR DBAL repositories.
When injecting this commandbus into a CLI command this results in multiple db connections when running anything on the CLI.
Problem
When trying to delete/create the database (for pristine install or resetting the test environment) Postgres refuses because there is another active connection.
...ANSWER
Answered 2019-Oct-01 at 21:40The second argument on the constructor of the MySQLEventStore is the PDO connection, see https://github.com/prooph/pdo-event-store/blob/master/src/MySqlEventStore.php#L82. You can use the same PDO instance for Doctrine and EventStore, but it's kind of dangerous as you could interfere with its transaction handling. I would recommend closing the Doctrine connection in the tests before dropping the database instead.
QUESTION
I am trying to work with PersistentActor in Akka.
I tried the basic example provided in the Akka documentation at https://doc.akka.io/docs/akka/current/persistence.html.
I am getting the following error at the starting of the actor:
Caused by: java.lang.IllegalArgumentException: Default journal plugin is not configured, see 'reference.conf' at akka.persistence.Persistence$.verifyPluginConfigIsDefined(Persistence.scala:193) at akka.persistence.Persistence.defaultJournalPluginId$lzycompute(Persistence.scala:228) at akka.persistence.Persistence.defaultJournalPluginId(Persistence.scala:226) at akka.persistence.Persistence.journalConfigFor(Persistence.scala:336) at akka.persistence.Eventsourced.$init$(Eventsourced.scala:97) at akka.persistence.AbstractPersistentActor.(PersistentActor.scala:455) at org.spituk.learning.akka.samples.ExamplePersistentActor.(ExamplePersistentActor.java:72)
The code I tried is like:
...ANSWER
Answered 2019-Sep-19 at 11:16I had to add the following to the application.conf
file:
QUESTION
I'm trying to write log in Windows event viewer. I created class and create method for catching exceptions. Here is my code :
...ANSWER
Answered 2018-Dec-15 at 09:20I have done this in the past write to the event log Application
:
QUESTION
I'm using ODL-Carbon and trying to get a simple REST:
http://ip-controller:8181/restconf/config/network-topology:network-topology/topology/ovsdb:1/
but I get this error message:
...ANSWER
Answered 2017-Dec-04 at 12:40I've never seen this "it's not initialized yet. Please try again later" NotInitializedException, but it seems to indicate that the Data Store is not ready.. either you just need to wait a bit, or it perhaps there was serious error during start up. Have you checked if your karaf.log has any errors that could explain why?
QUESTION
i am using SBT to setup Akka Persistence but it's failing with Error :
...ANSWER
Answered 2017-Nov-08 at 11:52Use the current version (0.5) of akka-management-cluster-http
:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install eventsourced
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page