- 
    Task 
- 
    Resolution: Done
- 
    Normal 
- 
    None
- 
    None
- 
        8
- 
        False
- 
        
- 
        False
- 
        subs-swatch-lightning
- 
        
- 
        
- 
        Swatch Lightning Sprint 2, Swatch Lightning Sprint 3
This task involves modifying the swatch-contracts service to consume messages from the "platform.rhsm-subscriptions.tally" topic in batches.
The changes will include:
- Configure swatch-contracts to consume messages from the platform.rhsm-subscriptions.tally topic in configurable batches. The new consumer must be configured using the following property:
mp.messaging.incoming.tally-in.auto.offset.reset=latest
This is the default configuration, but it's better to be explicit here. The idea is to only consume the new messages.
- Capacity Query Optimization: For each batch of consumed messages, a single query will be executed to retrieve the necessary capacity information using the existing "subscription_capacity_view". This will reduce the load on the database or external service providing capacity data.
- Batch Response Sending: After processing the capacity for the entire batch, a corresponding batch of responses will be sent to the platform.rhsm-subscriptions.utilization topic.
Acceptance Criteria
- Added new data model called UtilizationSummary that includes the snapshot summary data plus the capacity data from the query
- New component tests are implemented to verify the end-to-end batch processing functionality
- blocks
- 
                    SWATCH-4005 Add utilization summary consumer in swatch-utilization -         
- New
 
-         
- causes
- 
                    SWATCH-4171 stage deploy: swatch-contracts failing to start: Kafka Transactional Id authorization failed -         
- Release Pending
 
-         
- depends on
- 
                    SWATCH-3994 Make swatch-contracts-bonfire-tekton work with database dependencies -         
- Release Pending
 
-         
- 
                    SWATCH-3788 Create topic “platform.rhsm-subscriptions.utilization” -         
- Release Pending
 
-         
- 
                    SWATCH-3787 Spike: Investigate best strategy to consume Kafka messages in batches in Quarkus -         
- Closed
 
-         
- is blocked by
- 
                    SWATCH-3867 Subscription_measurements missing data from contract_metrics -         
- Release Pending
 
-