[
http://jira.jboss.com/jira/browse/JBESB-1568?page=comments#action_12400937 ]
Kevin Conner commented on JBESB-1568:
-------------------------------------
Checking the response from the copy should not alter the outcome of the rename method as
the subsequent renameTo of the temporary file should fail.
Also, multi-threaded FileGateways should not be possible, if you are seeing this then
there is a different issue.
Having multiple gateways look at the same directory should be possible though.
FileGateways are not safe when used with more than one thread
-------------------------------------------------------------
Key: JBESB-1568
URL:
http://jira.jboss.com/jira/browse/JBESB-1568
Project: JBoss ESB
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Transports
Affects Versions: 4.2.1 CP1
Reporter: Jiri Pechanec
Assigned To: Kevin Conner
Priority: Critical
Fix For: 4.2.1 CP2
Attachments: hpf.zip
See attached example.
Unzip it in quickstarts dir and do only deploy. The QS will create 200 files in input dir
and then will deploy the app. The app will process messages and notifie the console and
JMS queue/A.
The problem is that the numebr of processed messages is larger than the number of
received.
An example of output
12:03:28,188 INFO [STDOUT] ConsoleNotifier 2008/02/29 12:03:28.188<>
12:03:28,191 INFO [STDOUT] ConsoleNotifier 2008/02/29 12:03:28.191<Hello World In A
File 10>
12:03:28,194 INFO [STDOUT] ConsoleNotifier 2008/02/29 12:03:28.194<Hello World In A
File 94>
12:03:28,198 INFO [STDOUT] ConsoleNotifier 2008/02/29 12:03:28.198<Hello World In A
File 37>
12:03:28,201 INFO [STDOUT] ConsoleNotifier 2008/02/29 12:03:28.201<Hello World In A
File 150>
12:03:28,204 INFO [STDOUT] ConsoleNotifier 2008/02/29 12:03:28.204<>
12:03:28,208 INFO [STDOUT] ConsoleNotifier 2008/02/29 12:03:28.208<Hello World In A
File 19>
12:03:28,211 INFO [STDOUT] ConsoleNotifier 2008/02/29 12:03:28.211<>
The contains this messages
2008-02-29 12:03:28,434 DEBUG [org.jboss.soa.esb.util.FileUtil] Could not open input file
for reading
java.io.FileNotFoundException:
/home/jpechane/pokus/GAAS/jboss-as/samples/quickstarts/helloworld_perfile_action/build/dirs/input/MyInput132.dat
(No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at org.jboss.soa.esb.util.FileUtil.copyFile(FileUtil.java:89)
at org.jboss.soa.esb.util.FileUtil.renameTo(FileUtil.java:63)
at
org.jboss.soa.esb.listeners.gateway.FileGatewayListener.renameFile(FileGatewayListener.java:151)
at
org.jboss.soa.esb.listeners.gateway.AbstractFileGateway.setFileWorking(AbstractFileGateway.java:257)
at
org.jboss.soa.esb.listeners.gateway.AbstractFileGateway.onSchedule(AbstractFileGateway.java:147)
at
org.jboss.soa.esb.schedule.ScheduleProvider$ESBScheduledJob.execute(ScheduleProvider.java:217)
at org.quartz.core.JobRunShell.run(JobRunShell.java:203)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
The issue is due to buggy FileUtil class. The expected processing is
1) Find a file with message
2) Copy the file and rename add .processing extension
But if there are more threads then two can process the same file.
The issue is that copying file returns true/false which is ignored in FileUtil.renameTo
method. Delete old files also can fail and value is ignored. Thus the empty message is
generated and processed by ESB.
The FileGateway and FileUtils should be either revisited or documented as usable with
only one trhead over one dir.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira