Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Are Transactions supported? #4

Open
AlessandroMinoccheri opened this issue Dec 7, 2018 · 0 comments
Open

Are Transactions supported? #4

AlessandroMinoccheri opened this issue Dec 7, 2018 · 0 comments

Comments

@AlessandroMinoccheri
Copy link

Hi, are transaction supported? I have tried to make a simple transaction in php like this:

$data = [
            'id' => Uuid::uuid4()->toString(),
            'uuid' => $domainMessage->getId(),
            'playhead' => $domainMessage->getPlayhead(),
            'metadata' => json_encode($this->metadataSerializer->serialize($domainMessage->getMetadata())),
            'payload' => json_encode($this->payloadSerializer->serialize($domainMessage->getPayload())),
            'recorded_on' => $domainMessage->getRecordedOn()->toString(),
            'type' => $domainMessage->getType(),
        ];

        $marshal = new Marshaler();
        $data = $marshal->marshalJson(json_encode($data));

$this->client->transactWriteItems([
                'TransactItems' => [
                    [
                        'Put' => [
                            'TableName' => $this->table,
                            'Item' => $data
                        ]
                    ]
                ]
            ]
        );

It returns me this error:

GuzzleHttp\Exception\ClientException: Client error: `POST http://localhost:8000` resulted in a `400 Bad Request` response:
{"__type":"com.amazonaws.dynamodb.v20120810#UnknownOperationException","message":"An unknown operation was requested."}

If I make a simple putItem it works fine.

Let me know please
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant