Skip to content

Commit

Permalink
fix: retries are incorrectly triggered due to deadlocked transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
MLenterman committed May 16, 2024
1 parent 0e76805 commit 8aad17e
Show file tree
Hide file tree
Showing 8 changed files with 103 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@
<!-- <Receiver
name="Handler_AddDocumentToCaseCommand"
transactionAttribute="RequiresNew"
pollInterval="1"
pollInterval="5"
maxRetries="0"
>
<MessageStoreListener
name="Handler_AddDocumentToCaseCommand"
slotId="${instance.name}/AddDocumentToCaseCommand"
peekUntransacted="true"
statusValueInProcess="I"
/>
</Receiver> -->

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
<Receiver
name="Handler_AddDocumentsToCaseCommand"
transactionAttribute="RequiresNew"
pollInterval="1"
maxRetries="1"
pollInterval="5"
maxRetries="0"
>
<MessageStoreListener
name="Handler_AddDocumentsToCaseCommand"
slotId="${instance.name}/AddDocumentsToCaseCommand"
peekUntransacted="true"
statusValueInProcess="I"
/>
</Receiver>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@
<!-- <Receiver
name="Handler_UpdateInitiatingSubjectGegMagCommand"
transactionAttribute="Required"
pollInterval="1"
maxRetries="1"
pollInterval="5"
maxRetries="0"
>
<MessageStoreListener
name="Handler_UpdateInitiatingSubjectGegMagCommand"
slotId="${instance.name}/UpdateInitiatingSubjectGegMagCommand"
peekUntransacted="true"
statusValueInProcess="I"
/>
</Receiver> -->

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@
<Receiver
name="UpdatePaymentCommandHandler"
transactionAttribute="RequiresNew"
pollInterval="1"
maxRetries="1"
pollInterval="5"
maxRetries="0"
>
<MessageStoreListener
name="UpdatePaymentCommandHandler"
slotId="${instance.name}/UpdatePaymentCommand"
peekUntransacted="true"
statusValueInProcess="I"
sessionKeys="CaseReferenceNumber,PaymentOrderId,PaymentDate"
/>
</Receiver>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@
<Receiver
name="WorkflowSelector"
transactionAttribute="Required"
pollInterval="1"
maxRetries="1"
pollInterval="5"
maxRetries="0"
>
<MessageStoreListener
name="WorkflowSelector"
slotId="${instance.name}/WorkflowSelector"
peekUntransacted="true"
statusValueInProcess="I"
/>
</Receiver>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@
<!-- <Receiver
name="Workflow_FallbackHandler"
transactionAttribute="Mandatory"
pollInterval="1"
maxRetries="1"
pollInterval="5"
maxRetries="0"
>
<MessageStoreListener
name="Workflow_FallbackHandler"
slotId="${instance.name}/Workflow_Fallback"
peekUntransacted="true"
statusValueInProcess="I"
/>
</Receiver> -->

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@
<!-- <Receiver
name="Workflow_TwoWayCommunicationHandler"
transactionAttribute="RequiresNew"
pollInterval="1"
maxRetries="1"
pollInterval="5"
maxRetries="0"
>
<MessageStoreListener
name="Workflow_TwoWayCommunicationHandler"
slotId="${instance.name}/Workflow_TwoWayCommunication"
peekUntransacted="true"
statusValueInProcess="I"
/>
</Receiver> -->

Expand Down Expand Up @@ -94,9 +96,44 @@
xpathExpression="string-length(//*:lookUpCaseIdsResponse/*:caseIdMessage/*:cases/*:case) gt 0"
>
<Forward name="then" path="CreateReadCasesRequestMessage" />
<Forward name="else" path="CaseNotFound_MailCondition" />
</XmlIfPipe>

<XmlIfPipe
name="CaseNotFound_MailCondition"
xpathExpression="string-length('${openforms2bpel.workflows.tweewegcommunicatie.on-case-not-found.mail-template}') gt 0"
>
<Forward name="then" path="CaseNotFound_StoreMailTemplateName" />
<Forward name="else" path="CaseNotFound_Exception" />
</XmlIfPipe>

<PutInSessionPipe
name="CaseNotFound_StoreMailTemplateName"
>
<Param name="TemplateName" value="${openforms2bpel.workflows.tweewegcommunicatie.on-case-not-found.mail-template}" />
<Forward name="success" path="CaseNotFound_SendNoReplyUserEmailCommand" />
</PutInSessionPipe>

<SenderPipe
name="CaseNotFound_SendNoReplyUserEmailCommand"
getInputFromSessionKey="UwGegevens"
transactionAttribute="Required"
>
<MessageStoreSender
name="CaseNotFound_SendNoReplyUserEmailCommandMessageStoreSender"
slotId="${instance.name}/SendNoReplyUserEmailCommand"
sessionKeys="TemplateName"
onlyStoreWhenMessageIdUnique="true"
transacted="true"
>
<Param name="messageId" xpathExpression="concat($CaseReferenceNumber, '-', $TargetCaseReferenceNumber)">
<Param name="TargetCaseReferenceNumber" sessionKey="CaseReferenceNumber" />
<Param name="CaseReferenceNumber" sessionKey="originalMessage" xpathExpression="/ZgwObject/public_reference" />
</Param>
</MessageStoreSender>
<Forward name="success" path="EXIT" />
</SenderPipe>

<ExceptionPipe name="CaseNotFound_Exception" />

<XsltPipe
Expand Down Expand Up @@ -165,10 +202,45 @@
<Param name="UwGegevensSubject" sessionKey="UwGegevensSubject" />
<Param name="CaseInitiatingSubject" sessionKey="CaseInitiatingSubject" />
<Forward name="then" path="CreateAddDocumentsToCaseCommand" />
<Forward name="else" path="UwGegevensSubjectIsNotCaseInitiatingSubject_Exception" />
<Forward name="else" path="SubjectNotEqualsCaseSubject_MailCondition" />
</XmlIfPipe>

<ExceptionPipe name="UwGegevensSubjectIsNotCaseInitiatingSubject_Exception" />
<XmlIfPipe
name="SubjectNotEqualsCaseSubject_MailCondition"
xpathExpression="string-length('${openforms2bpel.workflows.tweewegcommunicatie.on-subject-not-equals-case-subject.mail-template}') gt 0"
>
<Forward name="then" path="SubjectNotEqualsCaseSubject_StoreMailTemplateName" />
<Forward name="else" path="SubjectNotEqualsCaseSubject_Exception" />
</XmlIfPipe>

<PutInSessionPipe
name="SubjectNotEqualsCaseSubject_StoreMailTemplateName"
>
<Param name="TemplateName" value="${openforms2bpel.workflows.tweewegcommunicatie.on-subject-not-equals-case-subject.mail-template}" />
<Forward name="success" path="SubjectNotEqualsCaseSubject_SendNoReplyUserEmailCommand" />
</PutInSessionPipe>

<SenderPipe
name="SubjectNotEqualsCaseSubject_SendNoReplyUserEmailCommand"
getInputFromSessionKey="UwGegevens"
transactionAttribute="Required"
>
<MessageStoreSender
name="SubjectNotEqualsCaseSubject_SendNoReplyUserEmailCommandMessageStoreSender"
slotId="${instance.name}/SendNoReplyUserEmailCommand"
sessionKeys="TemplateName"
onlyStoreWhenMessageIdUnique="true"
transacted="true"
>
<Param name="messageId" xpathExpression="concat($CaseReferenceNumber, '-', $TargetCaseReferenceNumber)">
<Param name="TargetCaseReferenceNumber" sessionKey="CaseReferenceNumber" />
<Param name="CaseReferenceNumber" sessionKey="originalMessage" xpathExpression="/ZgwObject/public_reference" />
</Param>
</MessageStoreSender>
<Forward name="success" path="EXIT" />
</SenderPipe>

<ExceptionPipe name="SubjectNotEqualsCaseSubject_Exception" />

<XsltPipe
name="CreateAddDocumentsToCaseCommand"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@
<!-- <Receiver
name="Workflow_UwGegevensHandler"
transactionAttribute="RequiresNew"
pollInterval="1"
maxRetries="1"
pollInterval="5"
maxRetries="0"
>
<MessageStoreListener
name="Workflow_UwGegevensHandler"
slotId="${instance.name}/Workflow_UwGegevens"
peekUntransacted="true"
statusValueInProcess="I"
/>
</Receiver> -->

Expand Down

0 comments on commit 8aad17e

Please sign in to comment.