Open GoogleCodeExporter opened 9 years ago
The issue was the DirectSOAPHandler was not clearing previous thread data
appropriately. Our solution fixes this, by clearing out the thread data in
handler for new inbound messages. Most of the thread data is overwritten by
setters, but for the recipients (To) the thread data is appended to if not
null. Lines 299 - 310 show this:
https://code.google.com/p/nhin-d/source/browse/java/xd-common/src/main/java/org/
nhindirect/xd/soap/DirectSOAPHandler.java?spec=svnabb446dfe7661e682afd68956c2412
19c996a2e0&r=e1ce83e6e98a07fdecbf7118a884dfaa553de66c#299
Our patch is on this class/method:
org.nhindirect.xd.soap.DirectSOAPHandler.handleMessage(SOAPMessageContext)
Just below the log of the inbound message, we add a clear:
LOGGER.info("Handling an inbound message");
// XDR-MULTIPLE-RECIPIENT-ISSUE - before handling the inbound case, we should clear
// out the old thread data if we don't this the To: (SMTP recipients) will
// append from the previous thread data
SafeThreadData.clean(Thread.currentThread().getId());
Original comment by marc...@mirthcorp.com
on 20 Nov 2014 at 4:57
Attachments:
Just to demonstrate this via a message flow:
Let's say we have a single thread processing back to back messages. Let's call
this Thread-123 and that thread is brand new thread.
XDR message:
* Message 1
* From: sender@foo.com
* To: recipient@foo.com
* Message 2
* From: sender@bar.com
* To: recipient@bar.com
SMTP out:
* Message 1
* From: sender@foo.com
* To: recipient@foo.com
* Message 2
* From: sender@bar.com
* To: recipient@foo.com
* To: recipient@bar.com
The issue is not with handling of multiple recipients, but rather, the thread
data is not being cleared out from message to message.
Original comment by marc...@mirthcorp.com
on 20 Nov 2014 at 6:52
Original comment by marc...@mirthcorp.com
on 20 Nov 2014 at 6:52
Original issue reported on code.google.com by
marc...@mirthcorp.com
on 20 Nov 2014 at 4:41