Can Java interact with System V linux message queues?

I need to pass information from a shell script (called from a Linux based application) to a java application .

Named pipes are a pain because I cannot start / stop any service, without considering the complex consequences for the read / write ends for pipes.

Sockets are tough because if the listening process restarts, the queue mechanism is absent, and simple implementations require the constant creation of new sockets (otherwise the shell script will be very complicated with check-and-restart-socket and the queue code).

I recently read about these System V / POSIX linux message queues . I am running Fedora 12 and wondering if there is a way to configure these message queues and interact with them with Java .

+5
source share
1 answer

You cannot use them directly, you will need to do some JNI skill to bind them together.

What are your problems with Pipes? Java treats them as shared files. I did not use them extensively, but I did not have any real problems with Pipes. The only detail the pipe reader had was to constantly open the pipe if manufacturers could not keep up.

- , .

. , .

+1

All Articles