[jboss-dev-forums] [JBoss ESB Development] - Re: Check if header element exists in message Response.
Tom Fennelly
do-not-reply at jboss.com
Tue Nov 9 09:36:29 EST 2010
Tom Fennelly [http://community.jboss.org/people/tfennelly] created the discussion
"Re: Check if header element exists in message Response."
To view the discussion, visit: http://community.jboss.org/message/570273#570273
--------------------------------------------------------------
Hi Carlos... I got your private message... here's the answer...
Sounds like you have 2 issues... handling a large/huge message and conditionally adding a header element.
Handle the huge message by setting th filter type to SAX (default is DOM => can't handle big messages) See User Guide.
For conditionally adding the header... in the versions of Smooks in the ESB (easier in newer versions of Smooks)... easiest way is prob to do something like the following...
<smooks-resource-list xmlns=" http://www.milyn.org/xsd/smooks-1.1.xsd http://www.milyn.org/xsd/smooks-1.1.xsd" xmlns:jb=" http://www.milyn.org/xsd/smooks/javabean-1.2.xsd http://www.milyn.org/xsd/smooks/javabean-1.2.xsd">
<jb:bean beanId="headerDetails" class="java.util.HashMap" createOnElement="order/header">
<jb:value property="secureId" data="order/header/secureId" />
<jb:bean>
<ftl:freemarker applyOnElement="order/header">
<condition>isdef headerDetails.secureId</condition>
<ftl:template><!-- <secureId>blah</secureId> --></ftl:template>
<ftl:use>
<ftl:inline directive="addto" />
</ftl:use>
</ftl:freemarker>
</smooks-resource-list>
So.. capture details about the data in the header into a HasMap and then add a conditional on a template (having an "addto" directive) that's applied to the header fragment.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/570273#570273]
Start a new discussion in JBoss ESB Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2032]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20101109/8ad784ef/attachment.html
More information about the jboss-dev-forums
mailing list