• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

FIWARE / contract-management / #102

30 Sep 2026 10:28AM UTC coverage: 4.485% (+0.7%) from 3.796%
#102

Pull #28

vramperez
Remove stack trace floods from connection errors

- Micronaut's DefaultHttpClient logged every failed connection at ERROR with a
  ~125 line stack trace, duplicating the one-line WARN of the failed call. It is
  off by default now (LOG_LEVEL_MICRONAUT_HTTP_CLIENT to bring it back)
- The subscription retry warning names the event and the reason instead of
  attaching the stack trace on every retry
- Suppress logback's status dump on startup

Without a reachable TM Forum API this reduces 25s of logs from ~1100 to ~60 lines.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Pull Request #28: Add failure reasons, downstream error descriptions and configurable log output

229 of 453 new or added lines in 31 files covered. (50.55%)

11 existing lines in 7 files now uncovered.

1608 of 35855 relevant lines covered (4.48%)

0.04 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/main/java/org/fiware/iam/tmforum/notification/NotificationListener.java
1
package org.fiware.iam.tmforum.notification;
2

3
import io.micronaut.context.annotation.Requires;
4
import io.micronaut.http.HttpResponse;
5
import io.micronaut.http.annotation.Body;
6
import io.micronaut.http.annotation.Controller;
7
import io.micronaut.http.annotation.Post;
8
import lombok.RequiredArgsConstructor;
9
import lombok.extern.slf4j.Slf4j;
10
import org.fiware.iam.configuration.NotificationProperties;
11
import org.fiware.iam.tmforum.handlers.TMForumEventHandler;
12
import reactor.core.publisher.Mono;
13

14
import java.util.List;
15
import java.util.Map;
16

17
/**
18
 * Listener endpoint for TMForum notifications
19
 */
20
@Requires(condition = NotificationProperties.NotificationCondition.class)
21
@Slf4j
×
22
@Controller("${general.basepath:/}")
23
@RequiredArgsConstructor
24
public class NotificationListener {
25

26
    public static final String EVENT_TYPE_KEY = "eventType";
27
    private static final String EVENT_ID_KEY = "eventId";
28

29
    private final List<TMForumEventHandler> eventHandlers;
30

31
    @Post("/listener/event")
32
    public Mono<HttpResponse<?>> listenToEvent(@Body Map<String, Object> event) {
33
        log.debug("Received an Event: {}", event);
×
34
        if (!event.containsKey(EVENT_TYPE_KEY)) {
×
NEW
35
            throw new IllegalArgumentException("The notification does not contain an eventType, it contains only %s.".formatted(event.keySet()));
×
36
        }
37

38
        if (event.get(EVENT_TYPE_KEY) instanceof String eventType) {
×
NEW
39
            log.info("Received {} notification {}.", eventType, event.getOrDefault(EVENT_ID_KEY, "without eventId"));
×
40
            return eventHandlers.stream()
×
41
                    .filter(handler -> handler.isEventTypeSupported(eventType))
×
42
                    .findAny()
×
43
                    .orElseThrow(() -> new IllegalArgumentException("Event type %s is not supported.".formatted(eventType)))
×
44
                    .handleEvent(eventType, event)
×
NEW
45
                    .doOnNext(r -> log.debug("Answered {} with {}.", eventType, r.getStatus().getCode()));
×
46
        }
NEW
47
        throw new IllegalArgumentException("The eventType of the notification is not a string, but %s.".formatted(event.get(EVENT_TYPE_KEY)));
×
48
    }
49
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc