Avatar billede fredand Forsker
07. november 2006 - 13:01 Der er 8 kommentarer og
1 løsning

How to monitor a file transfer process?

Hello!

Hope that you guys may comment this issue if you have the time.

We have a situation.

System A sends a file from X to Y in one webservice-process and at the same time it also sending a JMS-message through an other webservice-process.

The JMS-messages is a indication that the file has been transfered.

System B reads the JMS-message and should update a database with the transfered file.

How ever, the problem is that the JMS-message arrives before the file is completly transfered.

We do not seems to be able to change system A.

Is there a way to monitor if the file is completly transfered?
How would you solve this in best manner?

Best regards
Fredrik
Avatar billede simonvalter Praktikant
07. november 2006 - 18:12 #1
A bit impossible to give a good answer without knowing more about the problem, like why B needs to update the database, why it matters that the message arrives too fast etc... your probably the best one here to answer the question.

From the information you have given the only suggestion I can give is to let 'Y' tell 'B' about the file or let 'B' ask 'Y' about the file when it recieved the message.
Avatar billede fredand Forsker
07. november 2006 - 20:52 #2
Hello!

Thanks for you answer.

Yes I understand that it is very hard to answer this, but all comments is very welcome.

I guess that we need to implement it like:
'B' ask 'Y' about the file when it recieved the message.

Could I ask you, in a rough way, to explain or give some hints how you would do this.

For eg our B is a MDB that consumes the message.
If the file has not arrived, how would you perform the wait, and recheck in the best way?

Best regards and thakns alot again for you input.
Fredrik
Avatar billede arne_v Ekspert
08. november 2006 - 04:09 #3
if you can easily detect if the file transfer is completed (because file size is in
the JMS message or because you can scan the file), then you can just throw an EJBException if it is not complete

perfomance will not be good though
Avatar billede arne_v Ekspert
08. november 2006 - 04:11 #4
another approach would be to write a JCA connector that basically wait until the
transfer is complete (you don't really need any JCA funtionality, but the rules
for EJB's does not apply to JCA connectors so it is an easy way to workaround those
EJB restrictions)
Avatar billede arne_v Ekspert
08. november 2006 - 04:13 #5
a third approach would be

A---queue 1---middleman---queue 2---MDB on B

where the middleman has a logic like:

tx {
  get queue 1
  wait until file transfer is completed
  put queue 2
}

the middleman could be a thread started in a startup servlet (that is not nice
either, but the EJB restrictions does not apply to servlets either)
Avatar billede arne_v Ekspert
10. december 2006 - 01:10 #6
fredand ?
Avatar billede fredand Forsker
10. december 2006 - 10:16 #7
Hello!

Actually the customer suddenly turned 180 and wnated to do something else.

But please give a svar so I can reward you!

Best regards
Fredrik
Avatar billede arne_v Ekspert
10. december 2006 - 22:31 #8
me ?
Avatar billede fredand Forsker
11. december 2006 - 08:16 #9
Always!
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester