Question

I have the following scenario:

Two Java applications use ActiveMQ for communication.They use a publisher/subscription model.

One application has some physical files, and the other one should request the file content. What is the best way of sending the file? One idea should be reading the file in memory in a byte array and to serializate the array, and send the file content in a message. Do you have any other ideas?

Thanks in advance.

Was it helpful?

Solution

Depends how big your files is? If they are not so big, then yeah you can transfer them as JMS messages.

If big files, you can use off-band. See this link also:

OTHER TIPS

You could always use the normal ways to distribute a file. I would not suggest using ways to transfer the whole file (email, copy, enclos the file in a message) but this depends on the usage of the file. Sharing a file would probably be the simplest and most efficient solution. You should also take into account, what are you going to do with this file. Do you want it to be randomly accessed? Do you really need to trasfer it as a whole?

You could also consider using Hadoop. Hadoop is a distributed system's framework which is oriented towards highly localized data. It also gives you have a distributed file system (HFS).

Hope I helped!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top