]
Tom Fennelly closed JBESB-192.
------------------------------
Resolution: Out of Date
Listener implementations need to perform the payload to Message
wrapping, not the AbstractListener
--------------------------------------------------------------------------------------------------
Key: JBESB-192
URL:
http://jira.jboss.com/jira/browse/JBESB-192
Project: JBoss ESB
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Rosetta
Affects Versions: 4.2
Reporter: Tom Fennelly
Assigned To: Mark Little
Priority: Blocker
Fix For: 4.2
I may be missing something here but, I think there's an issue with the
Listeners/Action/Messages that probably requires more immediate attention.
The AbstractListener calls the receive method of its implementation (DirectoryPoller etc)
in order to get messages from the delivery channel associated with the implementation. At
the moment, the receive method returns an Object[] and AbstractListener does the job of
converting/wrapping these Objects into Message implementations before pushing the Message
instances through the associated pipeline for processing. The AbstractListener also
performs the job of triggering "lifecycle" events on the implementation i.e.
processingError and processingComplete. In order for these method implementations to
perform the appropriate "channel specific" tasks relating to the processing of
the message, they need access to "special" info that should be hidden in the
message and not accessible to anyone else other than that Listener impl. Hopefully this
will make more sense through an example....
The DirectoryPoller listens on the Filesystem for file based message. It manage the
lifecycle of these messages as follows:
1. Before it's receive method impl returns the java.io.File associated with the
message, it renames the file to "working" so that the file is not picked up for
processing again. In fact, it actually returns an extension of java.io.File (WorkingFile)
which contains "hidden" info that the Listener uses when message lifecycle
events are called (processingError and processingComplete).
2. In response to a call to it's "processingError" implementation, it
should get passed the original message object it returned from it's receive method
(WorkingFile). WorkingFile is a inner class to DirectoryPoller and it contains a few
private methods that only WorkingFile and DirectoryPoller can call. In the case of
processingError being called, the DirectoryPoller wants to call the private method
"renameToError".
3. In response to a call to it's "processingComplete" implementation,
the DirectoryPoller wants to call the private method "renameToDone".
The Issue:
The AbstractListener implementations should be doing the wrapping of the message payload
objects in the relevant Message implementations (not the AbstractListener itself as is
currently the case). This way, the channel specific listener implementation can add the
channel specific info it needs to the message before returning it for pipeline processing
(e.g. the rename to error/done file names etc in the case of the DirectoryPoller). This
also means that the receive method definition would need to be changed to return a
Message[] (instead of an Object[]) and the lifecycle management methods (processingError
and processingComplete) changed to take type Message (Vs type Object).
Without making these changes, the lifecycle info will very likely get lost in the
pipeline because it's currently being set on the Message body/payload, which will very
likely get changed during pipeline processing.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: