Comments (11)
It's not so easy. The thing is there are two uuid formats out there using different byte order. EventStore is internally using the less common one - usually referred to as guid (thank microsoft) while the libraries you mentioned are all using the common uuid byte order. We used ramsey/uuid because it does support the guid format. The only issue is that they accidentally broke this feature in v4. So you can't simply replace it with any other random uuid library since most don't support guids. It would be best to fix it in ramsey/uuid. We'll be happy to allow v4 when it's fixed.
https://stackoverflow.com/questions/48659919/convert-a-uuid-into-a-guid-and-vice-versa
from event-store-client.
from event-store-client.
I am running this code now from the examples, and still get the same error:
public function test()
{
Loop::run(function () {
$settings = ConnectionSettings::create()
->setClusterDns('0.0.0.0')
->setClusterGossipPort(2113)
->build();
$connection = EventStoreConnectionFactory::createFromSettings(
$settings,
'dns-cluster-connection'
);
$connection->onConnected(function (): void {
echo 'connected' . PHP_EOL;
});
$connection->onClosed(function (): void {
echo 'connection closed' . PHP_EOL;
});
yield $connection->connectAsync();
$slice = yield $connection->readStreamEventsForwardAsync(
'foo-bar',
10,
2,
true
);
\var_dump($slice);
$slice = yield $connection->readStreamEventsBackwardAsync(
'foo-bar',
10,
2,
true
);
\var_dump($slice);
$event = yield $connection->readEventAsync('foo-bar', 2, true);
\var_dump($event);
$m = yield $connection->getStreamMetadataAsync('foo-bar');
\var_dump($m);
$r = yield $connection->setStreamMetadataAsync('foo-bar', ExpectedVersion::ANY, new StreamMetadata(
null, null, null, null, null, [
'foo' => 'bar',
]
));
\var_dump($r);
$m = yield $connection->getStreamMetadataAsync('foo-bar');
\var_dump($m);
$wr = yield $connection->appendToStreamAsync('foo-bar', ExpectedVersion::ANY, [
new EventData(EventId::generate(), 'test-type', false, 'jfkhksdfhsds', 'meta'),
new EventData(EventId::generate(), 'test-type2', false, 'kldjfls', 'meta'),
new EventData(EventId::generate(), 'test-type3', false, 'aaa', 'meta'),
new EventData(EventId::generate(), 'test-type4', false, 'bbb', 'meta'),
]);
\var_dump($wr);
$ae = yield $connection->readAllEventsForwardAsync(Position::start(), 2, false, new UserCredentials(
'admin',
'changeit'
));
\var_dump($ae);
$aeb = yield $connection->readAllEventsBackwardAsync(Position::end(), 2, false, new UserCredentials(
'admin',
'changeit'
));
\var_dump($aeb);
$connection->close();
});
}
What's wrong with my code and configuration, I have tried it with different configurations and none of them seems working for me.
from event-store-client.
from event-store-client.
Now I get this error:
Ramsey\Uuid\Exception\UnableToBuildUuidException
The byte string received does not contain a valid version
I have to mention that I have forked your repository and used version ^4.2.0
for the ramsey/uuid
package. Seems this is the reason you do not update that package! I think I have to fork that package too!
from event-store-client.
from event-store-client.
Ramsey v3 is not compatible with Laravel 8. I would be happy if those two were compatible and that's why I forked the project to be able to install the package.
from event-store-client.
Well I told you clearly that ramsey v4 is bugged. The error you see is exactly the problem why we can't use it. We didn't disallow it on a whim. 🙂
from event-store-client.
I know (and thanks), but I needed to make it work with Laravel 8 and it seemed the only way at that time. Any plan to replace the ramsey/uuid
package with another uuid package? This seems the only way left to make this package compatible with the Laravel 8.
from event-store-client.
I'm leaning towards "no" but if you have a specific package in mind, we can have a look.
from event-store-client.
Well there are many packages, but I don't know if they are able to be replaced with it.
For example this one: https://laravel.com/docs/8.x/helpers#method-str-uuid
or this one: https://github.com/webpatser/laravel-uuid
And I have used this one already in some projects: https://github.com/binarycabin/laravel-uuid/blob/b78fe0226a767c5ef3ef077ed521c4f4f30a1e10/src/Traits/HasUUID.php#L26
Maybe if you give me a clue on where to start, I will be able to make a pull request for changing it!
from event-store-client.
Related Issues (20)
- Unclear message when trying to communicate through closed connection
- Support EventStore v6 HOT 3
- Support UUID1 / UUID5, ... HOT 3
- RC not compatible with any release of "prooph/event-sourcing" HOT 1
- Add psalm HOT 1
- [RFC] Adding PHPdoc to generate API docs HOT 2
- Issue with simple examples and event store 5 HOT 1
- Travis failed (ramsey uuid 4) HOT 9
- [RFC] Removing "type" from projections management HOT 1
- Change constructors for http communications HOT 3
- EventStorePersistentSubscription is in namespace internal but required to be used HOT 1
- Connection process cannot be "waited" HOT 7
- MemberInfoDto timeStamp is a string, not int as the code suggests for a v5 cluster HOT 2
- Event Store is now secure by default HOT 5
- subscribetoAllAsync fails with BadRequest HOT 4
- Trying the example with server version 20.10.0.0, but can't connect HOT 2
- Segmentation fault HOT 3
- Incompatibility with Laravel 8 HOT 1
- performOnMasterOnly property doesn't seem to work HOT 4
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 event-store-client.