-
Notifications
You must be signed in to change notification settings - Fork 38
[HCMPRE-2739] central instance changes for expense service #1916
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
4ad7af6
central instance changes for expense service
holashchand c2690ed
Fixed multistate instance bean not found
holashchand c4b9ca2
Added code comments
holashchand 43e794d
Fixed indentation issue
holashchand 1fed57d
Fixed indentation issue
holashchand 310b87f
Merge branch 'master' into HCMPRE-2739-expense
holashchand File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
6 changes: 2 additions & 4 deletions
6
backend/expense/src/main/java/org/egov/digit/expense/ExpenseApplication.java
This file contains hidden or 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 hidden or 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
20 changes: 17 additions & 3 deletions
20
backend/expense/src/main/java/org/egov/digit/expense/kafka/ExpenseProducer.java
This file contains hidden or 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 |
|---|---|---|
| @@ -1,22 +1,36 @@ | ||
| package org.egov.digit.expense.kafka; | ||
|
|
||
| import lombok.extern.slf4j.Slf4j; | ||
| import org.egov.common.utils.MultiStateInstanceUtil; | ||
| import org.egov.tracer.kafka.CustomKafkaTemplate; | ||
| import org.springframework.beans.factory.annotation.Autowired; | ||
| import org.springframework.stereotype.Service; | ||
|
|
||
| // NOTE: If tracer is disabled change CustomKafkaTemplate to KafkaTemplate in autowiring | ||
|
|
||
| @Slf4j | ||
| @Service | ||
| public class ExpenseProducer { | ||
|
|
||
| private final CustomKafkaTemplate<String, Object> kafkaTemplate; | ||
| private final MultiStateInstanceUtil multiStateInstanceUtil; | ||
|
|
||
| @Autowired | ||
| public ExpenseProducer(CustomKafkaTemplate<String, Object> kafkaTemplate) { | ||
| public ExpenseProducer(CustomKafkaTemplate<String, Object> kafkaTemplate, MultiStateInstanceUtil multiStateInstanceUtil) { | ||
| this.kafkaTemplate = kafkaTemplate; | ||
| this.multiStateInstanceUtil = multiStateInstanceUtil; | ||
| } | ||
|
|
||
| public void push(String topic, Object value) { | ||
| kafkaTemplate.send(topic, value); | ||
| /** | ||
| * Publishes a message to a Kafka topic based on the tenant-specific topic name. | ||
| * | ||
| * @param tenantId the unique identifier of the tenant for which the message is being published | ||
| * @param topic the base Kafka topic name to which the message needs to be pushed | ||
| * @param value the message payload to be sent to the Kafka topic | ||
| */ | ||
| public void push(String tenantId, String topic, Object value) { | ||
| String updatedTopic = multiStateInstanceUtil.getStateSpecificTopicName(tenantId, topic); | ||
| log.info("The Kafka topic for the tenantId : {} is : {}", tenantId, updatedTopic); | ||
| this.kafkaTemplate.send(updatedTopic, value); | ||
holashchand marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
| } | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.