holodeck-b2b / Holodeck-B2B

Holodeck B2B is an AS4 system-to-system messaging solution that implements the OASIS specifications for ebMS3 and it's AS4 profile. For more information visit the project website
http://holodeck-b2b.org
GNU General Public License v3.0
68 stars 36 forks source link

Duplicate message will generate a receipt even if the delivery is failed? #142

Closed tigran-a closed 1 year ago

tigran-a commented 1 year ago

Hi,

It seems that the duplicate detection considers previous messages both in DELIVERED and FAILURE state, and in both cases marks the user message as DUPLICATE https://github.com/holodeck-b2b/Holodeck-B2B/blob/73b5caf22ad04a965ef1874c12533523a726e63b/modules/holodeckb2b-core/src/main/java/org/holodeckb2b/core/receptionawareness/DetectDuplicateUserMessages.java#L108

Later, in CreateReceipt, there is no difference between DELIVERED and DUPLICATE state for receipt creation https://github.com/holodeck-b2b/Holodeck-B2B/blob/0af34579b1bbd7967e9493d5a3b47d7d2aedae34/modules/holodeckb2b-ebms3as4/src/main/java/org/holodeckb2b/as4/handlers/inflow/CreateReceipt.java#L97 and the new receipt will be sent in both cases.

Does it mean, that if the first user message failed to be delivered, and it receives a duplicate of it, a receipt will be sent anyway?

Thanks

sfieten commented 1 year ago

Yes, it can indeed happen that a Receipt is sent when the message was rejected earlier. As the sending MSH should have received an Error response on the earlier sent message the risk of this actually happening is probably low. But the issue still needs to fixed! Thanks for signalling this.