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.

有帮助吗?

解决方案

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:

其他提示

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!

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top