> For the complete documentation index, see [llms.txt](https://docs.digit.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.digit.org/works/reference-implementations/muktasoft-v2.2/deployment/sms-adapter-services/notification-consumer-service.md).

# Notification Consumer Service

* Package: org.egov.works.service
* Source File: NotificationConsumerService.java
* Dependencies: Spring Framework, Kafka, Lombok

## Overview

The NotificationConsumerService class is responsible for routing Kafka messages to specific service components based on the topic they belong to within the eGov Works module.

## Attributes

1. contractNotificationService: Service for processing contract-related notifications.
2. estimateNotificationService: Service for processing estimate-related notifications.
3. notificationServiceConfiguration: Configuration settings for notification services.
4. expenseNotificationService: Service for processing expense-related notifications.
5. musterRollNotificationService: Service for processing muster roll related notifications.
6. measurementNotificationService: Service for processing measurement related notifications.
7. organizationNotificationService: Service for processing organization related notifications.
8. individualNotificationService: Service for processing individual related notifications.

## Methods

* **fetchServiceBasedOnTopic**(final String record, @Header(KafkaHeaders.RECEIVED\_TOPIC) String topic): Determines the appropriate service handler based on the topic of the received message and delegates the message processing to that specific service.

## Usage

Instantiate and configure the NotificationConsumer class within the application context to enable message consumption from Kafka topics. Ensure that the NotificationConsumerService class is properly injected into the NotificationConsumer class for seamless message processing.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.digit.org/works/reference-implementations/muktasoft-v2.2/deployment/sms-adapter-services/notification-consumer-service.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
