本文整理汇总了Java中org.apache.kafka.common.security.auth.SecurityProtocol类的典型用法代码示例。如果您正苦于以下问题:Java SecurityProtocol类的具体用法?Java SecurityProtocol怎么用?Java SecurityProtocol使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SecurityProtocol类属于org.apache.kafka.common.security.auth包,在下文中一共展示了SecurityProtocol类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createKafkaConfig
import org.apache.kafka.common.security.auth.SecurityProtocol; //导入依赖的package包/类
public static Properties createKafkaConfig(int port, String zkConnect, boolean autoCreateTopic, int numPartitions) {
final Option<File> noFile = scala.Option.apply(null);
final Option<SecurityProtocol> noInterBrokerSecurityProtocol = scala.Option.apply(null);
// new params for kafka 0.10.0
Option<Properties> saslProperties = scala.Option.apply(null);
Option<String> rack = scala.Option.apply(RackAwareMode.Enforced$.MODULE$.toString());
Properties props = TestUtils.createBrokerConfig(
0, zkConnect, false, false, port, noInterBrokerSecurityProtocol,
noFile, saslProperties, true, false, TestUtils.RandomPort(), false, TestUtils.RandomPort(), false,
TestUtils.RandomPort(), rack, 1);
props.setProperty("auto.create.topics.enable", String.valueOf(autoCreateTopic));
props.setProperty("num.partitions", String.valueOf(numPartitions));
props.setProperty("offsets.topic.replication.factor", "1");
return props;
}
开发者ID:streamsets,项目名称:datacollector,代码行数:17,代码来源:TestUtil1_0.java
示例2: createKafkaServer
import org.apache.kafka.common.security.auth.SecurityProtocol; //导入依赖的package包/类
public static KafkaServer createKafkaServer(int brokerId, int port, String zkConnect) {
final Option<File> noFile = scala.Option.apply(null);
final Option<SecurityProtocol> noInterBrokerSecurityProtocol = scala.Option.apply(null);
// new params for kafka 0.10.0
Option<Properties> saslProperties = scala.Option.apply(null);
Option rack = scala.Option.apply(RackAwareMode.Enforced$.MODULE$.toString());
Properties props = TestUtils.createBrokerConfig(
brokerId,
zkConnect,
false,
false,
port,
noInterBrokerSecurityProtocol,
noFile,
saslProperties,
true,
false,
TestUtils.RandomPort(),
false,
TestUtils.RandomPort(),
false,
TestUtils.RandomPort(),
rack,
1
);
props.setProperty("auto.create.topics.enable", "true");
props.setProperty("num.partitions", "1");
props.setProperty("zookeeper.connect", zkConnect);
KafkaConfig config = new KafkaConfig(props);
return TestUtils.createServer(config, Time.SYSTEM);
}
开发者ID:streamsets,项目名称:datacollector,代码行数:32,代码来源:KafkaTestUtil1_0.java
示例3: startKafkaServer
import org.apache.kafka.common.security.auth.SecurityProtocol; //导入依赖的package包/类
private KafkaServer startKafkaServer() {
Properties props = TestUtils.createBrokerConfig(0, zookeeper.getConnectString(), true, true, 9092, Option.<SecurityProtocol>empty(), Option.<File>empty(), Option.<Properties>empty(), true, false, 0, false, 0, false, 0, Option.<String>empty(), 0);
props.put(KafkaConfig.ZkConnectProp(), zookeeper.getConnectString());
kafkaServer = TestUtils.createServer(new KafkaConfig(props), new kafka.utils.MockTime());
return kafkaServer;
}
开发者ID:hubrick,项目名称:vertx-kafka-service,代码行数:7,代码来源:KafkaProducerServiceIntegrationTest.java
示例4: brokerList
import org.apache.kafka.common.security.auth.SecurityProtocol; //导入依赖的package包/类
/**
* This broker's `metadata.broker.list` value. Example: `127.0.0.1:9092`.
* <p>
* You can use this to tell Kafka producers and consumers how to connect to this instance.
*/
public String brokerList() {
return kafka.config().hostName() + ":" + kafka.boundPort(ListenerName.forSecurityProtocol(SecurityProtocol.PLAINTEXT));
}
开发者ID:Landoop,项目名称:kafka-testkit,代码行数:9,代码来源:KafkaEmbedded.java
注:本文中的org.apache.kafka.common.security.auth.SecurityProtocol类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论