Skip to content

Commit

Permalink
payloadservice + ende navn på payload modulen
Browse files Browse the repository at this point in the history
  • Loading branch information
alpet committed Oct 23, 2023
1 parent 87a2c4b commit 3ed6686
Show file tree
Hide file tree
Showing 30 changed files with 5 additions and 881 deletions.
4 changes: 2 additions & 2 deletions .nais/payload-processor-dev.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: "nais.io/v1alpha1"
kind: "Application"
metadata:
name: "emottak-payload-processor"
name: "ebms-payload"
namespace: "team-emottak"
labels:
"team": "team-emottak"
Expand Down Expand Up @@ -31,7 +31,7 @@ spec:
cpu: "200m"
memory: "256Mi"
ingresses:
- "https://emottak-payload-processor.intern.dev.nav.no"
- "https://ebms-payload.intern.dev.nav.no"
accessPolicy:
outbound:
rules:
Expand Down
12 changes: 2 additions & 10 deletions ebms-provider/src/main/kotlin/no/nav/emottak/ebms/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import io.ktor.server.request.*
import io.ktor.server.response.*
import io.ktor.server.routing.*
import no.nav.emottak.ebms.model.*
import no.nav.emottak.ebms.processing.ProcessingService
import no.nav.emottak.ebms.validation.DokumentValidator
import no.nav.emottak.ebms.validation.MimeValidationException
import no.nav.emottak.ebms.validation.asParseAsSoapFault
Expand Down Expand Up @@ -77,16 +78,7 @@ fun Application.myApplicationModule() {

val message = ebMSDocument.buildEbmMessage()
try {
when (message) {
is EbmsAcknowledgment -> message.process()
is EbMSMessageError -> message.process()
is EbMSPayloadMessage -> {
when (val response = message.process()) {
is EbmsAcknowledgment -> response.toEbmsDokument().sendResponse(response.messageHeader)
is EbMSMessageError -> response.toEbmsDokument().sendErrorResponse(response.messageHeader)
}
}
}
ProcessingService().process(message)
} catch (e: Exception) {
call.application.environment.log.error(message.messageHeader.marker(), "Feil ved prosessering av melding", e)
call.respond(HttpStatusCode.InternalServerError, "Feil ved prosessering av melding")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,3 @@ fun EbMSDocument.buildEbmMessage(): EbMSBaseMessage {
EbMSPayloadMessage(this.dokument,header.messageHeader(),header.ackRequested(),this.attachments, LocalDateTime.now())
}
}

fun EbMSDocument.sendResponse(messageHeader: MessageHeader) {
log.info(messageHeader.marker(), "TODO return response message")
}
fun EbMSDocument.sendErrorResponse(messageHeader: MessageHeader) {
log.warn(messageHeader.marker(), "TODO return error response message")
}

This file was deleted.

54 changes: 0 additions & 54 deletions payload-processor/build.gradle.kts

This file was deleted.

82 changes: 0 additions & 82 deletions payload-processor/src/main/kotlin/no/nav/emottak/App.kt

This file was deleted.

27 changes: 0 additions & 27 deletions payload-processor/src/main/kotlin/no/nav/emottak/HealthRouting.kt

This file was deleted.

115 changes: 0 additions & 115 deletions payload-processor/src/main/kotlin/no/nav/emottak/melding/Processor.kt

This file was deleted.

Loading

0 comments on commit 3ed6686

Please sign in to comment.