Skip to content

Commit

Permalink
Release 1.222.4
Browse files Browse the repository at this point in the history
  • Loading branch information
dgafka authored and github-actions[bot] committed Jun 30, 2024
1 parent d0f8200 commit 8545098
Show file tree
Hide file tree
Showing 57 changed files with 174 additions and 326 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.222.0",
"ecotone/enqueue": "~1.222.4",
"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.222.0-dev"
"dev-main": "1.222.4-dev"
},
"ecotone": {
"repository": "amqp"
Expand Down
79 changes: 49 additions & 30 deletions packages/Amqp/tests/Integration/AmqpChannelAdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace Test\Ecotone\Amqp\Integration;

use Ecotone\Amqp\AmqpAdmin;
use Ecotone\Amqp\AmqpBackedMessageChannelBuilder;
use Ecotone\Amqp\AmqpBinding;
use Ecotone\Amqp\AmqpExchange;
Expand All @@ -22,14 +21,10 @@
use Ecotone\Messaging\Channel\SimpleMessageChannelBuilder;
use Ecotone\Messaging\Config\ModulePackageList;
use Ecotone\Messaging\Config\ServiceConfiguration;
use Ecotone\Messaging\Conversion\AutoCollectionConversionService;
use Ecotone\Messaging\Conversion\ConversionException;
use Ecotone\Messaging\Conversion\ConversionService;
use Ecotone\Messaging\Conversion\MediaType;
use Ecotone\Messaging\Conversion\ObjectToSerialized\SerializingConverter;
use Ecotone\Messaging\Conversion\ObjectToSerialized\SerializingConverterBuilder;
use Ecotone\Messaging\Endpoint\AcknowledgementCallback;
use Ecotone\Messaging\Endpoint\EndpointRunner;
use Ecotone\Messaging\Endpoint\ExecutionPollingMetadata;
use Ecotone\Messaging\Endpoint\PollingMetadata;
use Ecotone\Messaging\Handler\ChannelResolver;
Expand Down Expand Up @@ -178,11 +173,14 @@ public function test_throwing_exception_and_rejecting_when_stop_on_error_is_defi
$this->prepareMessaging($amqpConnectionReferenceName, $amqpExchanges, $amqpQueues, $amqpBindings, $converters)
->withChannel(SimpleMessageChannelBuilder::create($requestChannelName, $inboundRequestChannel))
->withChannel(SimpleMessageChannelBuilder::create('errorChannelCustom', $errorChannel)),
$inboundAmqpAdapter, PollingMetadata::create('some-id'
$inboundAmqpAdapter,
PollingMetadata::create(
'some-id'
)
->setErrorChannelName('errorChannelCustom')
->setStopOnError(true)
->setExecutionAmountLimit(1000));
->setExecutionAmountLimit(1000)
);

$messaging->run($inboundAmqpAdapter->getEndpointId());

Expand Down Expand Up @@ -419,18 +417,23 @@ public function test_sending_and_receiving_with_routing_key_to_custom_exchange()
->withDefaultRoutingKey('white');
$this->send(
$this->prepareMessaging($amqpConnectionReferenceName, $amqpExchanges, $amqpQueues, $amqpBindings, $converters),
$outboundAmqpGatewayBuilder, MessageBuilder::withPayload('some')->build()
$outboundAmqpGatewayBuilder,
MessageBuilder::withPayload('some')->build()
);

$this->assertNull($this->receiveOnce(
$this->prepareMessaging($amqpConnectionReferenceName, $amqpExchanges, $amqpQueues, $amqpBindings, $converters)
->withChannel(SimpleMessageChannelBuilder::create($requestChannelName, $inboundRequestChannel)),
$inboundAmqpAdapterForBlack, $inboundRequestChannel)
$this->assertNull(
$this->receiveOnce(
$this->prepareMessaging($amqpConnectionReferenceName, $amqpExchanges, $amqpQueues, $amqpBindings, $converters)
->withChannel(SimpleMessageChannelBuilder::create($requestChannelName, $inboundRequestChannel)),
$inboundAmqpAdapterForBlack,
$inboundRequestChannel
)
);
$this->assertNotNull($this->receiveOnce(
$this->prepareMessaging($amqpConnectionReferenceName, $amqpExchanges, $amqpQueues, $amqpBindings, $converters)
->withChannel(SimpleMessageChannelBuilder::create($requestChannelName, $inboundRequestChannel)),
$inboundAmqpAdapterForWhite, $inboundRequestChannel
$inboundAmqpAdapterForWhite,
$inboundRequestChannel
));
}

Expand Down Expand Up @@ -504,7 +507,8 @@ public function test_sending_and_receiving_with_exchange_in_message()
$this->assertNotNull($this->receiveOnce(
$this->prepareMessaging($amqpConnectionReferenceName, $amqpExchanges, $amqpQueues, $amqpBindings, $converters)
->withChannel(SimpleMessageChannelBuilder::create($requestChannelName, $inboundRequestChannel)),
$inboundAmqpAdapterForBlack, $inboundRequestChannel
$inboundAmqpAdapterForBlack,
$inboundRequestChannel
));
}

Expand Down Expand Up @@ -539,18 +543,21 @@ public function test_sending_and_receiving_from_topic_exchange()
->withDefaultRoutingKey('color.white');
$this->send(
$this->prepareMessaging($amqpConnectionReferenceName, $amqpExchanges, $amqpQueues, $amqpBindings, $converters),
$outboundAmqpGatewayBuilder, MessageBuilder::withPayload('some')->build()
$outboundAmqpGatewayBuilder,
MessageBuilder::withPayload('some')->build()
);

$this->assertNull($this->receiveOnce(
$this->prepareMessaging($amqpConnectionReferenceName, $amqpExchanges, $amqpQueues, $amqpBindings, $converters)
->withChannel(SimpleMessageChannelBuilder::create($requestChannelName, $inboundRequestChannel)),
$inboundAmqpAdapterForBlack, $inboundRequestChannel
$inboundAmqpAdapterForBlack,
$inboundRequestChannel
));
$this->assertNotNull($this->receiveOnce(
$this->prepareMessaging($amqpConnectionReferenceName, $amqpExchanges, $amqpQueues, $amqpBindings, $converters)
->withChannel(SimpleMessageChannelBuilder::create($requestChannelName, $inboundRequestChannel)),
$inboundAmqpAdapterForWhite, $inboundRequestChannel
$inboundAmqpAdapterForWhite,
$inboundRequestChannel
));
}

Expand Down Expand Up @@ -581,15 +588,17 @@ public function test_sending_and_receiving_with_header_mapping()
->withDefaultRoutingKey($queueName);
$this->send(
$this->prepareMessaging($amqpConnectionReferenceName, $amqpExchanges, $amqpQueues, $amqpBindings, $converters),
$outboundAmqpGatewayBuilder, $messageToSend
$outboundAmqpGatewayBuilder,
$messageToSend
);

$inboundAmqpAdapter = $this->createAmqpInboundAdapter($queueName, $requestChannelName, $amqpConnectionReferenceName)
->withHeaderMapper('token, userName');
$message = $this->receiveOnce(
$this->prepareMessaging($amqpConnectionReferenceName, $amqpExchanges, $amqpQueues, $amqpBindings, $converters)
->withChannel(SimpleMessageChannelBuilder::create($requestChannelName, $inboundRequestChannel)),
$inboundAmqpAdapter, $inboundRequestChannel
$inboundAmqpAdapter,
$inboundRequestChannel
);

$this->assertNotNull($message, 'Message was not received from rabbit');
Expand Down Expand Up @@ -617,7 +626,8 @@ public function test_sending_message_with_auto_acking()
->withDefaultRoutingKey($queueName);
$this->send(
$this->prepareMessaging($amqpConnectionReferenceName, $amqpExchanges, $amqpQueues, $amqpBindings, $converters),
$outboundAmqpGatewayBuilder, $messageToSend
$outboundAmqpGatewayBuilder,
$messageToSend
);

$inboundAmqpAdapter = $this->createAmqpInboundAdapter($queueName, $requestChannelName, $amqpConnectionReferenceName);
Expand All @@ -628,10 +638,12 @@ public function test_sending_message_with_auto_acking()
$messaging = $this->buildWithInboundAdapter(
$this->prepareMessaging($amqpConnectionReferenceName, $amqpExchanges, $amqpQueues, $amqpBindings, $converters)
->withChannel(SimpleMessageChannelBuilder::create($requestChannelName, $inboundRequestChannel)),
$inboundAmqpAdapter, PollingMetadata::create('some-id')
$inboundAmqpAdapter,
PollingMetadata::create('some-id')
->setHandledMessageLimit(1)
->setExecutionAmountLimit(100)
->setExecutionTimeLimitInMilliseconds(100));
->setExecutionTimeLimitInMilliseconds(100)
);

$messaging->run($inboundAmqpAdapter->getEndpointId());

Expand Down Expand Up @@ -661,7 +673,8 @@ public function test_sending_with_time_to_live()
->withDefaultRoutingKey($queueName);
$this->send(
$this->prepareMessaging($amqpConnectionReferenceName, $amqpExchanges, $amqpQueues, $amqpBindings, $converters),
$outboundAmqpGatewayBuilder, $messageToSend
$outboundAmqpGatewayBuilder,
$messageToSend
);

$inboundAmqpAdapter = $this->createAmqpInboundAdapter($queueName, $requestChannelName, $amqpConnectionReferenceName);
Expand All @@ -671,7 +684,8 @@ public function test_sending_with_time_to_live()
$messaging = $this->buildWithInboundAdapter(
$this->prepareMessaging($amqpConnectionReferenceName, $amqpExchanges, $amqpQueues, $amqpBindings, $converters)
->withChannel(SimpleMessageChannelBuilder::create($requestChannelName, $inboundRequestChannel)),
$inboundAmqpAdapter, PollingMetadata::create('some-id')->setExecutionTimeLimitInMilliseconds(1000)
$inboundAmqpAdapter,
PollingMetadata::create('some-id')->setExecutionTimeLimitInMilliseconds(1000)
);

usleep(1500);
Expand Down Expand Up @@ -851,18 +865,23 @@ public function test_sending_and_receiving_from_fanout_exchange()
$outboundAmqpGatewayBuilder = AmqpOutboundChannelAdapterBuilder::create($exchangeName, $amqpConnectionReferenceName);
$this->send(
$this->prepareMessaging($amqpConnectionReferenceName, $amqpExchanges, $amqpQueues, $amqpBindings, $converters),
$outboundAmqpGatewayBuilder, MessageBuilder::withPayload('some')->build()
$outboundAmqpGatewayBuilder,
MessageBuilder::withPayload('some')->build()
);

$this->assertNotNull($this->receiveOnce(
$this->prepareMessaging($amqpConnectionReferenceName, $amqpExchanges, $amqpQueues, $amqpBindings, $converters)
->withChannel(SimpleMessageChannelBuilder::create($requestChannelName, $inboundRequestChannel)),
$inboundAmqpAdapterForBlack, $inboundRequestChannel)
$this->assertNotNull(
$this->receiveOnce(
$this->prepareMessaging($amqpConnectionReferenceName, $amqpExchanges, $amqpQueues, $amqpBindings, $converters)
->withChannel(SimpleMessageChannelBuilder::create($requestChannelName, $inboundRequestChannel)),
$inboundAmqpAdapterForBlack,
$inboundRequestChannel
)
);
$this->assertNotNull($this->receiveOnce(
$this->prepareMessaging($amqpConnectionReferenceName, $amqpExchanges, $amqpQueues, $amqpBindings, $converters)
->withChannel(SimpleMessageChannelBuilder::create($requestChannelName, $inboundRequestChannel)),
$inboundAmqpAdapterForWhite, $inboundRequestChannel
$inboundAmqpAdapterForWhite,
$inboundRequestChannel
));
}

Expand Down
1 change: 0 additions & 1 deletion packages/Amqp/tests/Integration/AmqpMessageChannelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
use Ecotone\Messaging\Config\ServiceConfiguration;
use Ecotone\Messaging\Endpoint\ExecutionPollingMetadata;
use Ecotone\Messaging\Endpoint\PollingConsumer\ConnectionException;
use Ecotone\Messaging\Endpoint\PollingMetadata;
use Ecotone\Messaging\Handler\Recoverability\RetryTemplateBuilder;
use Ecotone\Messaging\PollableChannel;
use Ecotone\Messaging\Support\MessageBuilder;
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.222.0",
"ecotone/enqueue": "~1.222.4",
"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.222.0",
"ecotone/jms-converter": "~1.222.4",
"symfony/expression-language": "^6.0|^7.0"
},
"scripts": {
Expand All @@ -56,7 +56,7 @@
},
"extra": {
"branch-alias": {
"dev-main": "1.222.0-dev"
"dev-main": "1.222.4-dev"
},
"ecotone": {
"repository": "dbal"
Expand Down
1 change: 0 additions & 1 deletion packages/Dbal/tests/Integration/ChannelAdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Ecotone\Messaging\Channel\QueueChannel;
use Ecotone\Messaging\Channel\SimpleMessageChannelBuilder;
use Ecotone\Messaging\Endpoint\PollingMetadata;
use Ecotone\Messaging\MessagePoller;
use Ecotone\Messaging\Support\MessageBuilder;
use Ecotone\Test\ComponentTestBuilder;
use Enqueue\Dbal\DbalConnectionFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
use Ecotone\Messaging\Store\Document\DocumentException;
use Ecotone\Messaging\Store\Document\DocumentStore;
use Ecotone\Test\InMemoryConversionService;
use stdClass;
use Test\Ecotone\Dbal\DbalMessagingTestCase;

use function json_decode;
use function json_encode;

use stdClass;
use Test\Ecotone\Dbal\DbalMessagingTestCase;

/**
* @internal
*/
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.222.0-dev"
"dev-main": "1.222.4-dev"
},
"ecotone": {
"repository": "ecotone"
Expand Down
2 changes: 1 addition & 1 deletion packages/Ecotone/src/Lite/Test/FlowTestSupport.php
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ public function sendDirectToChannelWithMessageReply(string $targetChannel, mixed

public function sendMessageDirectToChannel(string $targetChannel, Message $message): mixed
{
Assert::isFalse($message->getHeaders()->containsKey(MessagingEntrypoint::ENTRYPOINT), "Message must not contain entrypoint header. Make use of first argument in sendDirectToChannel method");
Assert::isFalse($message->getHeaders()->containsKey(MessagingEntrypoint::ENTRYPOINT), 'Message must not contain entrypoint header. Make use of first argument in sendDirectToChannel method');
/** @var MessagingEntrypoint $messagingEntrypoint */
$messagingEntrypoint = $this->configuredMessagingSystem->getGatewayByName(MessagingEntrypoint::class);

Expand Down
32 changes: 3 additions & 29 deletions packages/Ecotone/src/Test/ComponentTestBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,61 +5,36 @@
use Ecotone\AnnotationFinder\FileSystem\FileSystemAnnotationFinder;
use Ecotone\Lite\InMemoryContainerImplementation;
use Ecotone\Lite\InMemoryPSRContainer;
use Ecotone\Lite\PhpDiContainerImplementation;
use Ecotone\Lite\Test\FlowTestSupport;
use Ecotone\Lite\Test\MessagingTestSupport;
use Ecotone\Messaging\Channel\MessageChannelBuilder;
use Ecotone\Messaging\Channel\SimpleMessageChannelBuilder;
use Ecotone\Messaging\Config\ConfiguredMessagingSystem;
use Ecotone\Messaging\Config\Container\ChannelReference;
use Ecotone\Messaging\Config\Container\CompilableBuilder;
use Ecotone\Messaging\Config\Container\Compiler\RegisterInterfaceToCallReferences;
use Ecotone\Messaging\Config\Container\Compiler\RegisterSingletonMessagingServices;
use Ecotone\Messaging\Config\Container\ContainerBuilder;
use Ecotone\Messaging\Config\Container\DefinedObject;
use Ecotone\Messaging\Config\Container\Definition;
use Ecotone\Messaging\Config\Container\EndpointRunnerReference;
use Ecotone\Messaging\Config\Container\MessagingContainerBuilder;
use Ecotone\Messaging\Config\Container\ProxyBuilder;
use Ecotone\Messaging\Config\Container\Reference;
use Ecotone\Messaging\Config\MessagingSystemConfiguration;
use Ecotone\Messaging\Config\ModulePackageList;
use Ecotone\Messaging\Config\ServiceCacheConfiguration;
use Ecotone\Messaging\Config\ServiceConfiguration;
use Ecotone\Messaging\ConfigurationVariableService;
use Ecotone\Messaging\Conversion\AutoCollectionConversionService;
use Ecotone\Messaging\Conversion\ConversionService;
use Ecotone\Messaging\Endpoint\ChannelAdapterConsumerBuilder;
use Ecotone\Messaging\Endpoint\EndpointRunner;
use Ecotone\Messaging\Endpoint\ExecutionPollingMetadata;
use Ecotone\Messaging\Endpoint\InterceptedChannelAdapterBuilder;
use Ecotone\Messaging\Endpoint\MessageHandlerConsumerBuilder;
use Ecotone\Messaging\Endpoint\PollingMetadata;
use Ecotone\Messaging\Gateway\MessagingEntrypoint;
use Ecotone\Messaging\Gateway\StorageMessagingEntrypoint;
use Ecotone\Messaging\Handler\Gateway\GatewayProxyBuilder;
use Ecotone\Messaging\Handler\Logger\LoggingGateway;
use Ecotone\Messaging\Handler\Logger\StubLoggingGateway;
use Ecotone\Messaging\Handler\MessageHandlerBuilder;

use Ecotone\Messaging\InMemoryConfigurationVariableService;

use Ecotone\Messaging\MessageChannel;
use Ecotone\Modelling\CommandBus;
use Ecotone\Modelling\EventBus;
use Ecotone\Modelling\QueryBus;
use Ecotone\SymfonyBundle\DependencyInjection\SymfonyContainerAdapter;
use function get_class;

use Ramsey\Uuid\Uuid;

class ComponentTestBuilder
{
private function __construct(
private InMemoryPSRContainer $container,
private MessagingSystemConfiguration $messagingSystemConfiguration
)
{
) {
}

/**
Expand All @@ -69,8 +44,7 @@ public static function create(
array $classesToResolve = [],
?ServiceConfiguration $configuration = null,
array $configurationVariables = [],
): self
{
): self {
// This will be used when symlinks to Ecotone packages are used (e.g. Split Testing - Github Actions)
$debug = debug_backtrace();
$path = dirname(array_pop($debug)['file']);
Expand Down Expand Up @@ -154,7 +128,7 @@ public function withGateway(GatewayProxyBuilder $gatewayProxyBuilder): self

public function build(): FlowTestSupport
{
$containerBuilder = new \Ecotone\Messaging\Config\Container\ContainerBuilder();
$containerBuilder = new ContainerBuilder();
$containerBuilder->addCompilerPass($this->messagingSystemConfiguration);
$containerBuilder->addCompilerPass(new RegisterInterfaceToCallReferences());
$containerBuilder->addCompilerPass(new InMemoryContainerImplementation($this->container));
Expand Down
2 changes: 1 addition & 1 deletion packages/Ecotone/src/Test/InMemoryConversionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public function compile(MessagingContainerBuilder $builder): Definition|Referenc
return new Definition(
self::class,
[
serialize($this)
serialize($this),
],
'fromSerialized'
);
Expand Down
Loading

0 comments on commit 8545098

Please sign in to comment.