Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Monorepo\ExampleAppEventSourcing\Common\Event\ProductWasRegistered;
use Monorepo\ExampleAppEventSourcing\Common\PriceChange;

#[\Ecotone\Projecting\Attribute\Projection("price_change_over_time", null)]
#[\Ecotone\Projecting\Attribute\ProjectionV2("price_change_over_time")]
class PriceChangeOverTimeProjectionWithEcotoneProjection
{
public const NAME = "price_change_over_time";
Expand Down
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ services:
POSTGRES_USER: "ecotone"
POSTGRES_PASSWORD: "secret"
ports:
- "5432:5432"
- "${POSTGRES_PORT:-5432}:5432"
database-mysql:
image: mysql:8.0
environment:
Expand All @@ -64,7 +64,7 @@ services:
MYSQL_PASSWORD: "secret"
MYSQL_DATABASE: "ecotone"
ports:
- "3306:3306"
- "${MYSQL_PORT:-3306}:3306"
rabbitmq:
build: ./.docker/rabbitmq
environment:
Expand All @@ -84,7 +84,7 @@ services:
redis:
image: redis:7-alpine
ports:
- '6379:6379'
- '${REDIS_PORT:-6379}:6379'
collector:
image: otel/opentelemetry-collector-contrib:0.73.0
networks:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function process(Message $message): ?Message
if (count($routes) === 0) {
return null;
} elseif (count($routes) > 1) {
throw new InvalidArgumentException('Expected only one route to be selected, but got more');
throw new InvalidArgumentException('Expected only one endpoint to route, but got more. Please verify your Message Handlers for possible duplication.');
}
$path = $this->routeResolver->resolve($routes[0]);
return $path->process($message);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
*/
/**
* licence Apache-2.0
* @TODO Ecotone 2.0 Think about testing delayed messages based on Clock and Sleep
*/
interface SleepInterface
{
Expand Down

This file was deleted.

25 changes: 25 additions & 0 deletions packages/Ecotone/src/Projecting/Attribute/Partitioned.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

/*
* licence Enterprise
*/
declare(strict_types=1);

namespace Ecotone\Projecting\Attribute;

use Attribute;
use Ecotone\Messaging\MessageHeaders;

/*
* Allows configuring a custom partition header name for partitioned projections.
* For Aggregate scope, use MessageHeaders::EVENT_AGGREGATE_ID.
*/
#[Attribute(Attribute::TARGET_CLASS)]
class Partitioned
{
public function __construct(
public readonly string $partitionHeaderName = MessageHeaders::EVENT_AGGREGATE_ID,
) {
}
}

25 changes: 25 additions & 0 deletions packages/Ecotone/src/Projecting/Attribute/Polling.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

/*
* licence Enterprise
*/
declare(strict_types=1);

namespace Ecotone\Projecting\Attribute;

use Attribute;

/**
* Marks a projection as polling-based.
* When combined with ProjectionV2, the projection will be triggered by polling instead of event-driven.
* The endpointId is used to identify the polling endpoint.
*/
#[Attribute(Attribute::TARGET_CLASS)]
class Polling
{
public function __construct(
public readonly string $endpointId,
) {
}
}

47 changes: 0 additions & 47 deletions packages/Ecotone/src/Projecting/Attribute/PollingProjection.php

This file was deleted.

43 changes: 0 additions & 43 deletions packages/Ecotone/src/Projecting/Attribute/Projection.php

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

/*
* licence Enterprise
*/
declare(strict_types=1);

namespace Ecotone\Projecting\Attribute;

use Attribute;

/**
* This attribute allows configure additional projection configuration.
*/
#[Attribute(Attribute::TARGET_CLASS)]
class ProjectionConfiguration
{
public function __construct(
public readonly bool $automaticInitialization = true,
) {
}
}

25 changes: 25 additions & 0 deletions packages/Ecotone/src/Projecting/Attribute/ProjectionV2.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

/*
* licence Enterprise
*/
declare(strict_types=1);

namespace Ecotone\Projecting\Attribute;

use Attribute;
use Ecotone\Messaging\Attribute\StreamBasedSource;

#[Attribute(Attribute::TARGET_CLASS)]
class ProjectionV2 extends StreamBasedSource
{
public function __construct(
public readonly string $name,
) {
}

public function getName(): string
{
return $this->name;
}
}
25 changes: 25 additions & 0 deletions packages/Ecotone/src/Projecting/Attribute/Streaming.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

/*
* licence Enterprise
*/
declare(strict_types=1);

namespace Ecotone\Projecting\Attribute;

use Attribute;

/**
* Marks a projection as event-streaming based.
* Event streaming projections consume events directly from streaming channels.
* This attribute should be combined with #[ProjectionV2] attribute.
*/
#[Attribute(Attribute::TARGET_CLASS)]
class Streaming
{
public function __construct(
public readonly string $channelName,
) {
}
}

Loading