@@ -34,6 +34,7 @@ import gov.cdc.prime.router.report.ReportService
34
34
import org.apache.commons.lang3.StringUtils
35
35
import org.apache.logging.log4j.kotlin.Logging
36
36
import org.jooq.exception.DataAccessException
37
+ import java.util.Base64
37
38
38
39
class FHIRFunctions (
39
40
private val workflowEngine : WorkflowEngine = WorkflowEngine (),
@@ -204,7 +205,7 @@ class FHIRFunctions(
204
205
} catch (ex: SubmissionSenderNotFound ) {
205
206
// This is a specific error case that can occur while handling a report via the new Submission service
206
207
// In a situation that the sender is not found there is not enough information to record a report event
207
- // and we want a poison queue message to be immediately added so that the configuration can be fixed
208
+ // so, we want a poison queue message to be immediately added so that the configuration can be fixed
208
209
logger.error(ex)
209
210
val tableEntity = Submission (
210
211
ex.reportId.toString(),
@@ -220,7 +221,8 @@ class FHIRFunctions(
220
221
// that will not be resolved if the message is automatically retried
221
222
// Instead, the error is recorded as an event and message is manually inserted into the poison queue
222
223
val report = databaseAccess.fetchReportFile(messageContent.reportId)
223
- val poisonQueueMessageId = queueAccess.sendMessage(" ${messageContent.messageQueueName} -poison" , message)
224
+ val encodedMsg = Base64 .getEncoder().encodeToString(message.toByteArray())
225
+ val poisonQueueMessageId = queueAccess.sendMessage(" ${messageContent.messageQueueName} -poison" , encodedMsg)
224
226
fhirEngine.reportEventService.sendReportProcessingError(
225
227
ReportStreamEventName .PIPELINE_EXCEPTION ,
226
228
report,
0 commit comments