[Design of JBoss ESB] - Original file name as message property for File/FTP gateways
by derek.adams
I have some code that adds the originating filename as a property on messages coming from file or FTP gateways. In our business case, we needed to be able to take the original filename, modify it with a timestamp and use that as the filename on an outgoing FTP. Our solution was an action that executes a chain of strategies on the incoming filename, passing the end result to a NotifyFTP action. The config looks like this...
| <jbossesb parameterReloadSecs="5" xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml...">
| <providers>
| <jms-provider name="JBossMQ" connection-factory="ConnectionFactory" jndi-URL="localhost">
| <jms-bus busid="MyESBChannel">
| <jms-message-filter dest-name="queue/A" dest-type="QUEUE"/>
| </jms-bus>
| </jms-provider>
| <fs-provider name="MyFileProvider">
| <fs-bus busid="MyFileBus">
| <fs-message-filter directory="/temp" input-suffix=".esbdat" work-suffix=".esbInProcess" post-delete="true"
| post-directory="processed" post-suffix=".esbDone" error-delete="true" error-directory="processed" error-suffix=".esbERROR"/>
| </fs-bus>
| </fs-provider>
| <ftp-provider name="MyFtpProvider" hostname="localhost">
| <ftp-bus busid="MyFtpBus">
| <ftp-message-filter directory="/" username="anonymous" password="none" input-suffix=".esbdat" work-suffix=".esbInProcess"
| post-delete="true" post-directory="processed" post-suffix=".esbDone" error-delete="true" error-directory="processed"
| error-suffix=".esbERROR" passive="false" protocol="ftp"/>
| </ftp-bus>
| </ftp-provider>
| </providers>
| <services>
| <service category="FirstServiceESB" name="SimpleListener" description="Hello World">
| <listeners>
| <fs-listener name="InFromFile" busidref="MyFileBus" maxThreads="1" is-gateway="true" poll-frequency-seconds="3"/>
| <ftp-listener name="InFromFTP" busidref="MyFtpBus" maxThreads="1" is-gateway="true" poll-frequency-seconds="8"/>
| <jms-listener name="EsbListener" busidref="MyESBChannel" maxThreads="1" is-gateway="false"/>
| </listeners>
| <actions>
| <action name="BuildFilename" class="org.jboss.soa.esb.actions.naming.FileNameGeneratorAction">
| <property name="strategies" value="">
| <strategies>
| <strategy class="org.jboss.soa.esb.actions.naming.strategy.ChangeSuffixNamingStrategy" newSuffix="proc"/>
| <strategy class="org.jboss.soa.esb.actions.naming.strategy.AddTimestampNamingStrategy"/>
| </strategies>
| </property>
| </action>
| <action name="SendToFTP" class="org.jboss.soa.esb.actions.Notifier">
| <property name="okMethod" value="notifyOK"/>
| <property name="notification-details" value="">
| <NotificationList type="OK">
| <target class="NotifyFTP">
| <ftp URL="ftp://user:password@server.com/home/user" filename="{org.jboss.soa.esb.naming.result}"/>
| </target>
| </NotificationList>
| </property>
| </action>
| </actions>
| </service>
| </services>
| </jbossesb>
The FileNameGeneratorAction uses the message property for originating filename set in the gateway by default (can be changed via action props) and writes the result to a well-known message prop name. The NotifyFTP action picks up the result value and uses that as the filename it writes.
I figure that this may be helpful to other people with similar requirements, so I was wondering if I should check the code in. Alternatively, I can add a JIRA and attach the updates so people can take a look before it goes in the trunk.
Thanks,
Derek
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043770#4043770
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043770
17 years, 9 months
[Design of JBoss jBPM] - Re: including graphical information in the process definitio
by estaub
David,
anonymous wrote : I disagree - it's XML, and XML doesn't exist for human consumption.
Ideally true, but in practice, there's currently no alternative to reading the XML if you need to see both the big picture and some details at the same time.
A good example might be to consider the case where you're reading a process definition and want to understand the data flow through the process variables. Do you want to click on every node to see where each variable is used? How much longer would that take than searching the XML? Would you be willing to do two or three passes, looking for different details each time, as you might if you were searching the XML? If you had to open a dialog box for every node, how would your memory retention compare with doing a search through the XML?
I think it will be at least two years, if ever, before GPD is at a level where reading the XML isn't really necessary.
anonymous wrote : If you're using the GPD, then you shouldn't need to hand-edit the XML anyway.
|
Agreed, assuming the usability is good in all cases. But my concern is about reading, not writing. By way of analogy, imagine if you were using some UML-based code editor, and the only way it allowed you to see the source file was in a very modal fashion. You could navigate to a method and open it, but you couldn't scroll through the source. What would this do to your ability to see the big picture? If you ever tried VisualAge For Java, you've seen this.
anonymous wrote : I don't find it at all confusing to mix that information as illustrated above - using Facelets you do that all the time, sometimes with as many as 10 or more namespaces.
|
Given the overall goals of the project, I think the bar probably should be higher than "not confusing". The current schema is about as easy to read as it could possible be, and I think that, if possible, it should stay that way until GPD is far more advanced than it is now.
-Ed Staub
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043661#4043661
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043661
17 years, 9 months