Skip to content

Commit

Permalink
Merge branch 'master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusjunges committed Aug 18, 2024
2 parents e2d7e17 + 5fa0f1b commit 83f97b9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions .phpunit.cache/test-results
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"version":1,"defects":[],"times":{"Junges\\Kafka\\Tests\\Commit\\BatchCommitterTest::testShouldCommitMessageOnlyAfterTheBatchSizeIsReached":0.029,"Junges\\Kafka\\Tests\\Commit\\BatchCommitterTest::testShouldAlwaysCommitDlq":0,"Junges\\Kafka\\Tests\\Commit\\CommitterFactoryTest::testShouldBuildAVoidCommitterWhenAutoCommitIsDisabled":0.003,"Junges\\Kafka\\Tests\\Commit\\CommitterFactoryTest::testShouldBuildARetryableBatchCommitterWhenAutoCommitIsEnabled":0.001,"Junges\\Kafka\\Tests\\Commit\\KafkaCommitterTest::testItCanCommit":0.002,"Junges\\Kafka\\Tests\\Commit\\KafkaCommitterTest::testItCanCommitToDlq":0,"Junges\\Kafka\\Tests\\Commit\\RetryableCommitterTest::testItShouldRetryToCommit":0.001,"Junges\\Kafka\\Tests\\Commit\\RetryableCommitterTest::testItShouldRetryOnlyUpToTheMaximumNumberOfRetries":0.001,"Junges\\Kafka\\Tests\\Commit\\RetryableCommitterTest::testItShouldProgressivelyWaitForTheNextRetry":0.001,"Junges\\Kafka\\Tests\\Commit\\SeekToCurrentErrorCommitterTest::testItShouldCommitOnSuccess":0.001,"Junges\\Kafka\\Tests\\Commit\\SeekToCurrentErrorCommitterTest::testItShouldNotCommitAndResubscribeOnError":0.001,"Junges\\Kafka\\Tests\\Commit\\SeekToCurrentErrorCommitterTest::testItPassesDlqCommits":0,"Junges\\Kafka\\Tests\\Config\\ConfigTest::testItReturnsDefaultKafkaConfiguration":0,"Junges\\Kafka\\Tests\\Config\\ConfigTest::testItOverrideDefaultOptionsIfUsingCustom":0,"Junges\\Kafka\\Tests\\Config\\ConfigTest::testItUsesSaslConfigWhenSet":0,"Junges\\Kafka\\Tests\\Config\\ConfigTest::testItReturnsProducerOptions":0,"Junges\\Kafka\\Tests\\Config\\ConfigTest::testItAcceptsCustomOptionsForProducersConfig":0,"Junges\\Kafka\\Tests\\Config\\ConfigTest::testSaslCanBeUsedWithLowercaseConfigKeys":0,"Junges\\Kafka\\Tests\\Config\\ConfigTest::testItCreatesNullBatchConfigIfNullIsPassed":0,"Junges\\Kafka\\Tests\\Config\\ConfigTest::testItReturnsGivenBatchConfigIfInstancePassed":0.001,"Junges\\Kafka\\Tests\\Config\\SaslTest::testGetUsername":0,"Junges\\Kafka\\Tests\\Config\\SaslTest::testGetPassword":0,"Junges\\Kafka\\Tests\\Config\\SaslTest::testGetMechanisms":0,"Junges\\Kafka\\Tests\\Console\\Consumers\\KafkaConsumerCommandTest::testItCanConsumeMessages":0.067,"Junges\\Kafka\\Tests\\Console\\Consumers\\OptionsTest::testItInstantiateTheClassWithCorrectOptions":0.001,"Junges\\Kafka\\Tests\\Console\\Consumers\\OptionsTest::testItInstantiatesUsingOnlyRequiredOptions":0,"Junges\\Kafka\\Tests\\Consumers\\CallableConsumerTest::testItDecodesMessages":0.003,"Junges\\Kafka\\Tests\\Consumers\\ConsumerBuilderTest::testItReturnsAConsumerInstance":0.001,"Junges\\Kafka\\Tests\\Consumers\\ConsumerBuilderTest::testItCanSubscribeToATopic":0,"Junges\\Kafka\\Tests\\Consumers\\ConsumerBuilderTest::testItDoesNotSubscribeToATopicTwice":0,"Junges\\Kafka\\Tests\\Consumers\\ConsumerBuilderTest::testICanChangeDeserializersOnTheFly":0,"Junges\\Kafka\\Tests\\Consumers\\ConsumerBuilderTest::testItCanSubscribeToMoreThanOneTopicsAtOnce":0,"Junges\\Kafka\\Tests\\Consumers\\ConsumerBuilderTest::testItCanSetConsumerGroupId":0,"Junges\\Kafka\\Tests\\Consumers\\ConsumerBuilderTest::testItThrowsInvalidArgumentExceptionIfCreatingWithInvalidTopic":0.001,"Junges\\Kafka\\Tests\\Consumers\\ConsumerBuilderTest::testItCanSaveTheCommitBatchSize":0,"Junges\\Kafka\\Tests\\Consumers\\ConsumerBuilderTest::testItUsesTheCorrectHandler":0,"Junges\\Kafka\\Tests\\Consumers\\ConsumerBuilderTest::testItCanSetMaxMessages":0,"Junges\\Kafka\\Tests\\Consumers\\ConsumerBuilderTest::testItCanSetMaxCommitRetries":0,"Junges\\Kafka\\Tests\\Consumers\\ConsumerBuilderTest::testItCanSetTheDeadLetterQueue":0,"Junges\\Kafka\\Tests\\Consumers\\ConsumerBuilderTest::testItUsesDlqSuffixIfDlqIsNull":0,"Junges\\Kafka\\Tests\\Consumers\\ConsumerBuilderTest::testItCanSetSasl":0,"Junges\\Kafka\\Tests\\Consumers\\ConsumerBuilderTest::testItCanAddMiddlewaresToTheHandler":0.001,"Junges\\Kafka\\Tests\\Consumers\\ConsumerBuilderTest::testItCanAddInvokableClassesAsMiddleware":0,"Junges\\Kafka\\Tests\\Consumers\\ConsumerBuilderTest::testItCanSetSecurityProtocol":0,"Junges\\Kafka\\Tests\\Consumers\\ConsumerBuilderTest::testItCanSetSecurityProtocolViaSaslConfig":0,"Junges\\Kafka\\Tests\\Consumers\\ConsumerBuilderTest::testItCanSetAutoCommit":0.001,"Junges\\Kafka\\Tests\\Consumers\\ConsumerBuilderTest::testItCanSetStopAfterLastMessage":0,"Junges\\Kafka\\Tests\\Consumers\\ConsumerBuilderTest::testItCanSetConsumerOptions":0.001,"Junges\\Kafka\\Tests\\Consumers\\ConsumerBuilderTest::testItCanSpecifyBrokersUsingWithBrokers":0,"Junges\\Kafka\\Tests\\Consumers\\ConsumerBuilderTest::testItCanBuildWithCustomCommitter":0,"Junges\\Kafka\\Tests\\Consumers\\ConsumerBuilderTest::testItCantCreateAConsumerWithDlqWithoutSubscribingToAnyTopics":0,"Junges\\Kafka\\Tests\\Consumers\\ConsumerTest::testItConsumesAMessageSuccessfullyAndCommit":0.001,"Junges\\Kafka\\Tests\\Consumers\\ConsumerTest::testItCanConsumeMessages":0.002,"Junges\\Kafka\\Tests\\Consumers\\ConsumerTest::testItCanConsumeMessagesWithQueueableHandlers":0.003,"Junges\\Kafka\\Tests\\Consumers\\ConsumerTest::testConsumeMessageWithError":0.001,"Junges\\Kafka\\Tests\\Consumers\\ConsumerTest::testCanStopConsume":0.001,"Junges\\Kafka\\Tests\\Consumers\\ConsumerTest::testItAcceptsCustomCommitter":0.002,"Junges\\Kafka\\Tests\\Consumers\\ConsumerTest::testItCanRestartConsumer":0.107,"Junges\\Kafka\\Tests\\Consumers\\ConsumerTest::testCanStopConsumeIfMaxTimeReached":2.009,"Junges\\Kafka\\Tests\\Consumers\\ConsumerTest::testItRunCallbacksBeforeConsume":0.001,"Junges\\Kafka\\Tests\\Consumers\\ConsumerTest::it_can_test_macroed_consumers":0.001,"Junges\\Kafka\\Tests\\Handlers\\RetryableHandlerTest::testItPassesWhenNoExceptionOccurred":0.002,"Junges\\Kafka\\Tests\\Handlers\\RetryableHandlerTest::testItDoesRetriesOnException":0,"Junges\\Kafka\\Tests\\Handlers\\RetryableHandlerTest::testItBubblesExceptionWhenRetriesExceeded":0.001,"Junges\\Kafka\\Tests\\KafkaFakeTest::testItStorePublishedMessagesOnArray":0,"Junges\\Kafka\\Tests\\KafkaFakeTest::testAssertPublished":0.001,"Junges\\Kafka\\Tests\\KafkaFakeTest::testAssertPublishedTimes":0.001,"Junges\\Kafka\\Tests\\KafkaFakeTest::testItCanPerformAssertionsOnPublishedMessages":0,"Junges\\Kafka\\Tests\\KafkaFakeTest::testAssertPublishedOn":0,"Junges\\Kafka\\Tests\\KafkaFakeTest::testAssertPublishedOnBySpecifyingMessageObject":0,"Junges\\Kafka\\Tests\\KafkaFakeTest::testAssertPublishedOnTimes":0.001,"Junges\\Kafka\\Tests\\KafkaFakeTest::testAssertPublishedOnTimesForBatchMessages":0,"Junges\\Kafka\\Tests\\KafkaFakeTest::testICanPerformAssertionsUsingAssertPublishedOn":0.001,"Junges\\Kafka\\Tests\\KafkaFakeTest::testNothingPublished":0.001,"Junges\\Kafka\\Tests\\KafkaFakeTest::testPublishMessageBatch":0,"Junges\\Kafka\\Tests\\KafkaFakeTest::testFakeConsumer":0,"Junges\\Kafka\\Tests\\KafkaFakeTest::testFakeConsumerWithSingleMultipleMessages":0,"Junges\\Kafka\\Tests\\KafkaFakeTest::testAReceivedMessageDoesItsJob":0.001,"Junges\\Kafka\\Tests\\KafkaFakeTest::testStopFakeConsumer":0,"Junges\\Kafka\\Tests\\KafkaFakeTest::testFakeBatchConsumer":0.001,"Junges\\Kafka\\Tests\\KafkaFakeTest::testFakeMultipleBatchConsumer":0.001,"Junges\\Kafka\\Tests\\KafkaFakeTest::testStopFakeBatchConsumer":0,"Junges\\Kafka\\Tests\\KafkaFakeTest::it_can_handle_macros":0,"Junges\\Kafka\\Tests\\KafkaTest::testItCanPublishMessagesToKafka":0.002,"Junges\\Kafka\\Tests\\KafkaTest::testICanSwitchSerializersOnTheFly":0.001,"Junges\\Kafka\\Tests\\KafkaTest::testItDoesNotSendMessagesToKafkaIfUsingFake":0,"Junges\\Kafka\\Tests\\KafkaTest::testICanSetTheEntireMessageWithMessageObject":0.001,"Junges\\Kafka\\Tests\\KafkaTest::testICanDisableDebugUsingWithDebugDisabledMethod":0.005,"Junges\\Kafka\\Tests\\KafkaTest::testICanUseCustomOptionsForProducerConfig":0,"Junges\\Kafka\\Tests\\KafkaTest::testCreateConsumerReturnsAConsumerBuilderInstance":0,"Junges\\Kafka\\Tests\\KafkaTest::testCreateConsumerDefaultConfigs":0,"Junges\\Kafka\\Tests\\KafkaTest::testProducerThrowsExceptionIfMessageCouldNotBePublished":0.946,"Junges\\Kafka\\Tests\\KafkaTest::testSendMessageBatch":0.001,"Junges\\Kafka\\Tests\\KafkaTest::testMacro":0,"Junges\\Kafka\\Tests\\KafkaTest::it_stores_published_messages_when_using_macros":0,"Junges\\Kafka\\Tests\\Message\\Deserializers\\AvroDeserializerTest::testDeserializeTombstone":0.003,"Junges\\Kafka\\Tests\\Message\\Deserializers\\AvroDeserializerTest::testDeserializeWithSchema":0.006,"Junges\\Kafka\\Tests\\Message\\Deserializers\\AvroDeserializerTest::testDeserializeKeyMode":0.001,"Junges\\Kafka\\Tests\\Message\\Deserializers\\AvroDeserializerTest::testDeserializeBodyMode":0.001,"Junges\\Kafka\\Tests\\Message\\Deserializers\\AvroDeserializerTest::testGetRegistry":0,"Junges\\Kafka\\Tests\\Message\\Deserializers\\JsonDeserializerTest::testDeserialize":0.001,"Junges\\Kafka\\Tests\\Message\\Deserializers\\JsonDeserializerTest::testDeserializeNonJson":0,"Junges\\Kafka\\Tests\\Message\\KafkaAvroSchemaTest::testGetters":0,"Junges\\Kafka\\Tests\\Message\\KafkaAvroSchemaTest::testSetters":0,"Junges\\Kafka\\Tests\\Message\\KafkaAvroSchemaTest::testAvroSchemaWithJustName":0,"Junges\\Kafka\\Tests\\Message\\MessageTest::testItCanSetAMessageKey":0,"Junges\\Kafka\\Tests\\Message\\MessageTest::testItCanForgetAMessageKey":0,"Junges\\Kafka\\Tests\\Message\\MessageTest::testItCanSetMessageHeaders":0,"Junges\\Kafka\\Tests\\Message\\MessageTest::testItCanSetTheMessageKey":0,"Junges\\Kafka\\Tests\\Message\\MessageTest::testItCanGetTheMessagePayload":0,"Junges\\Kafka\\Tests\\Message\\MessageTest::testItCanTransformAMessageInArray":0,"Junges\\Kafka\\Tests\\Message\\Registry\\AvroSchemaRegistryTest::testAddBodySchemaMappingForTopic":0.002,"Junges\\Kafka\\Tests\\Message\\Registry\\AvroSchemaRegistryTest::testAddKeySchemaMappingForTopic":0,"Junges\\Kafka\\Tests\\Message\\Registry\\AvroSchemaRegistryTest::testHasBodySchemaMappingForTopic":0,"Junges\\Kafka\\Tests\\Message\\Registry\\AvroSchemaRegistryTest::testHasKeySchemaMappingForTopic":0,"Junges\\Kafka\\Tests\\Message\\Registry\\AvroSchemaRegistryTest::testGetBodySchemaForTopicWithNoMapping":0,"Junges\\Kafka\\Tests\\Message\\Registry\\AvroSchemaRegistryTest::testGetBodySchemaForTopicWithMappingWithDefinition":0,"Junges\\Kafka\\Tests\\Message\\Registry\\AvroSchemaRegistryTest::testGetKeySchemaForTopicWithMappingWithDefinition":0,"Junges\\Kafka\\Tests\\Message\\Registry\\AvroSchemaRegistryTest::testGetBodySchemaForTopicWithMappingWithoutDefinitionLatest":0,"Junges\\Kafka\\Tests\\Message\\Registry\\AvroSchemaRegistryTest::testGetBodySchemaForTopicWithMappingWithoutDefinitionVersion":0,"Junges\\Kafka\\Tests\\Message\\Registry\\AvroSchemaRegistryTest::testGetTopicSchemaMapping":0,"Junges\\Kafka\\Tests\\Message\\Serializers\\AvroSerializerTest::testSerializeTombstone":0.001,"Junges\\Kafka\\Tests\\Message\\Serializers\\AvroSerializerTest::testSerializeWithoutSchemaDefinition":0.001,"Junges\\Kafka\\Tests\\Message\\Serializers\\AvroSerializerTest::testSerializeSuccessWithSchema":0.001,"Junges\\Kafka\\Tests\\Message\\Serializers\\AvroSerializerTest::testSerializeKeyMode":0.001,"Junges\\Kafka\\Tests\\Message\\Serializers\\AvroSerializerTest::testSerializeBodyMode":0.001,"Junges\\Kafka\\Tests\\Message\\Serializers\\AvroSerializerTest::testGetRegistry":0,"Junges\\Kafka\\Tests\\Message\\Serializers\\JsonSerializerTest::testSerialize":0.003,"Junges\\Kafka\\Tests\\Message\\Serializers\\JsonSerializerTest::testSerializeThrowsException":0,"Junges\\Kafka\\Tests\\Producers\\ProducerTest::testItDoesNotDoubleSerializeMessageWhenUsingJsonSerializer":0.001}}
4 changes: 2 additions & 2 deletions src/Producers/Producer.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function __construct(
private readonly bool $async = false,
) {
$this->producer = app(KafkaProducer::class, [
'conf' => $this->setConf($this->config->getProducerOptions()),
'conf' => $this->getConf($this->config->getProducerOptions()),
]);
$this->dispatcher = App::make(Dispatcher::class);

Expand All @@ -49,7 +49,7 @@ public function __construct(
}

/** Set the Kafka Configuration. */
private function setConf(array $options): Conf
private function getConf(array $options): Conf
{
$conf = new Conf();

Expand Down
4 changes: 2 additions & 2 deletions src/Providers/LaravelKafkaServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function boot(): void
}
}

public function register()
public function register(): void
{
$this->app->bind(MessageSerializer::class, fn () => new JsonSerializer());

Expand All @@ -47,7 +47,7 @@ public function register()
$this->app->singleton(LoggerContract::class, Logger::class);
}

private function publishesConfiguration()
private function publishesConfiguration(): void
{
$this->publishes([
__DIR__."/../../config/kafka.php" => config_path('kafka.php'),
Expand Down

0 comments on commit 83f97b9

Please sign in to comment.