Giter Club home page Giter Club logo

Comments (6)

enumag avatar enumag commented on May 25, 2024

To use the HTTP API you need https://github.com/prooph/event-store-http-client instead of this package.

from event-store-client.

bogdangrigore avatar bogdangrigore commented on May 25, 2024

@enumag Well that would explain why it does not seem to be working. Thank you for your answer!

from event-store-client.

prolic avatar prolic commented on May 25, 2024

@enumag that's a wrong answer

the projections manager works via http api only.

@bogdangrigore have a look at the unit tests, f.e. tests/when_creating_one_time_projection.php

from event-store-client.

enumag avatar enumag commented on May 25, 2024

Oh. Sorry then.

from event-store-client.

bogdangrigore avatar bogdangrigore commented on May 25, 2024

@prolic As far as I can tell the tests and my implementation are the same as the example in the unit tests.

`$userCredentials = new UserCredentials(getenv('EVENTSTORE_USER'), getenv('EVENTSTORE_PASSWORD'));`
`$httpEndpoint = new EndPoint(getenv('EVENTSTORE_HOST'), getenv('EVENTSTORE_HTTP_PORT'));`
`$connectionSettings = ConnectionSettings::create();`

$connectionSettings = $connectionSettings ->setDefaultUserCredentials($userCredentials) ->build();
$endpoint = new EndPoint(getenv('EVENTSTORE_HOST'), getenv('EVENTSTORE_TCP_PORT'));
$connection = EventStoreConnectionFactory::createFromEndPoint($endpoint, $connectionSettings);
yield $connection->connectAsync();

$projectionManager = new ProjectionsManager($httpEndpoint, 5000);
yield $projectionManager->enableAsync('$by_category', $userCredentials);

The ENV values I am using are :
EVENTSTORE_HOST="172.18.0.2"
EVENTSTORE_TCP_PORT="1113"
EVENTSTORE_HTTP_PORT="2133"
EVENTSTORE_USER="admin"
EVENTSTORE_PASSWORD="changeit"

If I try from the command line curl -X POST http://172.18.0.2:2113/projection/$by_category/command/enable -H "Content-Length: 0" -u admin:changeit I can connect to the server without a problem.

from event-store-client.

bogdangrigore avatar bogdangrigore commented on May 25, 2024

@prolic Never mind. I was using the wrong port in the ENV variables. Sorry.

from event-store-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.