Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

16148: update FHIR reciever logic to be simpler #16370

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package gov.cdc.prime.router.azure.observability.event

import gov.cdc.prime.router.Report
import gov.cdc.prime.router.ReportId
import gov.cdc.prime.router.Topic
import gov.cdc.prime.router.azure.DatabaseAccess
import gov.cdc.prime.router.azure.db.enums.TaskAction
Expand Down Expand Up @@ -86,25 +85,6 @@ interface IReportStreamEventService {
initializer: ReportStreamReportProcessingErrorEventBuilder.() -> Unit,
)

/**
* Creates a general processing error event. This is not associated with a report or item.
*
* @param eventName the business event value from [ReportStreamEventName]
* @param pipelineStepName the pipeline step that is emitting the event
* @param error the error description
* @param submissionId the report id for the incoming report
* @param bodyUrl the blob url for the incoming report
* @param initializer additional data to initialize the creation of the event. See [AbstractReportStreamEventBuilder]
*/
fun sendSubmissionProcessingError(
eventName: ReportStreamEventName,
pipelineStepName: TaskAction,
error: String,
submissionId: ReportId,
bodyUrl: String,
initializer: ReportStreamReportProcessingErrorEventBuilder.() -> Unit,
)

/**
* Creates an item event from an [Report]
*
Expand Down Expand Up @@ -296,28 +276,6 @@ class ReportStreamEventService(
).send()
}

override fun sendSubmissionProcessingError(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This didn't align with how the other reports were going to work and likely would have led to confusion as this was inverting parameters compared to other builders

eventName: ReportStreamEventName,
pipelineStepName: TaskAction,
error: String,
submissionId: ReportId,
bodyUrl: String,
initializer: ReportStreamReportProcessingErrorEventBuilder.() -> Unit,
) {
ReportStreamReportProcessingErrorEventBuilder(
this,
azureEventService,
eventName,
submissionId,
bodyUrl,
theTopic = null,
pipelineStepName,
error
).apply(
initializer
).send()
}

override fun sendItemEvent(
eventName: ReportStreamEventName,
childReport: Report,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import gov.cdc.prime.router.fhirengine.engine.FHIRTranslator
import gov.cdc.prime.router.fhirengine.engine.FhirReceiveQueueMessage
import gov.cdc.prime.router.fhirengine.engine.PrimeRouterQueueMessage
import gov.cdc.prime.router.fhirengine.engine.ReportPipelineMessage
import gov.cdc.prime.router.fhirengine.engine.SubmissionSenderNotFound
import org.apache.commons.lang3.StringUtils
import org.apache.logging.log4j.kotlin.Logging
import org.jooq.exception.DataAccessException
Expand Down Expand Up @@ -156,6 +157,13 @@ class FHIRFunctions(
// DB connectivity issues that are resolved without intervention
logger.error(ex)
throw ex
} catch (ex: SubmissionSenderNotFound) {
// This is a specific exception that we handle when processing reports entering the pipeline via the
// submissions service
// A poison queue message should still be added to that the team can triage and fix the configuration
// but since there is no sender there is not enough information to generate a PIPELINE_EXCEPTION event
queueAccess.sendMessage("${messageContent.messageQueueName}-poison", message)
return emptyList()
} catch (ex: Exception) {
// We're catching anything else that occurs because the most likely cause is a code or configuration error
// that will not be resolved if the message is automatically retried
Expand Down
Loading