We help IT Professionals succeed at work.

create non blocking fifo file in java

prgeorge3383
prgeorge3383 asked
on
Medium Priority
1,369 Views
Last Modified: 2008-01-09
Hi,
  IS there any way to create non blocking fifo(like a pipe file) file in java
Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2016

Commented:
What are you going to do with it?

Author

Commented:
i am planning to write the parse xml data in to a pipe file and have another process read from it and load to the tables
CERTIFIED EXPERT
Top Expert 2016

Commented:
Hmm that may not be suitable for queueing, depending on the xml. Why not process it consecutively as opposed to concurrently?

Author

Commented:
will be parsing the xml data in toa pipe delimtted file and each record sperated by carriage return.....
loading in to tables is the slow part
must it be a file? which java version 1.5?

consider using queues instead....
CERTIFIED EXPERT
Top Expert 2016
Commented:
>>in toa pipe delimtted file

Why? Why not directly into the db?

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Top Expert 2004

Commented:
Hi prgeorge3383,

If you're using unix, you may use named pipe.
You can also use shell pipe :
   java -cp ... <yourclass> | ...

or use java.net.Socket

Commented:
You can do some thing like
a) the write process writes into different files, each file having a fixed number of xml parent elements. File names have their file numbers appended.
b) the parse process reads the already written files (based on last modified date or a number appended to the file name) .

The only latency here is the time when both the source and parse process vie for the same file, let the parse process wait, or write the file after a specified time elapses.

Author

Commented:
using mysql inmemory option now..... this seems quick and fast enough....
CERTIFIED EXPERT
Top Expert 2016

Commented:
:-)
lol
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.