-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MOSIP-31982 updated the implementaion from websub to kafka (#1234)
* MOSIP-32073 design document added (#1223) Signed-off-by: Neha Farheen <[email protected]> Co-authored-by: Neha Farheen <[email protected]> Signed-off-by: Neha Farheen <[email protected]> * POM changes (#1225) Signed-off-by: Neha Farheen <[email protected]> Co-authored-by: Neha Farheen <[email protected]> Signed-off-by: Neha Farheen <[email protected]> * updated the image path Signed-off-by: Neha Farheen <[email protected]> * MOSIP-31982 changes done for image Signed-off-by: Neha Farheen <[email protected]> * MOSIP-31982 changes done for image Signed-off-by: Neha Farheen <[email protected]> --------- Signed-off-by: Neha Farheen <[email protected]> Co-authored-by: Neha Farheen <[email protected]>
- Loading branch information
Showing
12 changed files
with
137 additions
and
70 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
41 changes: 41 additions & 0 deletions
41
...mmon/src/main/java/io/mosip/authentication/common/service/config/KafkaProducerConfig.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,41 @@ | ||
package io.mosip.authentication.common.service.config; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
import org.apache.kafka.clients.producer.ProducerConfig; | ||
import org.apache.kafka.common.serialization.StringSerializer; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.kafka.core.DefaultKafkaProducerFactory; | ||
import org.springframework.kafka.core.KafkaTemplate; | ||
import org.springframework.kafka.core.ProducerFactory; | ||
import org.springframework.kafka.support.serializer.JsonSerializer; | ||
|
||
/** | ||
* The Class KafkaProducerConfig. | ||
* | ||
* @author Neha | ||
*/ | ||
|
||
@Configuration | ||
public class KafkaProducerConfig { | ||
|
||
@Value(value = "${mosip.ida.kafka.bootstrap.servers}") | ||
private String bootstrapAddress; | ||
|
||
@Bean | ||
public ProducerFactory<String, Object> producerFactory() { | ||
Map<String, Object> configProps = new HashMap<>(); | ||
configProps.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapAddress); | ||
configProps.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class); | ||
configProps.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, JsonSerializer.class); | ||
return new DefaultKafkaProducerFactory<>(configProps); | ||
} | ||
|
||
@Bean | ||
public KafkaTemplate<String, Object> kafkaTemplate() { | ||
return new KafkaTemplate<>(producerFactory()); | ||
} | ||
} |
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
2 changes: 2 additions & 0 deletions
2
authentication/authentication-common/src/main/resource/bootstrap.properties
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,2 @@ | ||
mosip.ida.kafka.bootstrap.servers=kafka-0.kafka-headless.${kafka.profile}:${kafka.port},kafka-1.kafka-headless.${kafka.profile}:${kafka.port},kafka-2.kafka-headless.${kafka.profile}:${kafka.port} | ||
spring.kafka.admin.properties.allow.auto.create.topics=true |
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.