-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
) * 303 docker compose for securing kafka first attempt * 303 changed docker compose SSL to PLAINTEXT * #303 kafka Auth Configuration * #303 added user for producer to connect to kafka * #313 solved serializers casting problems using SpecificDatumWritter * #313 removed unused asignment to DatumWriter * #313 updated pom.xml * #313 datum writer changed to final * #313 added new test for serializers with logicaltypes and removed unused specific datum writer in serializers * #313 Solving checkstyle problems * #313 moving avro logical types conversion config to avro serializers * #313 checkstyle errors fix * #313 changed incorrect pom version Co-authored-by: Jose Enrique García Maciñeiras <[email protected]>
- Loading branch information
1 parent
5aec03e
commit cd006c0
Showing
11 changed files
with
219 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
|
||
<artifactId>kloadgen</artifactId> | ||
|
||
<version>5.1.3</version> | ||
<version>5.1.4</version> | ||
|
||
<name>KLoadGen</name> | ||
<description>Load Generation Jmeter plugin for Kafka Cluster. Supporting AVRO, JSON Schema and Protobuf schema types. Generate Artificial data base on Data specification</description> | ||
|
@@ -167,6 +167,17 @@ | |
</roles> | ||
<timezone>Europe/Madrid</timezone> | ||
</developer> | ||
<developer> | ||
<id>davidgarciago</id> | ||
<name>David García Gondell</name> | ||
<email>[email protected]</email> | ||
<organization>Corunet</organization> | ||
<organizationUrl>https://corunet.github.io/</organizationUrl> | ||
<roles> | ||
<role>Junior Developer</role> | ||
</roles> | ||
<timezone>Europe/Madrid</timezone> | ||
</developer> | ||
</developers> | ||
|
||
<scm> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
KafkaServer { | ||
org.apache.kafka.common.security.plain.PlainLoginModule required | ||
username="admin" | ||
password="admin-secret" | ||
user_admin="admin-secret"; | ||
}; | ||
|
||
Client {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
version: '3' | ||
services: | ||
zookeeper: | ||
image: confluentinc/cp-zookeeper | ||
environment: | ||
ZOOKEEPER_CLIENT_PORT: 2181 | ||
ZOOKEEPER_SASL_ENABLED: "false" | ||
kafka: | ||
image: confluentinc/cp-kafka | ||
depends_on: | ||
- zookeeper | ||
ports: | ||
- 29092:29092 | ||
- 9092:9092 | ||
volumes: | ||
- ./conf/kafka/kafka-jaas.conf:/etc/kafka/kafka_server_jaas.conf | ||
environment: | ||
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,SASL_PLAINTEXT:SASL_PLAINTEXT | ||
KAFKA_LISTENERS: PLAINTEXT://:9092, SASL_PLAINTEXT://:29092 | ||
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092,SASL_PLAINTEXT://localhost:29092 | ||
ZOOKEEPER_SASL_ENABLED: "false" | ||
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT | ||
KAFKA_SASL_ENABLED_MECHANISMS: PLAIN | ||
KAFKA_SASL_MECHANISM_INTER_BROKER_PROTOCOL: PLAIN | ||
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 | ||
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 | ||
KAFKA_AUTO_CREATE_TOPICS_ENABLE: "true" | ||
KAFKA_OPTS: "-Djava.security.auth.login.config=/etc/kafka/kafka_server_jaas.conf" | ||
|
||
schema-registry: | ||
image: confluentinc/cp-schema-registry | ||
depends_on: | ||
- zookeeper | ||
- kafka | ||
ports: | ||
- 8081:8081 | ||
volumes: | ||
- ./conf:/conf:ro | ||
environment: | ||
SCHEMA_REGISTRY_HOST_NAME: schema-registry | ||
SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: PLAINTEXT://kafka:9092 | ||
SCHEMA_REGISTRY_LISTENERS: http://0.0.0.0:8081 | ||
SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL: zookeeper:2181 | ||
SCHEMA_REGISTRY_AUTHENTICATION_METHOD: BASIC | ||
SCHEMA_REGISTRY_AUTHENTICATION_REALM: SchemaRegistry | ||
SCHEMA_REGISTRY_AUTHENTICATION_ROLES: Testers | ||
SCHEMA_REGISTRY_OPTS: -Djava.security.auth.login.config=/conf/schema-registry/schema-registry.jaas | ||
kafka-manager: | ||
image: kafkamanager/kafka-manager | ||
environment: | ||
ZK_HOSTS: zookeeper | ||
ports: | ||
- 9000:9000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/main/java/net/coru/kloadgen/serializer/AvroSerializersUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package net.coru.kloadgen.serializer; | ||
|
||
import org.apache.avro.Conversions; | ||
import org.apache.avro.data.TimeConversions; | ||
import org.apache.avro.generic.GenericData; | ||
|
||
public final class AvroSerializersUtil { | ||
|
||
private AvroSerializersUtil() { | ||
} | ||
|
||
public static void setupLogicalTypesConversion() { | ||
final var genericData = GenericData.get(); | ||
|
||
genericData.addLogicalTypeConversion(new TimeConversions.DateConversion()); | ||
genericData.addLogicalTypeConversion(new TimeConversions.LocalTimestampMicrosConversion()); | ||
genericData.addLogicalTypeConversion(new TimeConversions.LocalTimestampMillisConversion()); | ||
genericData.addLogicalTypeConversion(new TimeConversions.TimeMicrosConversion()); | ||
genericData.addLogicalTypeConversion(new TimeConversions.TimeMillisConversion()); | ||
genericData.addLogicalTypeConversion(new TimeConversions.TimestampMicrosConversion()); | ||
genericData.addLogicalTypeConversion(new TimeConversions.TimestampMillisConversion()); | ||
genericData.addLogicalTypeConversion(new Conversions.DecimalConversion()); | ||
genericData.addLogicalTypeConversion(new Conversions.UUIDConversion()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.