Skip to content
cccskills
FreePublished on GitHub

integrasjon

External integrations overview for melosys-api including REST/SOAP services, Kafka topics, databases, and support services. Use when adding new integrations, debugging external calls, understanding data flow, or troubleshooting connectivity. Triggers: "integration", "external service", "consumer", "kafka topic", "REST client".

The English summary is being prepared. Showing the original description.

Works withAzure
See how to install

Files included (1)

  • SKILL.md10.7 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

External Integrations

Melosys-api integrates with numerous NAV internal services and external systems. Outbound REST/SOAP clients and the Kafka producers live in the integrasjon module and follow consistent patterns. Inbound Kafka consumers live in the service module (see the Kafka Topics section). The class naming convention is *Client / *ClientConfig / *ClientProducer for REST/SOAP, plus *Service / *Fasade wrappers — not *Consumer.

REST/SOAP Services

Person & Organization Data

ServiceClient/Service classPurposeAuth
PDLPDLClient / PDLClientImplPerson data (GraphQL)Azure AD
AaregArbeidsforholdClientEmployment recordsAzure AD
EREGOrganisasjonRestClientOrganization data (Brønnøysund)None
InntektInntektClient (InntektService wrapper)Income from SkatteetatenAzure AD

Document & Archive

ServiceClient/Service classPurposeAuth
SAFSafClientDocument retrieval (GraphQL)Azure AD
JoarkJoarkFasade / JoarkServiceDocument archivingAzure AD
DokgenDokgenClientPDF generationAzure AD
DoksysDoksysFasade / DoksysService (DokumentproduksjonClient)Legacy doc production (SOAP)STS
DistribuerDistribuerJournalpostClientDocument distributionAzure AD

Case Management

ServiceClient/Service classPurposeAuth
OppgaveOppgaveFasade / OppgaveFasadeImplTask management (Gosys)Azure AD
SakBasicAuthSakClientCase systemBasic Auth
MedlMedlemskapClient (MedlService wrapper)Membership registerAzure AD

EU/EESSI

ServiceClient/Service classPurposeAuth
eux-rina-apiEessiClientEESSI/RINA integrationAzure AD

Financial & Tax

ServiceClient/Service classPurposeAuth
FaktureringFaktureringskomponentenClientBilling componentAzure AD
TrygdeavgiftTrygdeavgiftClientSocial security calculations (melosys-trygdeavgift-beregning)None (in-cluster)
UtbetalingUtbetaltdataClientPayment dataAzure AD

Support Services

ServiceClient/Service classPurposeAuth
KodeverkKodeverkClient (KodeverkRegisterImpl wrapper)Reference dataAzure AD
TilgangsmaskinenTilgangsmaskinenClientAccess control (ABAC)Azure AD
Azure ADAzureAdClient (AzureAdService wrapper)User/group lookup + token issuingAzure AD
STSSecurityTokenServiceClientToken exchange (legacy)Basic

Application Intake

ServiceClient/Service classPurposeAuth
AltinnSoknadMottakClientA1 application formsAzure AD
InngangsvilkårInngangsvilkaarClientEntry requirementsNone (in-cluster)

Kafka Topics

Inbound (Consumers)

The Kafka consumer classes live in the service module (service/src/main/.../no/nav/melosys/service/...), not integrasjon. Topic names below are the configured teammelosys.* topics (see app/src/main/resources/application-nais.yml).

TopicConsumer ClassModule pathPurpose
teammelosys.eessi.v1EessiMeldingConsumerservice/eessi/kafkaReceived/sent SED + RINA events (single topic)
teammelosys.soknad-mottak.v1SoknadMottattConsumerservice/soknadAltinn applications
teammelosys.skjema.innsendt.v1DigitalSøknadMottattConsumerservice/soknadDigital A1 skjema (melosys-skjema-api)
teammelosys.skattehendelser.v1SkattehendelserConsumerservice/avgift/aarsavregningTax events
teammelosys.manglende-fakturabetaling.v1ManglendeFakturabetalingConsumerservice/avgiftOverdue invoices

Outbound (Producers)

The producer classes live in the integrasjon module.

TopicProducer ClassPurpose
teammelosys.melosys-hendelser.v1KafkaMelosysHendelseProducerMelosys events
teammelosys.popp-hendelser.v1KafkaPensjonsopptjeningHendelseProducerPension (POPP) events

Databases

DatabaseTypeModule
Melosys-DBOracleapp (Flyway)
Melosys-eessi-dbPostgreSQLExternal

Authentication Patterns

Service-to-service auth is Azure AD (on-behalf-of / client-credentials), attached as a WebClient filter. There is no TokenX usage in the integrasjon module — auth is wired through GenericAuthFilterFactory.getAzureFilter(clientName) (Kotlin configs) or AzureContextExchangeFilter (Java configs). The clientName maps to an Azure scope configured per service.

Azure AD (Service-to-service)

// In a *ClientConfig: attach the Azure auth filter for this client
@Bean
fun myServiceClient(
    webClientBuilder: WebClient.Builder,
    genericAuthFilterFactory: GenericAuthFilterFactory,
) = MyServiceClient(
    webClientBuilder
        .baseUrl(url)
        .filter(genericAuthFilterFactory.getAzureFilter(CLIENT_NAME))
        .filter(errorFilter("Kall mot MyService feilet."))
        .build()
)

STS (Legacy SOAP)

// SecurityTokenServiceClient (reststs/) fetches a SAML/OIDC token using Basic auth
securityTokenServiceClient.getResponseForSamlToken()

No auth (in-cluster)

Some in-cluster sidecar/team-internal calls (e.g. InngangsvilkaarClient, TrygdeavgiftClient) attach no auth filter at all — only the error filter. Trace context (traceparent) is propagated automatically by the NAIS OpenTelemetry agent.

Module Structure

The integrasjon module has BOTH a Kotlin and a Java source tree. Newer/migrated clients are Kotlin; some older clients (PDL, SAF/Joark, Doksys, Oppgave, STS, dokumentmottak) are still Java.

integrasjon/src/main/kotlin/no/nav/melosys/integrasjon/
├── aareg/           # Employment records
├── azuread/         # Azure AD client (token issuing) + AzureAdService
├── dokgen/          # PDF generation
├── doksys/          # Legacy doc (SOAP) + distribuerjournalpost/
├── eessi/           # EESSI/RINA
├── ereg/            # Organization lookup
├── faktureringskomponenten/
├── felles/          # Shared utilities (GenericAuthFilterFactory, error/MDC filters)
├── hendelser/       # Kafka producer (melosys-hendelser)
├── inngangsvilkar/  # Entry requirements
├── inntekt/         # Income data
├── joark/           # Document archive
├── kafka/           # Kafka config
├── kodeverk/        # Reference data (impl/)
├── medl/            # Membership register
├── melosysskjema/   # melosys-skjema-api client
├── popp/            # Pension (POPP) producer
├── sak/             # Case system
├── soknadmottak/    # Altinn intake
├── tilgangsmaskinen/# Access control
├── trygdeavgift/    # Tax calculations
└── utbetaling/      # Payment data

integrasjon/src/main/java/no/nav/melosys/integrasjon/
├── dokgen/          # DokgenClient
├── doksys/          # Dokumentproduksjon (SOAP)
├── dokumentmottak/  # Document intake
├── eessi/
├── felles/          # AzureContextExchangeFilter, BasicAuthAware
├── joark/           # JoarkFasade/JoarkService + saf/ (SafClient)
├── oppgave/         # OppgaveFasade + konsument/
├── pdl/             # PDLClient/PDLClientImpl (GraphQL)
└── reststs/         # SecurityTokenServiceClient (STS)

Common Patterns

Creating a New REST Client

Pattern (trimmed) based on OrganisasjonRestClient / OrganisasjonRestClientConfig:

// 1. The client wraps an injected WebClient
open class MyServiceClient(private val webClient: WebClient) {
    fun hentData(id: String): MyResponse =
        webClient.get().uri("/api/v1/data/{id}", id)
            .accept(MediaType.APPLICATION_JSON)
            .retrieve()
            .bodyToMono<MyResponse>()
            .block() ?: throw TekniskException("MyService respons er null")
}

// 2. A @Configuration builds the WebClient bean with the auth + error filters
@Configuration
class MyServiceClientConfig(
    @Value("\${myservice.url}") private val url: String,
    private val genericAuthFilterFactory: GenericAuthFilterFactory,
) {
    @Bean
    fun myServiceClient(
        webClientBuilder: WebClient.Builder,
    ) = MyServiceClient(
        webClientBuilder
            .baseUrl(url)
            .filter(genericAuthFilterFactory.getAzureFilter(CLIENT_NAME)) // omit if in-cluster/no auth
            .filter(errorFilter("Kall mot MyService feilet."))
            .build()
    )

    companion object { private const val CLIENT_NAME = "my-service" }
}

Error Handling

// The shared errorFilter (no.nav.melosys.integrasjon.felles) maps non-2xx responses
// to the right exception; clients throw TekniskException / IkkeFunnetException
// (no.nav.melosys.exception) on null/unexpected bodies. IntegrasjonException also exists.
.filter(errorFilter("Henting av organisasjon fra ereg feilet"))

// Retry with Spring Retry — used as a bare class/interface-level annotation
@Retryable
open class InntektClient(private val webClient: WebClient) { ... }

Caching

// Cache external responses with @Cacheable. Cache names actually in use:
// "kodeverk" (KodeverkRegisterImpl, integrasjon) and "tilgangsmaskinen"
// (TilgangsmaskinenService, service module).
@Cacheable("kodeverk")
fun hentKodeverk(...): ...

Local Development

All external services are mocked via melosys-docker-compose:

  • Mock server: http://localhost:8083
  • Swagger: http://localhost:8083/swagger-ui/
  • Kafka UI: http://localhost:8087

Troubleshooting

IssueCheck
401/403 errorsToken scope, audience, expiry
Connection refusedVPN, firewall, service URL
TimeoutIncrease timeout, check service health
DeserializationResponse format, missing fields

See individual skill files for detailed service documentation:

  • /person - PDL patterns
  • /eessi-eux - EESSI/RINA integration
  • /oppgave - Task management
  • /journalforing - Document archiving
  • /medl - Membership register

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Expert knowledge of Altinn A1 application processing for posted workers in melosys-api. Use when: (1) Understanding Altinn søknad/skjema processing, (2) Debugging MedlemskapArbeidEOS form mapping, (3) Understanding SoeknadMapper transformations, (4) Investigating posted worker application issues, (5) Understanding the MOTTAK_SOKNAD_ALTINN saga flow.

The English summary is being prepared. Showing the original description.

navikt/melosys-api2Updated Oct 21, 2026

Expert knowledge of Employer/Employment integration (EREG/AAREG) in melosys-api. Use when: (1) Working with organization data from EREG (Enhetsregisteret), (2) Working with employment data from AAREG (Arbeidsforhold), (3) Understanding employer/organization lookup, (4) Debugging employer or employment issues, (5) Understanding the mapping between register data and domain models. Triggers: orgnummer, arbeidsforhold, EREG, AAREG, Enhetsregisteret, registeropplysninger, ansettelsesperiode, saksopplysning.

The English summary is being prepared. Showing the original description.

navikt/melosys-api2Updated Oct 21, 2026

Modular monolith architecture overview for melosys-api. Use when needing to understand module structure, dependencies between modules, where to place new code, or when changes in one module might affect others. Triggers: "architecture", "module dependencies", "where should I put", "which modules", "dependency graph".

The English summary is being prepared. Showing the original description.

navikt/melosys-api2Updated Oct 21, 2026

Expert knowledge of Behandling (case treatment) domain in melosys-api. Use when: (1) Understanding the behandling lifecycle and status transitions, (2) Debugging issues with behandling creation, status changes, or closure, (3) Understanding relationships between Fagsak, Behandling, and Behandlingsresultat, (4) Investigating why a behandling is stuck or has wrong status, (5) Understanding Behandlingstyper, Behandlingstema, Behandlingsstatus enums, (6) Debugging journalføring or SED-triggered behandling creation, (7) Understanding behandling creation via saksflyt sagas.

The English summary is being prepared. Showing the original description.

navikt/melosys-api2Updated Oct 21, 2026

Expert knowledge of Behandlingsresultat (treatment result) domain in melosys-api. Use when: (1) Understanding result types and their meaning (FASTSATT_LOVVALGSLAND, MEDLEM_I_FOLKETRYGDEN, etc.), (2) Working with periods - Lovvalgsperiode, Medlemskapsperiode, Anmodningsperiode, Utpekingsperiode, (3) Debugging vedtak/decision metadata, criteria evaluation, or social insurance charges, (4) Understanding EU/EEA coordination logic and Article 16 exception handling, (5) Working with trygdeavgift (social insurance charge) calculations.

The English summary is being prepared. Showing the original description.

navikt/melosys-api2Updated Oct 21, 2026

brev

Free

Expert knowledge of Brev (letter generation) in melosys-api. Use when: (1) Producing letters and decision documents (vedtaksbrev), (2) Understanding Dokgen templates and mapping, (3) Configuring letter recipients and distribution, (4) Debugging letter generation issues, (5) Adding new letter types or templates.

The English summary is being prepared. Showing the original description.

navikt/melosys-api2Updated Oct 21, 2026

See all skills by navikt

Report a problem with this skill