Skip to content

Commit

Permalink
Merge pull request #30 from SnuK87/fix/remove-classloader-fix
Browse files Browse the repository at this point in the history
Remove classloader fix
  • Loading branch information
SnuK87 authored Jun 11, 2023
2 parents a81f244 + e41a3c3 commit 070c027
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.snuk87.keycloak</groupId>
<artifactId>keycloak-kafka</artifactId>
<version>1.1.4</version>
<version>1.1.5</version>

<properties>
<maven.compiler.source>17</maven.compiler.source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,7 @@ public Producer<String, String> createProducer(String clientId, String bootstrap
props.put(ProducerConfig.CLIENT_ID_CONFIG, clientId);
props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName());
props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName());

optionalProperties.forEach(props::put);

// fix Class org.apache.kafka.common.serialization.StringSerializer could not be
// found. see https://stackoverflow.com/a/50981469
Thread.currentThread().setContextClassLoader(null);
props.putAll(optionalProperties);

return new KafkaProducer<>(props);
}
Expand Down

0 comments on commit 070c027

Please sign in to comment.