Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No failure if AS2SenderModule._resend fails #7

Closed
jochenberger opened this issue Sep 1, 2015 · 11 comments
Closed

No failure if AS2SenderModule._resend fails #7

jochenberger opened this issue Sep 1, 2015 · 11 comments
Assignees

Comments

@jochenberger
Copy link
Collaborator

If I create a partnership with a wrong AS2 url and try to send a request, the handler logs some errors but returns instead of throwing an exception.
The logs contain

14:03:44.172 [qtp596512129-61] ERROR c.h.a.p.sender.AS2SenderModule - Error URL 'http://as2test:8080/as2/brokenurl' - HTTP 404 Not Found
14:03:44.172 [qtp596512129-61] ERROR c.h.a.p.sender.AS2SenderModule - Http Response Error Not Found
14:03:44.172 [qtp596512129-61] INFO  c.h.a.exception.OpenAS2Exception - OpenAS2Exception terminated: Not Found

Maybe AS2SenderModule._resend(IMessage, OpenAS2Exception, int) should rethrow the exception.

@phax
Copy link
Owner

phax commented Sep 1, 2015

I looked at the code, but I think the _resend you are mentioning simply does nothing. Will investigate.

@phax
Copy link
Owner

phax commented Sep 1, 2015

It does nothing because by default nTries delivers -1 (IProcessorSenderModule.DEFAULT_RETRIES) which is handled in doResend as don't resend.
Anyway I added the possibility to specify the retry count to the AS2ClientSettings.

Update: when specifying a retry count at the client, an NPE because of the missing MessageProcessor pops up.

@mreinigjr
Copy link
Collaborator

Hi Philip,

Is this option of resending also settable in the partnership or config file in as2-server?

Thanks,
Michael

@phax
Copy link
Owner

phax commented Sep 1, 2015

No. As far as I remember this is a setting of the sender module... Please file a separate issue to make this configurable per partnership. Anyway resending currently does not work when using the standalone client.

Am 01. September 2015 15:26:18 MESZ, schrieb Michael Reinig notifications@github.com:

Hi Philip,

Is this option of resending also settable in the partnership or config
file in as2-server?

Thanks,
Michael


Reply to this email directly or view it on GitHub:
#7 (comment)

Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.

Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.

@jochenberger
Copy link
Collaborator Author

Yes, there's an additional problem: -1 is treated as "don't retry" but "documented" as "retry forever" in IProcessorSenderModule.
However, I'm talking about something else. If the message could not be sent after the specified number of retries (which can also be 0), IMHO this should be an error condition and thus throw an exception. Currently. this seems to be ignored.
By the way, I don't use AS2Client*, I'm working with AS2Message and AS2SenderModule directly. AS2Client doesn't work well if you start from the payload and a Partnership.

@phax
Copy link
Owner

phax commented Sep 2, 2015

Okay, I changed the resend documentation now in a way so that "0" means no retries. I also added an "in-memory" resender module (InMemoryResenderModule) which also uses the polling mechanism but does not store the items to disk.

Additional I think that the retries happened forever and would never stop. Now, if the number of retries is exceeded, an exception is thrown.

Next thing to come is a synchronous resender that does not use polling but will resend in the same thread as the failed message.

@phax
Copy link
Owner

phax commented Sep 2, 2015

I now added an ImmediateResenderModule resender module that immediately tries to resend the message without persisting it on disk. If the retry count is exceeded the original exception is thrown.

@phax phax closed this as completed Sep 2, 2015
@jochenberger
Copy link
Collaborator Author

Sounds good, thank you. I'll try to test this soon, I'm currently quite busy with other things.

@phax phax self-assigned this Sep 3, 2015
@jochenberger
Copy link
Collaborator Author

I just gave it a spin, works fine. Thanks. Is there already a schedule for 2.2.0? :-)

@phax
Copy link
Owner

phax commented Sep 7, 2015

Excellent - good to hear.
There is no real schedule but I'd like to resolve phax/as2-server#15 before the relase. Even though it is a tricky one I'm quite optimistic that we can do it this week. Hope that's okay for you.

@jochenberger
Copy link
Collaborator Author

Sure, take your time. Thanks for the estimate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants