Not sure I fully understand what you have in mind. Just to make sure we’re on the same page, when it comes to guaranteed documents, the Broker never really gives a document to the IS. It simply puts a copy of the document on a trigger queue for the IS to pick up. That copy stays there until the IS acknowledges the document to the Broker, which happens in the event of one of these: 1) the document processes successfully, (2) a fatal error occurs, or (3) the maximum retry is reached on a transient error and the trigger is set to throw an exception.
What happened to you is option #3.
So, if I understood you correctly, passing a NACK to the Broker so it “gives” the document back to the IS is really no different than changing your trigger so that instead of throwing an exception, it should just keep retrying the message.
Unfortunately, you’re in a bit of a bind because you have one trigger for multiple web service providers, meaning that an unhealthy web service provider could inadvertently affect delivery to the other ones. For you, it would be great to be able to dynamically create a separate trigger/queue for each provider, but the Broker and IS are not well suited for this (unless we get into under-the-cover APIs, which I would avoid in this case). One product that would come in handy, as I stated previously, is TN, but I’m assuming you don’t have it.
With all this in mind, here are some high-level thoughts on ways you can try to mitigate this issue given your current design:
-
Increase the number of threads on the trigger. This would help minimize the issue because you would have more threads available to process messages for the healthy web services, while the other one is retrying. Of course, if you have X threads and you receive X documents destined for unhealthy web services, you’re stuck. So this would really only work if these types of issues are expected (1) to happen rarely and (2) to be resolved quickly. In this case, you’d probably want to change your trigger to keep retrying the message until it succeeds.
-
Turn on auditing on the trigger service so that you can resubmit errors from MWS. In this case, you can keep the trigger set to throw an exception on the last retry but you would then have to manually resubmit the failed document from MWS. I’m not a fan of this option because it’s manual and you could end up with lots of errors really quickly, making it a nightmare, but I figured I’d mention it just in case.
-
Add logic to your trigger service so that once you reach the last retry, you persist the document somewhere so it can be processed again later. A few options include:
a. Persisting it to the disk or to a database and adding a scheduled task to retry them periodically
b. Publishing them to a separate trigger queue. In other words, documents for web services that are misbehaving would be sent to a different trigger, which could very well execute the same exact service as the primary trigger, but they wouldn’t affect document processing for the healthy web services.
c. Re-publishing the same exact document again. This would put the document back in the same trigger queue but at the tail end, allowing other documents to process in between. If you take this option, you would probably want to add some mechanism to flag documents that were re-published X-number of times to make sure you don’t fall into an infinite loop.
These are just a few options. I’m sure we could come up with more if needed.
Good luck,
Percio
#Integration-Server-and-ESB#webMethods