Skip to content

Commit

Permalink
Release 1.219.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dgafka authored and github-actions[bot] committed Apr 15, 2024
1 parent 0d94abe commit bf199ec
Show file tree
Hide file tree
Showing 39 changed files with 82 additions and 95 deletions.
4 changes: 2 additions & 2 deletions packages/Amqp/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
},
"require": {
"ext-amqp": "*",
"ecotone/enqueue": "~1.218.0",
"ecotone/enqueue": "~1.219.0",
"enqueue/amqp-ext": "^0.10.18",
"enqueue/dsn": "^0.10.4",
"enqueue/enqueue": "^0.10.0"
Expand All @@ -63,7 +63,7 @@
},
"extra": {
"branch-alias": {
"dev-main": "1.218.0-dev"
"dev-main": "1.219.0-dev"
},
"ecotone": {
"repository": "amqp"
Expand Down
6 changes: 3 additions & 3 deletions packages/Dbal/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
}
},
"require": {
"ecotone/enqueue": "~1.218.0",
"ecotone/enqueue": "~1.219.0",
"enqueue/dbal": "^0.10.17",
"doctrine/dbal": "^2.12.0|^3.0"
},
Expand All @@ -43,7 +43,7 @@
"doctrine/cache": "^1.0.0",
"doctrine/annotations": "^1.13",
"wikimedia/composer-merge-plugin": "^2.0",
"ecotone/jms-converter": "~1.218.0",
"ecotone/jms-converter": "~1.219.0",
"symfony/expression-language": "^6.0|^7.0"
},
"scripts": {
Expand All @@ -56,7 +56,7 @@
},
"extra": {
"branch-alias": {
"dev-main": "1.218.0-dev"
"dev-main": "1.219.0-dev"
},
"ecotone": {
"repository": "dbal"
Expand Down
2 changes: 1 addition & 1 deletion packages/Ecotone/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
},
"extra": {
"branch-alias": {
"dev-main": "1.218.0-dev"
"dev-main": "1.219.0-dev"
},
"ecotone": {
"repository": "ecotone"
Expand Down
3 changes: 1 addition & 2 deletions packages/Ecotone/src/Lite/EcotoneLite.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
use Ecotone\Lite\Test\FlowTestSupport;
use Ecotone\Lite\Test\TestConfiguration;
use Ecotone\Messaging\Channel\MessageChannelBuilder;
use Ecotone\Messaging\Config\Annotation\ModuleConfiguration\ExtensionObjectResolver;
use Ecotone\Messaging\Config\ConfiguredMessagingSystem;
use Ecotone\Messaging\Config\Container\ContainerConfig;
use Ecotone\Messaging\Config\MessagingSystemConfiguration;
Expand Down Expand Up @@ -248,7 +247,7 @@ private static function prepareForFlowTesting(?ServiceConfiguration $configurati
}

$configuration = $configuration ?: ServiceConfiguration::createWithDefaults();
$testConfiguration = $testConfiguration ?? TestConfiguration::createWithDefaults();
$testConfiguration ??= TestConfiguration::createWithDefaults();

if (! $configuration->areSkippedPackagesDefined()) {
$configuration = $configuration
Expand Down
1 change: 0 additions & 1 deletion packages/Ecotone/src/Lite/Test/FlowTestSupport.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
use Ecotone\Modelling\Config\ModellingHandlerModule;
use Ecotone\Modelling\Event;
use Ecotone\Modelling\EventBus;
use Ecotone\Modelling\MessageBus;
use Ecotone\Modelling\QueryBus;

/**
Expand Down
5 changes: 2 additions & 3 deletions packages/Ecotone/src/Messaging/Attribute/InternalHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ public function __construct(
string $endpointId = '',
array $requiredInterceptorNames = [],
bool $changingHeaders = false,
)
{
) {
parent::__construct(
inputChannelName: $inputChannelName,
endpointId: $endpointId,
Expand All @@ -25,4 +24,4 @@ public function __construct(
changingHeaders: $changingHeaders,
);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ public function __construct(
bool $requiresReply = false,
array $requiredInterceptorNames = [],
private bool $changingHeaders = false,
)
{
) {
parent::__construct($inputChannelName, $endpointId, $outputChannelName, $requiredInterceptorNames);
$this->requiresReply = $requiresReply;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
use Ecotone\Messaging\Handler\TypeDescriptor;
use Ecotone\Messaging\MessageHeaders;
use Ecotone\Messaging\NullableMessageChannel;
use Ecotone\Modelling\MessageBus;

#[ModuleAnnotation]
class BasicMessagingModule extends NoExternalConfigurationModule implements AnnotationModule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

use Ecotone\Messaging\Attribute\Endpoint\AddHeader;
use Ecotone\Messaging\Attribute\Endpoint\Delayed;
use Ecotone\Messaging\Attribute\Endpoint\ExpireAfter;
use Ecotone\Messaging\Attribute\Endpoint\Priority;
use Ecotone\Messaging\Attribute\Endpoint\RemoveHeader;
use Ecotone\Messaging\Attribute\Endpoint\TimeToLive;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

use Ecotone\AnnotationFinder\AnnotationFinder;
use Ecotone\Messaging\Attribute\Endpoint\AddHeader;
use Ecotone\Messaging\Attribute\Endpoint\Delayed;
use Ecotone\Messaging\Attribute\Endpoint\ExpireAfter;
use Ecotone\Messaging\Attribute\Endpoint\Priority;
use Ecotone\Messaging\Attribute\Endpoint\RemoveHeader;
use Ecotone\Messaging\Attribute\ModuleAnnotation;
use Ecotone\Messaging\Config\Annotation\AnnotationModule;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
use Ecotone\Messaging\Handler\InterfaceToCallRegistry;
use Ecotone\Messaging\Handler\MessageHandlerBuilderWithParameterConverters;
use Ecotone\Messaging\Handler\ServiceActivator\ServiceActivatorBuilder;
use Ecotone\Messaging\Support\InvalidArgumentException;
use Ecotone\Modelling\Attribute\Aggregate;
use Ecotone\Modelling\Attribute\Saga;
use Ecotone\Messaging\Support\InvalidArgumentException;

#[ModuleAnnotation]
class ServiceActivatorModule extends MessageHandlerRegisterConfiguration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Ecotone\AnnotationFinder\AnnotatedFinding;
use Ecotone\Messaging\Attribute\ModuleAnnotation;
use Ecotone\Messaging\Attribute\Splitter;
use Ecotone\Messaging\Attribute\Transformer;
use Ecotone\Messaging\Config\Annotation\AnnotatedDefinitionReference;
use Ecotone\Messaging\Config\ModulePackageList;
use Ecotone\Messaging\Handler\InterfaceToCallRegistry;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ public function __construct(
private InterfaceToCall $interfaceToCall,
private MessageProcessor $messageProcessor,
private bool $shouldChangeMessageHeaders
)
{
) {
}

public static function createWith(InterfaceToCall $interfaceToCall, MessageProcessor $messageProcessor, bool $shouldChangeMessageHeaders = false)
Expand All @@ -46,8 +45,8 @@ public function executeEndpoint(Message $message): ?Message
}

if ($this->shouldChangeMessageHeaders) {
Assert::isFalse($result instanceof Message, "Message should not be returned when changing headers in " . $this->interfaceToCall->toString());
Assert::isTrue(is_array($result), "Result should be an array when changing headers in " . $this->interfaceToCall->toString());
Assert::isFalse($result instanceof Message, 'Message should not be returned when changing headers in ' . $this->interfaceToCall->toString());
Assert::isTrue(is_array($result), 'Result should be an array when changing headers in ' . $this->interfaceToCall->toString());

return MessageBuilder::fromMessage($message)
->setMultipleHeaders($result)
Expand Down
7 changes: 3 additions & 4 deletions packages/Ecotone/src/Messaging/Scheduling/TimeSpan.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ public function __construct(
public int $minutes = 0,
public int $hours = 0,
public int $days = 0,
)
{
) {

}

Expand All @@ -34,8 +33,8 @@ public function getDefinition(): Definition
$this->seconds,
$this->minutes,
$this->hours,
$this->days
$this->days,
]
);
}
}
}
2 changes: 0 additions & 2 deletions packages/Ecotone/src/Modelling/MessageBus.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

namespace Ecotone\Modelling;

use Ecotone\Messaging\Conversion\MediaType;

interface MessageBus
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ public function test_releasing_delayed_message_with_passed_milliseconds()
[OrderService::class, PlaceOrderConverter::class, OrderWasPlacedConverter::class],
[new OrderService(), new PlaceOrderConverter(), new OrderWasPlacedConverter()],
enableAsynchronousProcessing: [
SimpleMessageChannelBuilder::createQueueChannel('orders', true, MediaType::createApplicationXPHPArray())
SimpleMessageChannelBuilder::createQueueChannel('orders', true, MediaType::createApplicationXPHPArray()),
]
);

Expand All @@ -491,7 +491,7 @@ public function test_releasing_delayed_message()
[OrderService::class, PlaceOrderConverter::class, OrderWasPlacedConverter::class],
[new OrderService(), new PlaceOrderConverter(), new OrderWasPlacedConverter()],
enableAsynchronousProcessing: [
SimpleMessageChannelBuilder::createQueueChannel('orders', true, MediaType::createApplicationXPHPArray())
SimpleMessageChannelBuilder::createQueueChannel('orders', true, MediaType::createApplicationXPHPArray()),
]
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ final class AddingMultipleHeaders
#[TimeToLive(1001)]
#[Priority(1)]
#[RemoveHeader('user')]
#[Asynchronous("async")]
#[CommandHandler("addHeaders", endpointId: "addHeadersEndpoint")]
#[Asynchronous('async')]
#[CommandHandler('addHeaders', endpointId: 'addHeadersEndpoint')]
public function test(): void
{

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
public function test(): void
{
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
use Ecotone\Lite\Test\TestConfiguration;
use Ecotone\Messaging\Channel\SimpleMessageChannelBuilder;
use Ecotone\Messaging\MessageHeaders;
use Test\Ecotone\Messaging\Fixture\AddHeaders\AddingMultipleHeaders;
use PHPUnit\Framework\TestCase;
use Test\Ecotone\Messaging\Fixture\AddHeaders\AddingMultipleHeaders;

/**
* Class EndpointHeadersInterceptorTest
Expand All @@ -22,18 +22,22 @@ class EndpointHeadersInterceptorTest extends TestCase
{
public function test_adding_multiple_headers()
{
$ecotoneLite = EcotoneLite::bootstrapFlowTesting([
AddingMultipleHeaders::class
], [
AddingMultipleHeaders::class => new AddingMultipleHeaders()
], enableAsynchronousProcessing: [
SimpleMessageChannelBuilder::createQueueChannel('async')
],
testConfiguration: TestConfiguration::createWithDefaults()->withSpyOnChannel('async'));
$ecotoneLite = EcotoneLite::bootstrapFlowTesting(
[
AddingMultipleHeaders::class,
],
[
AddingMultipleHeaders::class => new AddingMultipleHeaders(),
],
enableAsynchronousProcessing: [
SimpleMessageChannelBuilder::createQueueChannel('async'),
],
testConfiguration: TestConfiguration::createWithDefaults()->withSpyOnChannel('async')
);

$headers = $ecotoneLite
->sendCommandWithRoutingKey('addHeaders', metadata: [
'user' => '1233'
'user' => '1233',
])
->getRecordedEcotoneMessagesFrom('async')[0]->getHeaders()->headers();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use Ecotone\Messaging\Handler\ServiceActivator\ServiceActivatorBuilder;
use stdClass;
use Test\Ecotone\Messaging\Fixture\Annotation\MessageEndpoint\ServiceActivator\AllConfigurationDefined\ServiceActivatorWithAllConfigurationDefined;
use Test\Ecotone\Messaging\Fixture\Annotation\MessageEndpoint\ServiceActivator\MessageHandler\ExampleMessageHandlerChangingHeaders;

/**
* Class AnnotationServiceActivatorConfigurationTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function __construct(private bool $isPaymentTaken = false)
}

#[Asynchronous('async')]
#[CommandHandler('takePayment', endpointId: "takePaymentEndpoint")]
#[CommandHandler('takePayment', endpointId: 'takePaymentEndpoint')]
public function takePayment(TakePayment $command): void
{
$this->isPaymentTaken = true;
Expand All @@ -27,4 +27,4 @@ public function isPaymentTaken(): bool
{
return $this->isPaymentTaken;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ public function __construct(
public string $orderId
) {
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ public function __construct(
public string $orderId
) {
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ public function __construct(
public string $orderId
) {
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace Test\Ecotone\Modelling\Fixture\Workflow\Saga;

use Ecotone\Messaging\Attribute\Parameter\Header;
use Ecotone\Modelling\Attribute\CommandHandler;
use Ecotone\Modelling\Attribute\EventHandler;
use Ecotone\Modelling\Attribute\Identifier;
use Ecotone\Modelling\Attribute\Saga;
Expand All @@ -22,27 +21,25 @@ final class OrderProcessSaga
public function __construct(
#[Identifier] private string $orderId,
private bool $shouldTakePayment
)
{
) {
$this->recordThat(new OrderProcessSagaStarted($orderId));
}

#[EventHandler]
public static function whenOrderWasPlaced(
OrderWasPlaced $event,
#[Header("shouldTakePayment")] bool $shouldTakePayment = true
): self
{
#[Header('shouldTakePayment')] bool $shouldTakePayment = true
): self {
return new self($event->orderId, $shouldTakePayment);
}

#[EventHandler(outputChannelName: "takePayment")]
#[EventHandler(outputChannelName: 'takePayment')]
public function triggerPayment(OrderProcessSagaStarted $event): ?TakePayment
{
if (!$this->shouldTakePayment) {
if (! $this->shouldTakePayment) {
return null;
}

return new TakePayment($event->orderId);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ public function isPaymentTaken(): bool
{
return $this->isPaymentTaken;
}
}
}
Loading

0 comments on commit bf199ec

Please sign in to comment.