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
71 stars 36 forks source link

Have Holodeck write response from remote MSH to disk #85

Closed DJGummikuh closed 6 years ago

DJGummikuh commented 6 years ago

Hello! I'm currently trying to use Holodeck on a File-System only basis. For that to work properly I require Holodeck to give me a receipt for every File I try to transmit via it to a remote partner. Currently I only get a receipt when the remote partner successfully processes my message and a "Missing Receipt" message when no receipt was received at all. However, I would also like to get the error reports from the remote partner as file (e.g. PartyId or Role wrong etc). I already tried out the SignalDelivery plugin but could not figure out how to make it work properly. Also, I actually don't really know if that plugin is what I want in the first place. At the moment there are just too many screws to make adjustments to :-(

So if anybody could help me get my bearings it would be appreciated.

Attached is a configuration file I currently use for testing (why tf does Github not support XML natively?) p-mode-config.txt

sfieten commented 6 years ago

Hi, if you see that MissingReceipt are written to the specified folder the error notification is configured correctly and works since the MissingReceipt is just a specific instance of an error. So I wonder if the partner does send a (valid) Error response... If you require more assistance with this issue, we can offer consultancy services.

DJGummikuh commented 6 years ago

I did some debugging and have the feeling that there is a bug in your Error Signal handling. DeliverErrors.doProcessing checks if it can change the State for the Signal from READY_FOR_DELIVERY to OUT_FOR_DELIVERY - however since we're handling a REPLY to an already failed transmission the State is FAILURE. I'm trying to figure out what actually needs to happen here, still lacking too much of understanding for your code but apparently you should not only check for original state READY_FOR_DELIVERY but also FAILURE to accomodate handling of error signals from the receiving as4 implementation.

DJGummikuh commented 6 years ago

Short update: I replaced if(updateManager.setProcessingState(errorSignal, ProcessingState.READY_FOR_DELIVERY, ProcessingState.OUT_FOR_DELIVERY)) {

with if(updateManager.setProcessingState(errorSignal, ProcessingState.READY_FOR_DELIVERY, ProcessingState.OUT_FOR_DELIVERY) || updateManager.setProcessingState(errorSignal, ProcessingState.FAILURE, ProcessingState.OUT_FOR_DELIVERY)) {

And it satisfies both all your tests and is now allowing holodeck to handle error responses much the same way like MissingReceipt Errors.

sfieten commented 6 years ago

Yes, that might work. But it certainly isn't the correct way of doing it since you're now delivering all Errors, also the ones that are found to be invalid and should have failed. Please provide the information logged on the errors from the _ebmserrors.log_ and _soapin.log_ so I can check what may the issue here.

DJGummikuh commented 6 years ago

ebms_errors.log soap_in.log

Though what I don't get is, what is an "invalid" error in this constellation? False Positive? Because basically I want every error that occurs to be presented

sfieten commented 6 years ago

Invalid errors are for example error message that do not contain all required fields or which contain inconsistent references. As prescribed by the AS4 spec these should be rejected and therefore Holodeck B2B will not deliver them to the back-end. They might only cause inconsistent state.

I notice that the received errors are not logged in the _ebms_errors.log. This indicates that there processing has already failed earlier. It is therefore correct that no delivery takes place.

DJGummikuh commented 6 years ago

the Issue I have is however that this leaves my own application in limbo because Holodeck has actually received an error from the MSH which indicates that the message failed in delivery but does not tell me that until the MissingReceipt error is triggered. The question is how do I properly get notified in these cases that the communication is indeed over?

sfieten commented 6 years ago

The question is how do I properly get notified in these cases that the communication is indeed over?

In the scenario where the received Error is rejected, the MissingReceipt error is the only way and proper way to determine that the message exchange fails. If a valid Error would be received the back-end application is notified directly. So if you want quicker response, check with the communication partner why the Error is rejected.