Skip to content

Commit

Permalink
Release 1.236.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dgafka authored and github-actions[bot] committed Nov 2, 2024
1 parent def6e75 commit 2a81e4a
Show file tree
Hide file tree
Showing 31 changed files with 117 additions and 132 deletions.
6 changes: 3 additions & 3 deletions packages/Amqp/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
},
"require": {
"ext-amqp": "*",
"ecotone/enqueue": "~1.235.1",
"ecotone/enqueue": "~1.236.0",
"enqueue/amqp-ext": "^0.10.18",
"enqueue/dsn": "^0.10.4",
"enqueue/enqueue": "^0.10.0"
Expand All @@ -65,7 +65,7 @@
},
"extra": {
"branch-alias": {
"dev-main": "1.235.1-dev"
"dev-main": "1.236.0-dev"
},
"ecotone": {
"repository": "amqp"
Expand All @@ -86,7 +86,7 @@
"description": "Allows to use Enterprise features of Ecotone. For more information please write to [email protected]"
}
},
"release-time": "2024-10-26 14:55:13"
"release-time": "2024-11-02 16:23:07"
},
"config": {
"allow-plugins": {
Expand Down
8 changes: 4 additions & 4 deletions packages/Dbal/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
}
},
"require": {
"ecotone/enqueue": "~1.235.1",
"ecotone/enqueue": "~1.236.0",
"enqueue/dbal": "^0.10.17",
"doctrine/dbal": "^2.12.0|^3.0"
},
Expand All @@ -45,7 +45,7 @@
"doctrine/cache": "^1.0.0",
"doctrine/annotations": "^1.13",
"wikimedia/composer-merge-plugin": "^2.1",
"ecotone/jms-converter": "~1.235.1",
"ecotone/jms-converter": "~1.236.0",
"symfony/expression-language": "^6.0|^7.0"
},
"scripts": {
Expand All @@ -58,7 +58,7 @@
},
"extra": {
"branch-alias": {
"dev-main": "1.235.1-dev"
"dev-main": "1.236.0-dev"
},
"ecotone": {
"repository": "dbal"
Expand All @@ -79,7 +79,7 @@
"description": "Allows to use Enterprise features of Ecotone. For more information please write to [email protected]"
}
},
"release-time": "2024-10-26 14:55:13"
"release-time": "2024-11-02 16:23:07"
},
"config": {
"allow-plugins": {
Expand Down
4 changes: 2 additions & 2 deletions packages/Ecotone/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
},
"extra": {
"branch-alias": {
"dev-main": "1.235.1-dev"
"dev-main": "1.236.0-dev"
},
"ecotone": {
"repository": "ecotone"
Expand All @@ -87,7 +87,7 @@
"description": "Allows to use Enterprise features of Ecotone. For more information please write to [email protected]"
}
},
"release-time": "2024-10-26 14:55:13"
"release-time": "2024-11-02 16:23:07"
},
"config": {
"sort-packages": true,
Expand Down
6 changes: 3 additions & 3 deletions packages/Enqueue/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
}
},
"require": {
"ecotone/ecotone": "~1.235.1",
"ecotone/ecotone": "~1.236.0",
"queue-interop/queue-interop": "^0.8",
"enqueue/dsn": "^0.10.4"
},
Expand All @@ -56,7 +56,7 @@
},
"extra": {
"branch-alias": {
"dev-main": "1.235.1-dev"
"dev-main": "1.236.0-dev"
},
"ecotone": {
"repository": "enqueue"
Expand All @@ -77,7 +77,7 @@
"description": "Allows to use Enterprise features of Ecotone. For more information please write to [email protected]"
}
},
"release-time": "2024-10-26 14:55:13"
"release-time": "2024-11-02 16:23:07"
},
"config": {
"allow-plugins": {
Expand Down
6 changes: 3 additions & 3 deletions packages/JmsConverter/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
}
},
"require": {
"ecotone/ecotone": "~1.235.1",
"ecotone/ecotone": "~1.236.0",
"jms/serializer": "^3.17",
"symfony/cache": "^5.4|^6.1|^7.0"
},
Expand All @@ -60,7 +60,7 @@
},
"extra": {
"branch-alias": {
"dev-main": "1.235.1-dev"
"dev-main": "1.236.0-dev"
},
"ecotone": {
"repository": "jms-converter"
Expand All @@ -81,7 +81,7 @@
"description": "Allows to use Enterprise features of Ecotone. For more information please write to [email protected]"
}
},
"release-time": "2024-10-26 14:55:13"
"release-time": "2024-11-02 16:23:07"
},
"config": {
"sort-packages": true,
Expand Down
14 changes: 9 additions & 5 deletions packages/Kafka/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
"email": "[email protected]"
}
],
"keywords": ["ecotone", "Kafka"],
"keywords": [
"ecotone",
"Kafka"
],
"description": "Extends Ecotone with Kafka integration",
"autoload": {
"psr-4": {
Expand All @@ -30,7 +33,7 @@
},
"require": {
"ext-rdkafka": "*",
"ecotone/ecotone": "~1.235.1"
"ecotone/ecotone": "~1.236.0"
},
"require-dev": {
"phpunit/phpunit": "^9.6",
Expand All @@ -49,7 +52,7 @@
},
"extra": {
"branch-alias": {
"dev-main": "1.235.1-dev"
"dev-main": "1.236.0-dev"
},
"ecotone": {
"repository": "kafka"
Expand All @@ -69,11 +72,12 @@
"name": "Enterprise License",
"description": "Allows to use Enterprise features of Ecotone. For more information please write to [email protected]"
}
}
},
"release-time": "2024-11-02 16:23:07"
},
"config": {
"allow-plugins": {
"wikimedia/composer-merge-plugin": true
}
}
}
}
8 changes: 4 additions & 4 deletions packages/Kafka/src/Attribute/KafkaConsumer.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@

namespace Ecotone\Kafka\Attribute;

use Attribute;
use Ecotone\Messaging\Attribute\MessageConsumer;

/**
* licence Enterprise
*/
#[\Attribute]
#[Attribute]
final class KafkaConsumer extends MessageConsumer
{
public function __construct(
string $endpointId,
private array|string $topics,
private ?string $groupId = null
)
{
) {
parent::__construct($endpointId);
}

Expand All @@ -33,4 +33,4 @@ public function getGroupId(): ?string
{
return $this->groupId;
}
}
}
13 changes: 6 additions & 7 deletions packages/Kafka/src/Configuration/KafkaAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ public function __construct(
private array $consumerConfigurations,
private array $topicConfigurations,
private array $publisherConfigurations,
)
{
) {

}

Expand All @@ -40,7 +39,7 @@ public static function createEmpty(): self

public function getConfigurationForConsumer(string $endpointId): KafkaConsumerConfiguration
{
if (!array_key_exists($endpointId, $this->consumerConfigurations)) {
if (! array_key_exists($endpointId, $this->consumerConfigurations)) {
return KafkaConsumerConfiguration::createWithDefaults($endpointId);
}

Expand All @@ -49,7 +48,7 @@ public function getConfigurationForConsumer(string $endpointId): KafkaConsumerCo

public function getConfigurationForTopic(string $topicName): TopicConf
{
if (!array_key_exists($topicName, $this->topicConfigurations)) {
if (! array_key_exists($topicName, $this->topicConfigurations)) {
return TopicConfiguration::createWithDefaults($topicName)->getConfig();
}

Expand All @@ -63,10 +62,10 @@ private function getConfigurationForPublisher(string $referenceName): KafkaPubli

public function getProducer(string $referenceName, KafkaBrokerConfiguration $kafkaBrokerConfiguration): Producer
{
if (!array_key_exists($referenceName, $this->initializedProducers)) {
if (! array_key_exists($referenceName, $this->initializedProducers)) {
$conf = $this->getConfigurationForPublisher($referenceName);
$conf = $conf->getAsKafkaConfig();
$conf->set("bootstrap.servers", implode(",", $kafkaBrokerConfiguration->getBootstrapServers()));
$conf->set('bootstrap.servers', implode(',', $kafkaBrokerConfiguration->getBootstrapServers()));
$producer = new Producer($conf);

$this->initializedProducers[$referenceName] = $producer;
Expand All @@ -85,4 +84,4 @@ public function getTopicForProducer(string $referenceName, KafkaBrokerConfigurat
$this->getConfigurationForTopic($topicName)
);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ public function getBootstrapServers(): array
{
return $this->bootstrapServers;
}
}
}
11 changes: 4 additions & 7 deletions packages/Kafka/src/Configuration/KafkaConsumerConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use Ecotone\Messaging\Config\Container\Definition;
use Ecotone\Messaging\MessageConverter\DefaultHeaderMapper;
use Ecotone\Messaging\MessageConverter\HeaderMapper;
use Ecotone\Messaging\Support\Assert;
use RdKafka\Conf;

/**
Expand All @@ -28,8 +27,7 @@ public function __construct(
private string $brokerConfigurationReference,
private HeaderMapper $headerMapper,
private int $receiveTimeoutInMilliseconds = self::DEFAULT_RECEIVE_TIMEOUT
)
{
) {

}

Expand All @@ -39,8 +37,7 @@ public function __construct(
public static function createWithDefaults(
string $endpointId,
string $brokerConfigurationReference = KafkaBrokerConfiguration::class
): self
{
): self {
return new self($endpointId, [
'group.id' => $endpointId,
/** Ecotone commit automatically after message is consumed */
Expand Down Expand Up @@ -138,7 +135,7 @@ public function getDefinition(): Definition
$this->configuration,
$this->brokerConfigurationReference,
$this->headerMapper->getDefinition(),
$this->receiveTimeoutInMilliseconds
$this->receiveTimeoutInMilliseconds,
]);
}
}
}
15 changes: 7 additions & 8 deletions packages/Kafka/src/Configuration/KafkaModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace Ecotone\Kafka\Configuration;

use Ecotone\Amqp\AmqpOutboundChannelAdapterBuilder;
use Ecotone\AnnotationFinder\AnnotatedMethod;
use Ecotone\AnnotationFinder\AnnotationFinder;
use Ecotone\Kafka\Attribute\KafkaConsumer;
Expand Down Expand Up @@ -46,16 +45,16 @@ public static function create(AnnotationFinder $annotationRegistrationService, I
{
return new self(
array_map(
fn(AnnotatedMethod $annotatedMethod) => $annotatedMethod->getAnnotationForMethod(),
fn (AnnotatedMethod $annotatedMethod) => $annotatedMethod->getAnnotationForMethod(),
$annotationRegistrationService->findAnnotatedMethods(KafkaConsumer::class)
),
);
}

public function prepare(Configuration $messagingConfiguration, array $extensionObjects, ModuleReferenceSearchService $moduleReferenceSearchService, InterfaceToCallRegistry $interfaceToCallRegistry): void
{
if (!$messagingConfiguration->isRunningForEnterpriseLicence()) {
throw LicensingException::create("Kafka module is available only with Ecotone Enterprise licence.");
if (! $messagingConfiguration->isRunningForEnterpriseLicence()) {
throw LicensingException::create('Kafka module is available only with Ecotone Enterprise licence.');
}

$applicationConfiguration = ExtensionObjectResolver::resolveUnique(ServiceConfiguration::class, $extensionObjects, ServiceConfiguration::createWithDefaults());
Expand All @@ -66,9 +65,9 @@ public function prepare(Configuration $messagingConfiguration, array $extensionO
foreach ($extensionObjects as $extensionObject) {
if ($extensionObject instanceof KafkaConsumerConfiguration) {
$consumerConfigurations[$extensionObject->getEndpointId()] = $consumerConfigurations;
} else if ($extensionObject instanceof TopicConfiguration) {
} elseif ($extensionObject instanceof TopicConfiguration) {
$topicConfigurations[$extensionObject->getTopicName()] = $topicConfigurations;
} else if ($extensionObject instanceof KafkaPublisherConfiguration) {
} elseif ($extensionObject instanceof KafkaPublisherConfiguration) {
$publisherConfigurations[$this->getPublisherEndpointId($extensionObject->getReferenceName())] = $extensionObject;
$this->registerMessagePublisher($messagingConfiguration, $extensionObject, $applicationConfiguration);
}
Expand Down Expand Up @@ -106,7 +105,7 @@ public function canHandle($extensionObject): bool

public function getModulePackageName(): string
{
return "kafka";
return 'kafka';
}

private function registerMessagePublisher(Configuration $messagingConfiguration, KafkaPublisherConfiguration $extensionObject, ServiceConfiguration $applicationConfiguration): void
Expand Down Expand Up @@ -156,4 +155,4 @@ private function getPublisherEndpointId(string $referenceName): string
{
return $referenceName . '.handler';
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace Ecotone\Kafka\Configuration;

use Ecotone\Amqp\Publisher\AmqpMessagePublisherConfiguration;
use Ecotone\Messaging\Config\Container\DefinedObject;
use Ecotone\Messaging\Config\Container\Definition;
use Ecotone\Messaging\MessageConverter\DefaultHeaderMapper;
Expand All @@ -27,13 +26,13 @@ private function __construct(
private string $brokerConfigurationReference,
private HeaderMapper $headerMapper,
private ?string $outputDefaultConversionMediaType = null,
)
{
) {
}

public static function createWithDefaults(string $topicName = '', string $referenceName = MessagePublisher::class, string $brokerConfigurationReference = KafkaBrokerConfiguration::class): self
{
return new self($topicName,
return new self(
$topicName,
$referenceName,
[
// By default in the absence of idempotence a producer may inadvertently publish a record in duplicate our of order - if one of the queued records experiences timeout
Expand Down Expand Up @@ -133,4 +132,4 @@ public function getDefinition(): Definition
$this->outputDefaultConversionMediaType,
]);
}
}
}
Loading

0 comments on commit 2a81e4a

Please sign in to comment.