> 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
