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

Exception when setting maxRetries to 0 #43

Closed
pavelrotek opened this issue Nov 5, 2020 · 9 comments
Closed

Exception when setting maxRetries to 0 #43

pavelrotek opened this issue Nov 5, 2020 · 9 comments
Assignees
Labels

Comments

@pavelrotek
Copy link
Contributor

When trying to send message with maxRetries set to 0 and outgoing dumper set, the following exception is thrown. Not for maxRetries > 0.

Caused by: java.lang.IllegalStateException: This should only be called for repeatable entities at com.helger.phase4.http.BasicHttpPoster._createDumpingHttpEntity(BasicHttpPoster.java:257) ~[phase4-lib-0.12.3-SNAPSHOT.jar:0.12.3-SNAPSHOT]

I think this didn't happened in 0.10.0.

@phax phax self-assigned this Nov 5, 2020
@phax phax added the bug label Nov 5, 2020
@phax
Copy link
Owner

phax commented Nov 5, 2020

Hi Pavel, do you eventually have the callstack for me?

@pavelrotek
Copy link
Contributor Author

Hi Peter, sure. It is there since fddf58d

Caused by: java.lang.IllegalStateException: This should only be called for repeatable entities at com.helger.phase4.http.BasicHttpPoster._createDumpingHttpEntity(BasicHttpPoster.java:257) ~[phase4-lib-0.12.3-SNAPSHOT.jar:0.12.3-SNAPSHOT] at com.helger.phase4.http.BasicHttpPoster.sendGenericMessageWithRetries(BasicHttpPoster.java:369) ~[phase4-lib-0.12.3-SNAPSHOT.jar:0.12.3-SNAPSHOT] at com.helger.phase4.client.AbstractAS4Client.sendMessageWithRetries(AbstractAS4Client.java:485) ~[phase4-lib-0.12.3-SNAPSHOT.jar:0.12.3-SNAPSHOT] at com.helger.phase4.sender.AS4BidirectionalClientHelper.sendAS4UserMessageAndReceiveAS4SignalMessage(AS4BidirectionalClientHelper.java:161) ~[phase4-lib-0.12.3-SNAPSHOT.jar:0.12.3-SNAPSHOT] at com.cgi.as4.gateway.ENTSOGMessageBuilder.sendMessage(ENTSOGMessageBuilder.java:114) ~[classes/:na] at com.cgi.as4.gateway.ENTSOGMessageSender.sendMessage(ENTSOGMessageSender.java:65) ~[classes/:na] at com.cgi.as4.gateway.rest.internal.SendController.lambda$0(SendController.java:40) ~[classes/:na] at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:118) ~[reactor-core-3.3.3.RELEASE.jar:3.3.3.RELEASE] at reactor.core.publisher.FluxSubscribeOnValue$ScheduledScalar.run(FluxSubscribeOnValue.java:178) ~[reactor-core-3.3.3.RELEASE.jar:3.3.3.RELEASE] at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:68) ~[reactor-core-3.3.3.RELEASE.jar:3.3.3.RELEASE] at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:28) ~[reactor-core-3.3.3.RELEASE.jar:3.3.3.RELEASE] at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[na:na] at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[na:na] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na] at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]

@phax
Copy link
Owner

phax commented Nov 5, 2020

Hi Pavel,
Okay key aspects to this problem are:

  • retry count is 0
  • you are trying to send a MIME formatted message
  • You have dumping enabled

I assume your ENTSOG builder derives from AbstractAS4UserMessageBuilderMIMEPayload?

=> I made a change that ensures the supplied entity is repeatable if retries are disabled but dumping is enabled. Thanks for pointing it out

@phax
Copy link
Owner

phax commented Nov 5, 2020

Wait for https://travis-ci.com/github/phax/phase4/jobs/428521352 to finish before pulling.
BR, Philip

@phax
Copy link
Owner

phax commented Nov 5, 2020

New SNAPSHOT is available (mvn -U ...)

@pavelrotek
Copy link
Contributor Author

Great.

I assume your ENTSOG builder derives from AbstractAS4UserMessageBuilderMIMEPayload?

Accoding to your question, the ENTSOG builder derives directly from AbstractAS4UserMessageBuilder not from AbstractAS4UserMessageBuilderMIMEPayload, because it is not possible to set custom usermessage attributes due to final keyword in

protected final void applyToUserMessage

ENTSOG needs to set ConversationId to "" in user message... Maybe make applyToUserMessage non final would be better?

phax added a commit that referenced this issue Nov 5, 2020
@phax
Copy link
Owner

phax commented Nov 5, 2020

Well with conversationID("") you can set the conversation ID to an empty string.
Nevertheless I made the method non-final.
hth

@phax
Copy link
Owner

phax commented Nov 5, 2020

So Pavel does it work as expected? Can I close this issue?

@pavelrotek
Copy link
Contributor Author

It works now. Thank you very much.

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

No branches or pull requests

2 participants