You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by nev <je...@hotmail.com> on 2007/11/02 14:46:52 UTC

eip enrichment

I have an InOut message coming into my endpoint and I'm trying to enrich it
before it gets sent on to another endpoint.  When it reaches my
content-enricher endpoint, an UnsupportedOperationException gets thrown
saying that only InOnly and RobustInOnly are supported.  Does the enricher
pattern NOT work with InOut messages?

Here's the specific error I'm receiving:
java.lang.UnsupportedOperationException: Use an InOnly or RobustInOnly MEP

Here's my xbean.xml:
<?xml version="1.0" encoding="UTF-8" ?>
<beans xmlns:eip="http://servicemix.apache.org/eip/1.0">
    <eip:content-enricher service="flowService"
                          endpoint="flowServiceEndpoint">
      <eip:enricherTarget>
        <eip:exchange-target service="enricherService"
endpoint="enricherServiceEndpoint"/>
      </eip:enricherTarget>
      <eip:target>
        <eip:exchange-target service="eventService"
endpoint="eventServiceEndpoint"/>
      </eip:target>
    </eip:content-enricher>
</beans>

I've put code in my enricherServiceEndpoint and the code NEVER gets called. 
The exception is thrown before it event invokes my code.  What's going on? 
Can anyone help?  Has anyone gotten the enricher to work?

thanks!
Jeff
-- 
View this message in context: http://www.nabble.com/eip-enrichment-tf4737519s12049.html#a13547945
Sent from the ServiceMix - User mailing list archive at Nabble.com.


AW: eip enrichment

Posted by Kristian Köhler <Kr...@dmc.de>.
Hi

you can open an jira issue and attach our patch.

This is the URL:
http://issues.apache.org/activemq/browse/SM

Kristian

---
http://gaswerk.sourceforge.net

> -----Ursprüngliche Nachricht-----
> Von: nev [mailto:jeff_deppen@hotmail.com]
> Gesendet: Montag, 5. November 2007 00:49
> An: servicemix-users@geronimo.apache.org
> Betreff: Re: eip enrichment
> 
> 
> 
> Does anyone think it would be desirable to have this re-wrapping
> configurable?  I have made changes to support wrapping 
> configuration and
> would like to submit it for inclusion into servicemix....
> 
> ... what is the process for submitting changes ?
> 
> thanks
> jeff
> 
> 
> nev wrote:
> > 
> > After poking through the code, I found that 
> ComponentEnricher requires,
> > via instanceof, incoming message to be either InOnly or 
> RobustInOnly. 
> > (Not surprising given the error I was receiving.)  I 
> changed the incoming
> > message to be of type InOnly and got around this.
> > 
> > One other note of caution to anyone that wants to use the enricher: 
> > messages morphed by the enricher are automagically 
> rewrapped.  Here's the
> > javadoc from ComponentEnricher that explains the wrapping behavior:
> > /**
> >  * Combines two NormalizedMessages to one DOM Document. The
> >  * element Names are specified via the following properties:
> >  * enricherElementName, requestElementName, resultElementName
> >  *
> >  * Example:
> >  *    Content of Message1 :
> >  *
> >  *        <hello/>
> >  *
> >  *    Content of Message 2:
> >  *
> >  *            <message2/>
> >  *
> >  *    Result of this method a DOM Document containing the following:
> >  *
> >  *    <enricher>
> >  *      <request>
> >  *          <hello/>
> >  *      </request>
> >  *      <result>
> >  *          <message2/>
> >  *      </result>
> >  *    </enricher>
> >  *
> >  */
> > 
> > 
> > 
> > 
> > nev wrote:
> >> 
> >> I have an InOut message coming into my endpoint and I'm 
> trying to enrich
> >> it before it gets sent on to another endpoint.  When it reaches my
> >> content-enricher endpoint, an 
> UnsupportedOperationException gets thrown
> >> saying that only InOnly and RobustInOnly are supported.  Does the
> >> enricher pattern NOT work with InOut messages?
> >> 
> >> Here's the specific error I'm receiving:
> >> java.lang.UnsupportedOperationException: Use an InOnly or 
> RobustInOnly
> >> MEP
> >> 
> >> Here's my xbean.xml:
> >> <?xml version="1.0" encoding="UTF-8" ?>
> >> <beans xmlns:eip="http://servicemix.apache.org/eip/1.0">
> >>     <eip:content-enricher service="flowService"
> >>                           endpoint="flowServiceEndpoint">
> >>       <eip:enricherTarget>
> >>         <eip:exchange-target service="enricherService"
> >> endpoint="enricherServiceEndpoint"/>
> >>       </eip:enricherTarget>
> >>       <eip:target>
> >>         <eip:exchange-target service="eventService"
> >> endpoint="eventServiceEndpoint"/>
> >>       </eip:target>
> >>     </eip:content-enricher>
> >> </beans>
> >> 
> >> I've put code in my enricherServiceEndpoint and the code NEVER gets
> >> called.  The exception is thrown before it event invokes 
> my code.  What's
> >> going on?  Can anyone help?  Has anyone gotten the 
> enricher to work?
> >> 
> >> thanks!
> >> Jeff
> >> 
> > 
> > 
> 
> -- 
> View this message in context: 
http://www.nabble.com/eip-enrichment-tf4737519s12049.html#a13579377
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: eip enrichment

Posted by nev <je...@hotmail.com>.
Does anyone think it would be desirable to have this re-wrapping
configurable?  I have made changes to support wrapping configuration and
would like to submit it for inclusion into servicemix....

... what is the process for submitting changes ?

thanks
jeff


nev wrote:
> 
> After poking through the code, I found that ComponentEnricher requires,
> via instanceof, incoming message to be either InOnly or RobustInOnly. 
> (Not surprising given the error I was receiving.)  I changed the incoming
> message to be of type InOnly and got around this.
> 
> One other note of caution to anyone that wants to use the enricher: 
> messages morphed by the enricher are automagically rewrapped.  Here's the
> javadoc from ComponentEnricher that explains the wrapping behavior:
> /**
>  * Combines two NormalizedMessages to one DOM Document. The
>  * element Names are specified via the following properties:
>  * enricherElementName, requestElementName, resultElementName
>  *
>  * Example:
>  *    Content of Message1 :
>  *
>  *        <hello/>
>  *
>  *    Content of Message 2:
>  *
>  *            <message2/>
>  *
>  *    Result of this method a DOM Document containing the following:
>  *
>  *    <enricher>
>  *      <request>
>  *          <hello/>
>  *      </request>
>  *      <result>
>  *          <message2/>
>  *      </result>
>  *    </enricher>
>  *
>  */
> 
> 
> 
> 
> nev wrote:
>> 
>> I have an InOut message coming into my endpoint and I'm trying to enrich
>> it before it gets sent on to another endpoint.  When it reaches my
>> content-enricher endpoint, an UnsupportedOperationException gets thrown
>> saying that only InOnly and RobustInOnly are supported.  Does the
>> enricher pattern NOT work with InOut messages?
>> 
>> Here's the specific error I'm receiving:
>> java.lang.UnsupportedOperationException: Use an InOnly or RobustInOnly
>> MEP
>> 
>> Here's my xbean.xml:
>> <?xml version="1.0" encoding="UTF-8" ?>
>> <beans xmlns:eip="http://servicemix.apache.org/eip/1.0">
>>     <eip:content-enricher service="flowService"
>>                           endpoint="flowServiceEndpoint">
>>       <eip:enricherTarget>
>>         <eip:exchange-target service="enricherService"
>> endpoint="enricherServiceEndpoint"/>
>>       </eip:enricherTarget>
>>       <eip:target>
>>         <eip:exchange-target service="eventService"
>> endpoint="eventServiceEndpoint"/>
>>       </eip:target>
>>     </eip:content-enricher>
>> </beans>
>> 
>> I've put code in my enricherServiceEndpoint and the code NEVER gets
>> called.  The exception is thrown before it event invokes my code.  What's
>> going on?  Can anyone help?  Has anyone gotten the enricher to work?
>> 
>> thanks!
>> Jeff
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/eip-enrichment-tf4737519s12049.html#a13579377
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: eip enrichment

Posted by nev <je...@hotmail.com>.
After poking through the code, I found that ComponentEnricher requires, via
instanceof, incoming message to be either InOnly or RobustInOnly.  (Not
surprising given the error I was receiving.)  I changed the incoming message
to be of type InOnly and got around this.

One other note of caution to anyone that wants to use the enricher: 
messages morphed by the enricher are automagically rewrapped.  Here's the
javadoc from ComponentEnricher that explains the wrapping behavior:
/**
 * Combines two NormalizedMessages to one DOM Document. The
 * element Names are specified via the following properties:
 * enricherElementName, requestElementName, resultElementName
 *
 * Example:
 *    Content of Message1 :
 *
 *        <hello/>
 *
 *    Content of Message 2:
 *
 *            <message2/>
 *
 *    Result of this method a DOM Document containing the following:
 *
 *    <enricher>
 *      <request>
 *          <hello/>
 *      </request>
 *      <result>
 *          <message2/>
 *      </result>
 *    </enricher>
 *
 */




nev wrote:
> 
> I have an InOut message coming into my endpoint and I'm trying to enrich
> it before it gets sent on to another endpoint.  When it reaches my
> content-enricher endpoint, an UnsupportedOperationException gets thrown
> saying that only InOnly and RobustInOnly are supported.  Does the enricher
> pattern NOT work with InOut messages?
> 
> Here's the specific error I'm receiving:
> java.lang.UnsupportedOperationException: Use an InOnly or RobustInOnly MEP
> 
> Here's my xbean.xml:
> <?xml version="1.0" encoding="UTF-8" ?>
> <beans xmlns:eip="http://servicemix.apache.org/eip/1.0">
>     <eip:content-enricher service="flowService"
>                           endpoint="flowServiceEndpoint">
>       <eip:enricherTarget>
>         <eip:exchange-target service="enricherService"
> endpoint="enricherServiceEndpoint"/>
>       </eip:enricherTarget>
>       <eip:target>
>         <eip:exchange-target service="eventService"
> endpoint="eventServiceEndpoint"/>
>       </eip:target>
>     </eip:content-enricher>
> </beans>
> 
> I've put code in my enricherServiceEndpoint and the code NEVER gets
> called.  The exception is thrown before it event invokes my code.  What's
> going on?  Can anyone help?  Has anyone gotten the enricher to work?
> 
> thanks!
> Jeff
> 

-- 
View this message in context: http://www.nabble.com/eip-enrichment-tf4737519s12049.html#a13579374
Sent from the ServiceMix - User mailing list archive at Nabble.com.