diff --git a/oslo_messaging/_drivers/impl_kafka.py b/oslo_messaging/_drivers/impl_kafka.py index b6a0e6272..a69ffe6b6 100644 --- a/oslo_messaging/_drivers/impl_kafka.py +++ b/oslo_messaging/_drivers/impl_kafka.py @@ -144,14 +144,7 @@ class Connection(object): LOG.warning(_LW("Different transport usernames detected")) if host.hostname: - self.hostaddrs.append("%s:%s" % ( - host.hostname, - host.port or self.driver_conf.kafka_default_port)) - - if not self.hostaddrs: - self.hostaddrs.append("%s:%s" % - (self.driver_conf.kafka_default_host, - self.driver_conf.kafka_default_port)) + self.hostaddrs.append("%s:%s" % (host.hostname, host.port)) def reset(self): """Reset a connection so it can be used again.""" diff --git a/oslo_messaging/_drivers/kafka_driver/kafka_options.py b/oslo_messaging/_drivers/kafka_driver/kafka_options.py index d68b7efeb..5fbe7b220 100644 --- a/oslo_messaging/_drivers/kafka_driver/kafka_options.py +++ b/oslo_messaging/_drivers/kafka_driver/kafka_options.py @@ -16,16 +16,6 @@ from oslo_config import cfg from oslo_messaging._drivers import common KAFKA_OPTS = [ - cfg.StrOpt('kafka_default_host', default='localhost', - deprecated_for_removal=True, - deprecated_reason="Replaced by [DEFAULT]/transport_url", - help='Default Kafka broker Host'), - - cfg.PortOpt('kafka_default_port', default=9092, - deprecated_for_removal=True, - deprecated_reason="Replaced by [DEFAULT]/transport_url", - help='Default Kafka broker Port'), - cfg.IntOpt('kafka_max_fetch_bytes', default=1024 * 1024, help='Max fetch bytes of Kafka consumer'), diff --git a/oslo_messaging/tests/drivers/test_impl_kafka.py b/oslo_messaging/tests/drivers/test_impl_kafka.py index 1aff43f1b..dff6176da 100644 --- a/oslo_messaging/tests/drivers/test_impl_kafka.py +++ b/oslo_messaging/tests/drivers/test_impl_kafka.py @@ -37,21 +37,6 @@ class TestKafkaDriverLoad(test_utils.BaseTestCase): class TestKafkaTransportURL(test_utils.BaseTestCase): scenarios = [ - ('none', dict(url=None, - expected=dict(hostaddrs=['localhost:9092'], - username=None, - password=None, - vhost=''))), - ('empty', dict(url='kafka:///', - expected=dict(hostaddrs=['localhost:9092'], - username=None, - password=None, - vhost=''))), - ('host', dict(url='kafka://127.0.0.1', - expected=dict(hostaddrs=['127.0.0.1:9092'], - username=None, - password=None, - vhost=None))), ('port', dict(url='kafka://localhost:1234', expected=dict(hostaddrs=['localhost:1234'], username=None, @@ -141,7 +126,7 @@ class TestKafkaDriver(test_utils.BaseTestCase): consumer.assert_called_once_with( *expected_topics, group_id="kafka_test", enable_auto_commit=mock.ANY, - bootstrap_servers=['localhost:9092'], + bootstrap_servers=[], max_partition_fetch_bytes=mock.ANY, max_poll_records=mock.ANY, security_protocol='PLAINTEXT',