Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Changes to pom.xml

  1. Add

...

Code Block
<dependency>
  <groupId>org.egov.services</groupId>
  <artifactId>tracer</artifactId>
  <version>2.1.0-SNAPSHOT</version>
</dependency>

...

  1. new digit nexus repo under <repositories> tag

    Code Block
    <repository>
    <id>repo.digit.org</id>
    <name>eGov DIGIT Releases Repository</name>
    <url><https://nexus-repo.digit.org/nexus/content/repositories/snapshots/</url>>
    </repository>

  2. Add Tracer 2.1.0

    Code Block
    <dependency>
      <groupId>org.egov.services</groupId>
      <artifactId>tracer</artifactId>
      <version>2.1.0-SNAPSHOT</version>
    </dependency>

  3. Update the Kafka producer in the service with the following code to enable the service to post to a tenant(namespace) specific topic based on the tenant-id.

    Code Block
    languagejava
    @Service
    @Slf4j
    public class Producer {
    
    	@Autowired
    	private CustomKafkaTemplate<String, Object> kafkaTemplate;
    	
    	@Autowired
    	private PropertyConfiguration configs;
    
    	public void push(String tenantId, String topic, Object value) {
    
    		String updatedTopic = topic;
    		if (configs.getIsEnvironmentCentralInstance()) {
    
    			String[] tenants = tenantId.split("\\.");
    			if (tenants.length > 1)
    				updatedTopic = tenants[1].concat("-").concat(topic);
    		}
    		log.info("The Kafka topic for the tenantId : " + tenantId + " is : " + updatedTopic);
    		kafkaTemplate.send(updatedTopic, value);
    	}
    } 

  4. { ADD if any new configs }