Multiple Concurrent Peppol Senders #110
-
The tests in https://github.com/phax/phase4/tree/master/phase4-peppol-client/src/test/java/com/helger/phase4/peppol show example senders that start with:
If I add the WebScopeManager call to my DocumentSender class and I have two threads instantiate and use it at the same time I get an exception:
How should I arrange my classes and use of WebScopeManager to allow concurrent peppol sending? I'm guessing I might need to bind a |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@simon-temple please make sure the So if you run the sender in multiple threads, see for example this code snippet as an example: hth |
Beta Was this translation helpful? Give feedback.
@simon-temple please make sure the
WebScopeManager.onGlobalBegin (MockServletContext.create ());
(and the respective shutdown call) is only calles once per Java application.So if you run the sender in multiple threads, see for example this code snippet as an example:
https://github.com/phax/phase4/blob/master/phase4-peppol-client/src/test/java/com/helger/phase4/peppol/receivers/MainSendInParallelHelger.java
It refers to
MainPhase4PeppolSenderHelger.send
for the main action.hth