|
View:
New views
6 Messages
—
Rating Filter:
Alert me
|
|
|
dynamic recipients based on message contentI'm trying to configure an outbound endpoint through xmpp where the recipient will change based on the content on the message returned from a web service. I'm fairly new to mule so maybe there's an easy way to do this that I'm just not aware of. I know I could write my own custom output class that parses the message and outputs it but I was trying to do this just using the XML configuration file. Here's what my config file looks like. Thanks in advance.
<service name="JMBLWebServiceTest"> <inbound> <!--stdio:inbound-endpoint system="IN" /--> <xmpp:inbound-endpoint user="test" password="test" host="xxx.xxx.xxx.xxx" port="xxxx" recipient="input@xmpp-server" transformer-refs="XmppPacketToObject ObjectToString"/> </inbound> <outbound> <chaining-router> <cxf:outbound-endpoint address="http://localhost:63081/jmblService" wsdlPort="JMBLWebServiceImplPort" operation="handleRequest" /> <xmpp:outbound-endpoint name="serviceout" user="result" password="result" host="xxx.xxx.xxx.xxx" port="xxxx" recipient="xxxxxx" //should be extracted somehow from the incoming message....it's an XML string /> </chaining-router> </outbound> </service> --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
|
Re: dynamic recipients based on message contentCheck out StaticRecepientList
HTH, Andrew |
|
|
Re: dynamic recipients based on message contentYou could try using expressions too since the content is XML.
A Brian Hoolihan wrote: > I'm trying to configure an outbound endpoint through xmpp where the recipient will change based on the content on the message returned from a web service. I'm fairly new to mule so maybe there's an easy way to do this that I'm just not aware of. I know I could write my own custom output class that parses the message and outputs it but I was trying to do this just using the XML configuration file. Here's what my config file looks like. Thanks in advance. > > <service name="JMBLWebServiceTest"> > <inbound> > <!--stdio:inbound-endpoint system="IN" /--> > <xmpp:inbound-endpoint > user="test" > password="test" > host="xxx.xxx.xxx.xxx" > port="xxxx" > recipient="input@xmpp-server" transformer-refs="XmppPacketToObject ObjectToString"/> > </inbound> > <outbound> > <chaining-router> > <cxf:outbound-endpoint address="http://localhost:63081/jmblService" > wsdlPort="JMBLWebServiceImplPort" > operation="handleRequest" /> > <xmpp:outbound-endpoint > name="serviceout" > user="result" > password="result" > host="xxx.xxx.xxx.xxx" > port="xxxx" > recipient="xxxxxx" //should be extracted somehow from the incoming message....it's an XML string > /> > </chaining-router> > </outbound> > </service> > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > > > > -- Antoine Borg, Director of Services | Tel: +32 28 504 696 ricston Ltd., BP 2, 1180 Uccle, Brussels, BELGIUM See our full schedule of Mule and Android courses: http://www.ricston.com/courses/schedules/ email: _antoine.borg_@... <mailto:antoine.borg@...> | blog: blog.ricston.com <http://blog.ricston.com> | web: ricston.com <http://www.ricston.com/> --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
|
Re: dynamic recipients based on message contentSo, I've extracted the recipients name (jid) out of the message and set it as a property of the message. Now I'm having trouble referencing that property from the endpoint
<xmpp:outbound-endpoint name="serviceout" user="result" password="result" host="xxx.xxx.xxx.xxx" port="xxxx" recipient="#[jid]@mysystem" /> This yields the result of recipient="#name@mysystem" if I don't include the # then I get a parsing error when I start up saying that line is invalid The question is how can I access the message property I've set? I tried to run the expression (without setting a property) inline like this: recipient="#[jxpath:/response/@urn:clientRequestId]@mysystem" but that results was exactly the expression (like it didn't evaluate it, took like a string). Thanks. --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
|
Re: dynamic recipients based on message contentBrian Hoolihan wrote:
> So, I've extracted the recipients name (jid) out of the message and > set it as a property of the message. Now I'm having trouble > referencing that property from the endpoint > > <xmpp:outbound-endpoint name="serviceout" user="result" > password="result" host="xxx.xxx.xxx.xxx" port="xxxx" > recipient="#[jid]@mysystem" /> > > This yields the result of recipient="#name@mysystem" > > if I don't include the # then I get a parsing error when I start up > saying that line is invalid > > The question is how can I access the message property I've set? I > tried to run the expression (without setting a property) inline like > this: Short answer: won't work. The XMPP transport currently does not evaluate expressions on the endpoint's recipient address. Also, check if the XMPP transport actually works for you at all. Last time I checked the smack libs were way too old to be usable with any recent Jabber server. -dirk --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
|
Re: dynamic recipients based on message contentThanks. I did write my own custom transformer and it worked just fine. I was just trying to configure it using the built in XMPP transformer. Interesting enough I tried to implement something that was actually documented in the Mule In Action book and it didn't work. They showed examples of using expressions in outbound endpoints in the address attribute (which I tried). The basic problem (after stepping through the Mule source code in debug) is that parsing is performed on the configuration (XML) file at start up and then a different parser is run when you hit your outbound endpoint (and they are inconsistent). If you include #[message attribute] (which is what I was trying) the first parser likes this, but the second one will just assume the # is part of the URI and then just evaluate the expression in the [], thus yielding a #name as the result. If I didn't include the # the first parser fails at start up saying my XML is invalid.........catch 22
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
| Free embeddable forum powered by Nabble | Forum Help |