Skip to content
This repository was archived by the owner on Jul 19, 2024. It is now read-only.

Commit 475ed5b

Browse files
Merge branch 'master' of github.com:Superbalist/laravel-pubsub
2 parents 9874808 + 8d70e5b commit 475ed5b

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/PubSubConnectionFactory.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ protected function makeRedisAdapter(array $config)
6565
$config['read_write_timeout'] = 0;
6666
}
6767

68-
$client = $this->container->make('pubsub.redis.redis_client', ['config' => $config]);
68+
$client = $this->container->makeWith('pubsub.redis.redis_client', ['config' => $config]);
6969

7070
return new RedisPubSubAdapter($client);
7171
}
@@ -80,21 +80,21 @@ protected function makeRedisAdapter(array $config)
8080
protected function makeKafkaAdapter(array $config)
8181
{
8282
// create producer
83-
$producer = $this->container->make('pubsub.kafka.producer');
83+
$producer = $this->container->makeWith('pubsub.kafka.producer');
8484
$producer->addBrokers($config['brokers']);
8585

8686
// create consumer
87-
$topicConf = $this->container->make('pubsub.kafka.topic_conf');
87+
$topicConf = $this->container->makeWith('pubsub.kafka.topic_conf');
8888
$topicConf->set('auto.offset.reset', 'smallest');
8989

90-
$conf = $this->container->make('pubsub.kafka.conf');
90+
$conf = $this->container->makeWith('pubsub.kafka.conf');
9191
$conf->set('group.id', array_get($config, 'consumer_group_id', 'php-pubsub'));
9292
$conf->set('metadata.broker.list', $config['brokers']);
9393
$conf->set('enable.auto.commit', 'false');
9494
$conf->set('offset.store.method', 'broker');
9595
$conf->setDefaultTopicConf($topicConf);
9696

97-
$consumer = $this->container->make('pubsub.kafka.consumer', ['conf' => $conf]);
97+
$consumer = $this->container->makeWith('pubsub.kafka.consumer', ['conf' => $conf]);
9898

9999
return new KafkaPubSubAdapter($producer, $consumer);
100100
}
@@ -112,7 +112,7 @@ protected function makeGoogleCloudAdapter(array $config)
112112
'projectId' => $config['project_id'],
113113
'keyFilePath' => $config['key_file'],
114114
];
115-
$client = $this->container->make('pubsub.gcloud.pub_sub_client', ['config' => $clientConfig]);
115+
$client = $this->container->makeWith('pubsub.gcloud.pub_sub_client', ['config' => $clientConfig]);
116116

117117
$clientIdentifier = array_get($config, 'client_identifier');
118118
$autoCreateTopics = array_get($config, 'auto_create_topics', true);

tests/PubSubConnectionFactoryTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function testMakeRedisAdapter()
4848
];
4949

5050
$container = Mockery::mock(Container::class);
51-
$container->shouldReceive('make')
51+
$container->shouldReceive('makeWith')
5252
->withArgs([
5353
'pubsub.redis.redis_client',
5454
['config' => $config],
@@ -80,15 +80,15 @@ public function testMakeKafkaAdapter()
8080
->with('localhost')
8181
->once();
8282

83-
$container->shouldReceive('make')
83+
$container->shouldReceive('makeWith')
8484
->with('pubsub.kafka.producer')
8585
->once()
8686
->andReturn($producer);
8787

8888
$topicConf = Mockery::mock(\RdKafka\TopicConf::class);
8989
$topicConf->shouldReceive('set');
9090

91-
$container->shouldReceive('make')
91+
$container->shouldReceive('makeWith')
9292
->with('pubsub.kafka.topic_conf')
9393
->once()
9494
->andReturn($topicConf);
@@ -146,7 +146,7 @@ public function testMakeKafkaAdapter()
146146
public function testMakeGoogleCloudAdapter()
147147
{
148148
$container = Mockery::mock(Container::class);
149-
$container->shouldReceive('make')
149+
$container->shouldReceive('makeWith')
150150
->withArgs([
151151
'pubsub.gcloud.pub_sub_client',
152152
[

0 commit comments

Comments
 (0)