prooph / event-store-http-api Goto Github PK
View Code? Open in Web Editor NEWProoph EventStore HTTP API
Home Page: http://getprooph.org/
License: BSD 3-Clause "New" or "Revised" License
Prooph EventStore HTTP API
Home Page: http://getprooph.org/
License: BSD 3-Clause "New" or "Revised" License
Hi,
I found the problem with $by_correlation_id in ES version 5, when using this library to append events through HTTP API (https://groups.google.com/forum/#!topic/event-store/1_e1yZfeWP0). The library sends json with escaped quotes in data and metadata, so the projection is not working.
Is it problem of the library or EventStore?
Thanks,
Jakub Koci
Actually, when using head
as start value for a stream you get a Fatal error:
Request: http://localhost:8080/streams/Prooph%5CModel%5CUser/head
Fatal:
TypeError: Argument 2 passed to Prooph\EventStore\Adapter\PDO\PDOStreamIterator::buildStatement() must be of the type integer, float given, called in /var/www/vendor/prooph/event-store-pdo-adapter/src/PDOStreamIterator.php on line 142 and defined in /var/www/vendor/prooph/event-store-pdo-adapter/src/PDOStreamIterator.php:196
head
only works together with direction backward
Request: http://localhost:8080/streams/Prooph%5CModel%5CUser/head/backward
So the service should return a 400 bad request with an appropriate message
Bas Kamer @basz Jan 19 23:36
Anyone worked with the event source JavaScript API Sounds like a really simple alternative to webstomp
Alexander Miertsch @codeliner Jan 20 11:07
@basz indeed! But I've only planed to use it. You need a backend that manages the event source clients. So far rabbit + webstomp was easier, but there is a SSE server available built on top of reactPHP. This combined with a projection would be a nice alternative compared to rabbit + webstomp
Bas Kamer @bweston92 z Jan 20 15:57
I would say its more efficiënt compared to our https://github.com/prooph/event-store-http-api package. But yes you would need something that makes sure a client only gets relevant events. Then you would be able to reconsitute the Same AR on the client. Http://bla.com/stream-of-AR-events/uuid ?
This works with a ‘php -S 0.0.0.0:8080’ https://github.com/html5rocks/www.html5rocks.com/tree/master/content/tutorials/eventsource/basics/static/demo
I like it
Bas Kamer @basz Jan 20 16:02
No extra Apache mods, didnt test with nigx but i think it should work. All browsers (edge with a polyfill)
You need a backend that manages the event source clients.
I'm interested to hear what would be needed to manage event sourced clients. http://bla.com/stream-of-AR-events/uuid
would work if the client already knows the uuid of the aggregate. Also I'm wondering if this repo would be the place to add such a feature...
This API should be 100% compatible with http://geteventstore.com/
This way we can use the event-store-ui also directly with the original event-store, without the need to wrap it around yet another http call.
I'd like to split the package. The API middlewares should be moved to a library package so that you can composer install them in your own PSR-7/PSR-15 driven application and mix them with auth middleware and so on.
This package can be turned into a skeleton that uses the lib and provides a ready-to-use expressive app as it is now.
The lib can be called event-store-http-middleware
or we integrate it in the http-middleware package.
Thoughts @prolic @sandrokeil @oqq @basz
We need a route GET /streams
to fetch all stream names using EventStore::fetchAllStreamNames().
This is required for the mgmt-ui to list all available streams.
We're working on new PHP based microservices in our current project and it points out that zend-strategility is enough for API-only microservices. zend-expressive is small, but already adds boilerplate that you don't need if you don't want to change the router implementation every 3 month or have to orchestrate a lot of middleware (which would result in the next monolith).
Here is an example of what we're doing: https://gist.github.com/codeliner/42b92174652af6c984170a8a1f9adb14
Only the public/index.php
and config/router.php
are different than prooph-do. config/autoload
+ zend-servicemanager set up are the same and also the Http-Action-Middlewares, except that they don't have the third parameter $next
in the signature because they are responsible for handling the http requests.
Thoughts?
How do we want to design the filter capabilities?
We can load
and loadReverse
with an optional MetadataMatcher
but how do we expose those filters in the http-api?
Two options:
?meta_1_field=_aggregate_id&meta_1_operator=eq&meta_1_value=abcd-efgt-ijklmnop&meta_2_field=_aggregate_version&meta_2_operator=gte&meta_2_value=10
We could also shorten the params so that meta_1_field
becomes m_1_f
for examle
And meta_<no>_operator
could be optional and default to eq
This would save a lot of characters because the length of an URI is somewhat limited.
POST
and send filters as JSON in the request body.A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.