本文へ移動
cccskills
無料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".

日本語の概要は準備中です。原文の説明を表示しています。

連携ツールAzure
インストール方法を見る

含まれるファイル(1)

  • SKILL.md10.7 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

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

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

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.

日本語の概要は準備中です。原文の説明を表示しています。

navikt/melosys-api22026年10月21日 更新

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.

日本語の概要は準備中です。原文の説明を表示しています。

navikt/melosys-api22026年10月21日 更新

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".

日本語の概要は準備中です。原文の説明を表示しています。

navikt/melosys-api22026年10月21日 更新

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.

日本語の概要は準備中です。原文の説明を表示しています。

navikt/melosys-api22026年10月21日 更新

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.

日本語の概要は準備中です。原文の説明を表示しています。

navikt/melosys-api22026年10月21日 更新

brev

無料

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.

日本語の概要は準備中です。原文の説明を表示しています。

navikt/melosys-api22026年10月21日 更新

navikt のスキルをすべて見る

このスキルの問題を報告する