issue with mec AS2

You are here

issue with mec AS2

4 posts / 0 new
Last post
fpirillo
fpirillo's picture
issue with mec AS2

I have found an issue with mec AS2. Consider the following scenario:

You attempt to send a file and the file is enqueued, then the power goes out. The data you are attempting to send is now lost. Why?

This is because the file is physically deleted from the filesystem once the message has been add to the send queue for dispatch. If the transmission does not execute then the file is lost (it was already deleted)

For a "normal" user this is not much of an issue (unless they do not have another copy of the file) as they can always click the "File...Send file to partner"

However we are using this in a secnario where we are dumping data from our application to various trading partners' outbox folders, relying on the poll manager to snap up the files and send them off where they need to go. This is where our problem lies as our system generates the files that need to be sent on the fly, they are not files that reside permanently on the system and can be resent.

I have resolved the issue (the software now deletes the file from the outbox if and only if the transmission was successful). If you are interested in the bug fix, let me know and I can post it to this forum.

heller
heller's picture

fpirillo,

You are right. The queue is stored in memory only at the moment.

But what happens in your scenario if the next poll process occurs while the files are still not deleted from the outbox folder (may be seldom but possible under heavy load)?
We will think about a persistent queuing mechanism, thank you for this issue!

Regards
Heller

fpirillo
fpirillo's picture

If the files haven't been deleted from the outbox then the transmission was not successful or it was interrupted, so the files should remain in the outbox folder so thhe polling process can resume resume with the files that it has not yet sent successfully (the ones that haven't been deleted)

heller
heller's picture

In this case it could happen that a file will be taken twice. The poll process runs every 10s and a file will be enqueued twice if it still exists after this time in the outbox directory. A transmission could take more than 10s, e.g. if it contains large data or the connection speed is low.
In the upcoming build 13 of m-e-c as2 you could set up the poll interval per partner which would allow you to poll the directory every second, this would lead to a dangerous scenario in my opinion.

Is there anybody out who could give me a link to a easy-to-use, simple persistent java queue API?

Regards
Heller