You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Johannes Elsinghorst <Jo...@gmx.net> on 2008/10/04 11:24:39 UTC

BPEL vs ContentEnricher Pattern

Hi,

I need to enrich a message sent to a web service with a security token.
This token is obtained by calling another webservice first.
So, in theory i have to enrich the actual message with the token, but
how can i do that using eip (either camel or smx)? Is there an easy way?
I do not want to write a java bean that is responsible for calling the
token service or something like that. I could do it via a bpel process,
but that
 looks kind of overkill to me. So, can someone point me in the right
direction?

cheers, Johannes

Re: BPEL vs ContentEnricher Pattern

Posted by Guillaume Nodet <gn...@gmail.com>.
Feel free to raise a JIRA issue and attach your patch if you want to
contribute it back to the community ...

On Thu, Oct 16, 2008 at 6:54 PM, Johannes Elsinghorst
<Jo...@gmx.net> wrote:
> Hi,
> i actually patched the contentenricher, so that it works with InOut MEPs
> also, so i dont need the async-bridge in 3.2.2 anymore...
>
> cheers, Johannes
>> Hi,
>> just tried to get it running, but recognized that the async-bridge is
>> not  available in 3.2.2 :-(
>> Found an earlier posting on the list about it where it was suggested to
>> use servicemix-shared-4.0-SNAPSHOT and servicemix-eip-4.0-SNAPSHOT and
>> deploy them in a 3.2.x jbi container.
>> Well, how would i do this? Where do i get them, and what do i need to
>> change in my su's and sa's? Just changing
>> <servicemix-version>3.2.2</servicemix-version> to
>> <servicemix-version>4.0-SNAPSHOT</servicemix-version>?
>>
>> cheers, Johannes
>>
>>> It would make sense to enhance the ContentEnricher to support InOut
>>> meps to get rid of the async bridge and one of the pipeline.
>>>
>>> On Wed, Oct 8, 2008 at 11:48 AM, Lukasz L. <Lu...@sabre.com> wrote:
>>>
>>>
>>>> On logical level yes, but you have some 'routing mistakes', Content Enricher
>>>> target is inonly so you won't get response from XSLT in this way, don't know
>>>> which XSLT you use but suppose you'll use Saxon
>>>> (http://servicemix.apache.org/servicemix-saxon.html) your flow could look
>>>> like this (in case you want to get response from actual service which I
>>>> suppose is your case):
>>>> [it may seem like complicated routing but it is necessary becasue of MEPs
>>>> differences]
>>>>
>>>> <eip:async-bridge service="test:AsyncBridge" endpoint="AsyncBridgeEndpoint"
>>>>  <eip:target>
>>>>    <eip:exchange-target service="test:contentEnricher" />
>>>>  </eip:target>
>>>> </eip:async-bridge>
>>>>
>>>> <eip:content-enricher service="test:contentEnricher" endpoint="endpoint">
>>>>  <eip:enricherTarget>
>>>>    <eip:exchange-target service="test:TokenService" />
>>>>  </eip:enricherTarget>
>>>>  <eip:target>
>>>>    <eip:exchange-target service="test:XSLTpipeline" />
>>>>  </eip:target>
>>>> </eip:content-enricher>
>>>>
>>>> <eip:pipeline service="test:XSLTpipeline" endpoint="endpoint">
>>>>  <eip:transformer>
>>>>    <eip:exchange-target service="test:XSLT" />
>>>>  </eip:transformer>
>>>>  <eip:target>
>>>>    <eip:exchange-target service="test:ASpipeline" />
>>>>  </eip:target>
>>>> </eip:pipeline>
>>>>
>>>> <eip:pipeline service="test:ASpipeline" endpoint="endpoint">
>>>>  <eip:transformer>
>>>>    <eip:exchange-target service="test:theActualService" />
>>>>  </eip:transformer>
>>>>  <eip:target>
>>>>    <eip:exchange-target service="test:asyncBridge" />
>>>>  </eip:target>
>>>> </eip:pipeline>
>>>>
>>>>
>>>> JMan_JE wrote:
>>>>
>>>>
>>>>> Maybe its not to bad at all :-) If i got you right, i could do it like
>>>>> this:
>>>>>
>>>>> <eip:content-enricher service="test:contentEnricher" endpoint="endpoint">
>>>>>   <eip:enricherTarget>
>>>>>     <eip:exchange-target service="test:TokenService" />
>>>>>   </eip:enricherTarget>
>>>>>   <eip:target>
>>>>>     <eip:exchange-target service="test:xslt" />
>>>>>   </eip:target>
>>>>> </eip:content-enricher>
>>>>>
>>>>> <eip:static-routing-slip service="test:routingSlip" endpoint="endpoint">
>>>>>   <eip:targets>
>>>>>     <eip:exchange-target service="test:contentEnricher" />
>>>>>     <eip:exchange-target service="test:theActualService" />
>>>>>   </eip:targets>
>>>>> </eip:static-routing-slip>
>>>>>
>>>>> Right?
>>>>>
>>>>> cheers, Johannes
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> So why don't you use this concatenation offered by CE and do XSLT after
>>>>>> that
>>>>>> to insert what you want to the original message?
>>>>>> Other question, wha is the relation between original request and the
>>>>>> request
>>>>>> to token service?
>>>>>> Where are both of this request created?
>>>>>>
>>>>>>
>>>>>> JMan_JE wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>> Ok,
>>>>>>> in the case i write my own bean, i have to invoke the token service
>>>>>>> inside from my bean? I wouldn't really like that idea. Maybe bpel is
>>>>>>> just the better option in this case?
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>> --
>>>> View this message in context: http://www.nabble.com/BPEL-vs-ContentEnricher-Pattern-tp19810402p19875647.html
>>>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Re: BPEL vs ContentEnricher Pattern

Posted by Gert Vanthienen <ge...@skynet.be>.
Johannes,

ServiceMix SNAPSHOTs can be found at
http://people.apache.org/repo/m2-snapshot-repository/org/apache/servicemix/.
Unless you're using the 'mvn jbi:projectDeploy' command to deploy your SA
(most users don't use this), you do not necessarily have to change anything
in the Maven project.  You just have to replace the components in the
ServiceMix hotdeploy folder with the new ones.  After that, you can deploy
your SA with EIP SU containing the async bridge.

Regards,

Gert



JMan_JE wrote:
> 
> Hi,
> just tried to get it running, but recognized that the async-bridge is
> not  available in 3.2.2 :-(
> Found an earlier posting on the list about it where it was suggested to
> use servicemix-shared-4.0-SNAPSHOT and servicemix-eip-4.0-SNAPSHOT and
> deploy them in a 3.2.x jbi container.
> Well, how would i do this? Where do i get them, and what do i need to
> change in my su's and sa's? Just changing
> <servicemix-version>3.2.2</servicemix-version> to
> <servicemix-version>4.0-SNAPSHOT</servicemix-version>?
> 
> cheers, Johannes
>> It would make sense to enhance the ContentEnricher to support InOut
>> meps to get rid of the async bridge and one of the pipeline.
>>
>> On Wed, Oct 8, 2008 at 11:48 AM, Lukasz L. <Lu...@sabre.com>
>> wrote:
>>   
>>> On logical level yes, but you have some 'routing mistakes', Content
>>> Enricher
>>> target is inonly so you won't get response from XSLT in this way, don't
>>> know
>>> which XSLT you use but suppose you'll use Saxon
>>> (http://servicemix.apache.org/servicemix-saxon.html) your flow could
>>> look
>>> like this (in case you want to get response from actual service which I
>>> suppose is your case):
>>> [it may seem like complicated routing but it is necessary becasue of
>>> MEPs
>>> differences]
>>>
>>> <eip:async-bridge service="test:AsyncBridge"
>>> endpoint="AsyncBridgeEndpoint"
>>>  <eip:target>
>>>    <eip:exchange-target service="test:contentEnricher" />
>>>  </eip:target>
>>> </eip:async-bridge>
>>>
>>> <eip:content-enricher service="test:contentEnricher"
>>> endpoint="endpoint">
>>>  <eip:enricherTarget>
>>>    <eip:exchange-target service="test:TokenService" />
>>>  </eip:enricherTarget>
>>>  <eip:target>
>>>    <eip:exchange-target service="test:XSLTpipeline" />
>>>  </eip:target>
>>> </eip:content-enricher>
>>>
>>> <eip:pipeline service="test:XSLTpipeline" endpoint="endpoint">
>>>  <eip:transformer>
>>>    <eip:exchange-target service="test:XSLT" />
>>>  </eip:transformer>
>>>  <eip:target>
>>>    <eip:exchange-target service="test:ASpipeline" />
>>>  </eip:target>
>>> </eip:pipeline>
>>>
>>> <eip:pipeline service="test:ASpipeline" endpoint="endpoint">
>>>  <eip:transformer>
>>>    <eip:exchange-target service="test:theActualService" />
>>>  </eip:transformer>
>>>  <eip:target>
>>>    <eip:exchange-target service="test:asyncBridge" />
>>>  </eip:target>
>>> </eip:pipeline>
>>>
>>>
>>> JMan_JE wrote:
>>>     
>>>> Maybe its not to bad at all :-) If i got you right, i could do it like
>>>> this:
>>>>
>>>> <eip:content-enricher service="test:contentEnricher"
>>>> endpoint="endpoint">
>>>>   <eip:enricherTarget>
>>>>     <eip:exchange-target service="test:TokenService" />
>>>>   </eip:enricherTarget>
>>>>   <eip:target>
>>>>     <eip:exchange-target service="test:xslt" />
>>>>   </eip:target>
>>>> </eip:content-enricher>
>>>>
>>>> <eip:static-routing-slip service="test:routingSlip"
>>>> endpoint="endpoint">
>>>>   <eip:targets>
>>>>     <eip:exchange-target service="test:contentEnricher" />
>>>>     <eip:exchange-target service="test:theActualService" />
>>>>   </eip:targets>
>>>> </eip:static-routing-slip>
>>>>
>>>> Right?
>>>>
>>>> cheers, Johannes
>>>>
>>>>
>>>>
>>>>       
>>>>> So why don't you use this concatenation offered by CE and do XSLT
>>>>> after
>>>>> that
>>>>> to insert what you want to the original message?
>>>>> Other question, wha is the relation between original request and the
>>>>> request
>>>>> to token service?
>>>>> Where are both of this request created?
>>>>>
>>>>>
>>>>> JMan_JE wrote:
>>>>>
>>>>>         
>>>>>> Ok,
>>>>>> in the case i write my own bean, i have to invoke the token service
>>>>>> inside from my bean? I wouldn't really like that idea. Maybe bpel is
>>>>>> just the better option in this case?
>>>>>>
>>>>>>
>>>>>>
>>>>>>           
>>>>>         
>>>>
>>>>       
>>> --
>>> View this message in context:
>>> http://www.nabble.com/BPEL-vs-ContentEnricher-Pattern-tp19810402p19875647.html
>>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>>
>>>
>>>     
>>
>>
>>
>>   
> 
> 
> 


-----
---
Gert Vanthienen
http://gertvanthienen.blogspot.com
-- 
View this message in context: http://www.nabble.com/BPEL-vs-ContentEnricher-Pattern-tp19810402p20016808.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: BPEL vs ContentEnricher Pattern

Posted by Johannes Elsinghorst <Jo...@gmx.net>.
Hi,
i actually patched the contentenricher, so that it works with InOut MEPs
also, so i dont need the async-bridge in 3.2.2 anymore...

cheers, Johannes
> Hi,
> just tried to get it running, but recognized that the async-bridge is
> not  available in 3.2.2 :-(
> Found an earlier posting on the list about it where it was suggested to
> use servicemix-shared-4.0-SNAPSHOT and servicemix-eip-4.0-SNAPSHOT and
> deploy them in a 3.2.x jbi container.
> Well, how would i do this? Where do i get them, and what do i need to
> change in my su's and sa's? Just changing
> <servicemix-version>3.2.2</servicemix-version> to
> <servicemix-version>4.0-SNAPSHOT</servicemix-version>?
>
> cheers, Johannes
>   
>> It would make sense to enhance the ContentEnricher to support InOut
>> meps to get rid of the async bridge and one of the pipeline.
>>
>> On Wed, Oct 8, 2008 at 11:48 AM, Lukasz L. <Lu...@sabre.com> wrote:
>>   
>>     
>>> On logical level yes, but you have some 'routing mistakes', Content Enricher
>>> target is inonly so you won't get response from XSLT in this way, don't know
>>> which XSLT you use but suppose you'll use Saxon
>>> (http://servicemix.apache.org/servicemix-saxon.html) your flow could look
>>> like this (in case you want to get response from actual service which I
>>> suppose is your case):
>>> [it may seem like complicated routing but it is necessary becasue of MEPs
>>> differences]
>>>
>>> <eip:async-bridge service="test:AsyncBridge" endpoint="AsyncBridgeEndpoint"
>>>  <eip:target>
>>>    <eip:exchange-target service="test:contentEnricher" />
>>>  </eip:target>
>>> </eip:async-bridge>
>>>
>>> <eip:content-enricher service="test:contentEnricher" endpoint="endpoint">
>>>  <eip:enricherTarget>
>>>    <eip:exchange-target service="test:TokenService" />
>>>  </eip:enricherTarget>
>>>  <eip:target>
>>>    <eip:exchange-target service="test:XSLTpipeline" />
>>>  </eip:target>
>>> </eip:content-enricher>
>>>
>>> <eip:pipeline service="test:XSLTpipeline" endpoint="endpoint">
>>>  <eip:transformer>
>>>    <eip:exchange-target service="test:XSLT" />
>>>  </eip:transformer>
>>>  <eip:target>
>>>    <eip:exchange-target service="test:ASpipeline" />
>>>  </eip:target>
>>> </eip:pipeline>
>>>
>>> <eip:pipeline service="test:ASpipeline" endpoint="endpoint">
>>>  <eip:transformer>
>>>    <eip:exchange-target service="test:theActualService" />
>>>  </eip:transformer>
>>>  <eip:target>
>>>    <eip:exchange-target service="test:asyncBridge" />
>>>  </eip:target>
>>> </eip:pipeline>
>>>
>>>
>>> JMan_JE wrote:
>>>     
>>>       
>>>> Maybe its not to bad at all :-) If i got you right, i could do it like
>>>> this:
>>>>
>>>> <eip:content-enricher service="test:contentEnricher" endpoint="endpoint">
>>>>   <eip:enricherTarget>
>>>>     <eip:exchange-target service="test:TokenService" />
>>>>   </eip:enricherTarget>
>>>>   <eip:target>
>>>>     <eip:exchange-target service="test:xslt" />
>>>>   </eip:target>
>>>> </eip:content-enricher>
>>>>
>>>> <eip:static-routing-slip service="test:routingSlip" endpoint="endpoint">
>>>>   <eip:targets>
>>>>     <eip:exchange-target service="test:contentEnricher" />
>>>>     <eip:exchange-target service="test:theActualService" />
>>>>   </eip:targets>
>>>> </eip:static-routing-slip>
>>>>
>>>> Right?
>>>>
>>>> cheers, Johannes
>>>>
>>>>
>>>>
>>>>       
>>>>         
>>>>> So why don't you use this concatenation offered by CE and do XSLT after
>>>>> that
>>>>> to insert what you want to the original message?
>>>>> Other question, wha is the relation between original request and the
>>>>> request
>>>>> to token service?
>>>>> Where are both of this request created?
>>>>>
>>>>>
>>>>> JMan_JE wrote:
>>>>>
>>>>>         
>>>>>           
>>>>>> Ok,
>>>>>> in the case i write my own bean, i have to invoke the token service
>>>>>> inside from my bean? I wouldn't really like that idea. Maybe bpel is
>>>>>> just the better option in this case?
>>>>>>
>>>>>>
>>>>>>
>>>>>>           
>>>>>>             
>>>>>         
>>>>>           
>>>>       
>>>>         
>>> --
>>> View this message in context: http://www.nabble.com/BPEL-vs-ContentEnricher-Pattern-tp19810402p19875647.html
>>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>>
>>>
>>>     
>>>       
>>
>>   
>>     
>
>   


Re: BPEL vs ContentEnricher Pattern

Posted by Johannes Elsinghorst <Jo...@gmx.net>.
Hi,
just tried to get it running, but recognized that the async-bridge is
not  available in 3.2.2 :-(
Found an earlier posting on the list about it where it was suggested to
use servicemix-shared-4.0-SNAPSHOT and servicemix-eip-4.0-SNAPSHOT and
deploy them in a 3.2.x jbi container.
Well, how would i do this? Where do i get them, and what do i need to
change in my su's and sa's? Just changing
<servicemix-version>3.2.2</servicemix-version> to
<servicemix-version>4.0-SNAPSHOT</servicemix-version>?

cheers, Johannes
> It would make sense to enhance the ContentEnricher to support InOut
> meps to get rid of the async bridge and one of the pipeline.
>
> On Wed, Oct 8, 2008 at 11:48 AM, Lukasz L. <Lu...@sabre.com> wrote:
>   
>> On logical level yes, but you have some 'routing mistakes', Content Enricher
>> target is inonly so you won't get response from XSLT in this way, don't know
>> which XSLT you use but suppose you'll use Saxon
>> (http://servicemix.apache.org/servicemix-saxon.html) your flow could look
>> like this (in case you want to get response from actual service which I
>> suppose is your case):
>> [it may seem like complicated routing but it is necessary becasue of MEPs
>> differences]
>>
>> <eip:async-bridge service="test:AsyncBridge" endpoint="AsyncBridgeEndpoint"
>>  <eip:target>
>>    <eip:exchange-target service="test:contentEnricher" />
>>  </eip:target>
>> </eip:async-bridge>
>>
>> <eip:content-enricher service="test:contentEnricher" endpoint="endpoint">
>>  <eip:enricherTarget>
>>    <eip:exchange-target service="test:TokenService" />
>>  </eip:enricherTarget>
>>  <eip:target>
>>    <eip:exchange-target service="test:XSLTpipeline" />
>>  </eip:target>
>> </eip:content-enricher>
>>
>> <eip:pipeline service="test:XSLTpipeline" endpoint="endpoint">
>>  <eip:transformer>
>>    <eip:exchange-target service="test:XSLT" />
>>  </eip:transformer>
>>  <eip:target>
>>    <eip:exchange-target service="test:ASpipeline" />
>>  </eip:target>
>> </eip:pipeline>
>>
>> <eip:pipeline service="test:ASpipeline" endpoint="endpoint">
>>  <eip:transformer>
>>    <eip:exchange-target service="test:theActualService" />
>>  </eip:transformer>
>>  <eip:target>
>>    <eip:exchange-target service="test:asyncBridge" />
>>  </eip:target>
>> </eip:pipeline>
>>
>>
>> JMan_JE wrote:
>>     
>>> Maybe its not to bad at all :-) If i got you right, i could do it like
>>> this:
>>>
>>> <eip:content-enricher service="test:contentEnricher" endpoint="endpoint">
>>>   <eip:enricherTarget>
>>>     <eip:exchange-target service="test:TokenService" />
>>>   </eip:enricherTarget>
>>>   <eip:target>
>>>     <eip:exchange-target service="test:xslt" />
>>>   </eip:target>
>>> </eip:content-enricher>
>>>
>>> <eip:static-routing-slip service="test:routingSlip" endpoint="endpoint">
>>>   <eip:targets>
>>>     <eip:exchange-target service="test:contentEnricher" />
>>>     <eip:exchange-target service="test:theActualService" />
>>>   </eip:targets>
>>> </eip:static-routing-slip>
>>>
>>> Right?
>>>
>>> cheers, Johannes
>>>
>>>
>>>
>>>       
>>>> So why don't you use this concatenation offered by CE and do XSLT after
>>>> that
>>>> to insert what you want to the original message?
>>>> Other question, wha is the relation between original request and the
>>>> request
>>>> to token service?
>>>> Where are both of this request created?
>>>>
>>>>
>>>> JMan_JE wrote:
>>>>
>>>>         
>>>>> Ok,
>>>>> in the case i write my own bean, i have to invoke the token service
>>>>> inside from my bean? I wouldn't really like that idea. Maybe bpel is
>>>>> just the better option in this case?
>>>>>
>>>>>
>>>>>
>>>>>           
>>>>         
>>>
>>>       
>> --
>> View this message in context: http://www.nabble.com/BPEL-vs-ContentEnricher-Pattern-tp19810402p19875647.html
>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>
>>
>>     
>
>
>
>   


Re: BPEL vs ContentEnricher Pattern

Posted by Guillaume Nodet <gn...@gmail.com>.
It would make sense to enhance the ContentEnricher to support InOut
meps to get rid of the async bridge and one of the pipeline.

On Wed, Oct 8, 2008 at 11:48 AM, Lukasz L. <Lu...@sabre.com> wrote:
>
> On logical level yes, but you have some 'routing mistakes', Content Enricher
> target is inonly so you won't get response from XSLT in this way, don't know
> which XSLT you use but suppose you'll use Saxon
> (http://servicemix.apache.org/servicemix-saxon.html) your flow could look
> like this (in case you want to get response from actual service which I
> suppose is your case):
> [it may seem like complicated routing but it is necessary becasue of MEPs
> differences]
>
> <eip:async-bridge service="test:AsyncBridge" endpoint="AsyncBridgeEndpoint"
>  <eip:target>
>    <eip:exchange-target service="test:contentEnricher" />
>  </eip:target>
> </eip:async-bridge>
>
> <eip:content-enricher service="test:contentEnricher" endpoint="endpoint">
>  <eip:enricherTarget>
>    <eip:exchange-target service="test:TokenService" />
>  </eip:enricherTarget>
>  <eip:target>
>    <eip:exchange-target service="test:XSLTpipeline" />
>  </eip:target>
> </eip:content-enricher>
>
> <eip:pipeline service="test:XSLTpipeline" endpoint="endpoint">
>  <eip:transformer>
>    <eip:exchange-target service="test:XSLT" />
>  </eip:transformer>
>  <eip:target>
>    <eip:exchange-target service="test:ASpipeline" />
>  </eip:target>
> </eip:pipeline>
>
> <eip:pipeline service="test:ASpipeline" endpoint="endpoint">
>  <eip:transformer>
>    <eip:exchange-target service="test:theActualService" />
>  </eip:transformer>
>  <eip:target>
>    <eip:exchange-target service="test:asyncBridge" />
>  </eip:target>
> </eip:pipeline>
>
>
> JMan_JE wrote:
>>
>> Maybe its not to bad at all :-) If i got you right, i could do it like
>> this:
>>
>> <eip:content-enricher service="test:contentEnricher" endpoint="endpoint">
>>   <eip:enricherTarget>
>>     <eip:exchange-target service="test:TokenService" />
>>   </eip:enricherTarget>
>>   <eip:target>
>>     <eip:exchange-target service="test:xslt" />
>>   </eip:target>
>> </eip:content-enricher>
>>
>> <eip:static-routing-slip service="test:routingSlip" endpoint="endpoint">
>>   <eip:targets>
>>     <eip:exchange-target service="test:contentEnricher" />
>>     <eip:exchange-target service="test:theActualService" />
>>   </eip:targets>
>> </eip:static-routing-slip>
>>
>> Right?
>>
>> cheers, Johannes
>>
>>
>>
>>> So why don't you use this concatenation offered by CE and do XSLT after
>>> that
>>> to insert what you want to the original message?
>>> Other question, wha is the relation between original request and the
>>> request
>>> to token service?
>>> Where are both of this request created?
>>>
>>>
>>> JMan_JE wrote:
>>>
>>>> Ok,
>>>> in the case i write my own bean, i have to invoke the token service
>>>> inside from my bean? I wouldn't really like that idea. Maybe bpel is
>>>> just the better option in this case?
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/BPEL-vs-ContentEnricher-Pattern-tp19810402p19875647.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://open.iona.com

Re: BPEL vs ContentEnricher Pattern

Posted by "Lukasz L." <Lu...@sabre.com>.
On logical level yes, but you have some 'routing mistakes', Content Enricher
target is inonly so you won't get response from XSLT in this way, don't know
which XSLT you use but suppose you'll use Saxon
(http://servicemix.apache.org/servicemix-saxon.html) your flow could look
like this (in case you want to get response from actual service which I
suppose is your case):
[it may seem like complicated routing but it is necessary becasue of MEPs
differences]

<eip:async-bridge service="test:AsyncBridge" endpoint="AsyncBridgeEndpoint"
  <eip:target>
    <eip:exchange-target service="test:contentEnricher" />
  </eip:target>
</eip:async-bridge>

<eip:content-enricher service="test:contentEnricher" endpoint="endpoint">
  <eip:enricherTarget>
    <eip:exchange-target service="test:TokenService" />
  </eip:enricherTarget>
  <eip:target>
    <eip:exchange-target service="test:XSLTpipeline" />
  </eip:target>
</eip:content-enricher>

<eip:pipeline service="test:XSLTpipeline" endpoint="endpoint">
  <eip:transformer>
    <eip:exchange-target service="test:XSLT" />
  </eip:transformer>
  <eip:target>
    <eip:exchange-target service="test:ASpipeline" />
  </eip:target>
</eip:pipeline>

<eip:pipeline service="test:ASpipeline" endpoint="endpoint">
  <eip:transformer>
    <eip:exchange-target service="test:theActualService" />
  </eip:transformer>
  <eip:target>
    <eip:exchange-target service="test:asyncBridge" />
  </eip:target>
</eip:pipeline>


JMan_JE wrote:
> 
> Maybe its not to bad at all :-) If i got you right, i could do it like
> this:
> 
> <eip:content-enricher service="test:contentEnricher" endpoint="endpoint">
>   <eip:enricherTarget>
>     <eip:exchange-target service="test:TokenService" />
>   </eip:enricherTarget>
>   <eip:target>
>     <eip:exchange-target service="test:xslt" />
>   </eip:target>
> </eip:content-enricher>
> 
> <eip:static-routing-slip service="test:routingSlip" endpoint="endpoint">
>   <eip:targets>
>     <eip:exchange-target service="test:contentEnricher" />
>     <eip:exchange-target service="test:theActualService" />
>   </eip:targets>
> </eip:static-routing-slip>
> 
> Right?
> 
> cheers, Johannes
> 
> 
> 
>> So why don't you use this concatenation offered by CE and do XSLT after
>> that
>> to insert what you want to the original message?
>> Other question, wha is the relation between original request and the
>> request
>> to token service?
>> Where are both of this request created?
>>
>>
>> JMan_JE wrote:
>>   
>>> Ok,
>>> in the case i write my own bean, i have to invoke the token service
>>> inside from my bean? I wouldn't really like that idea. Maybe bpel is
>>> just the better option in this case?
>>>
>>>
>>>     
>>
>>   
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/BPEL-vs-ContentEnricher-Pattern-tp19810402p19875647.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: BPEL vs ContentEnricher Pattern

Posted by Johannes Elsinghorst <Jo...@gmx.net>.
Maybe its not to bad at all :-) If i got you right, i could do it like this:

<eip:content-enricher service="test:contentEnricher" endpoint="endpoint">
  <eip:enricherTarget>
    <eip:exchange-target service="test:TokenService" />
  </eip:enricherTarget>
  <eip:target>
    <eip:exchange-target service="test:xslt" />
  </eip:target>
</eip:content-enricher>

<eip:static-routing-slip service="test:routingSlip" endpoint="endpoint">
  <eip:targets>
    <eip:exchange-target service="test:contentEnricher" />
    <eip:exchange-target service="test:theActualService" />
  </eip:targets>
</eip:static-routing-slip>

Right?

cheers, Johannes



> So why don't you use this concatenation offered by CE and do XSLT after that
> to insert what you want to the original message?
> Other question, wha is the relation between original request and the request
> to token service?
> Where are both of this request created?
>
>
> JMan_JE wrote:
>   
>> Ok,
>> in the case i write my own bean, i have to invoke the token service
>> inside from my bean? I wouldn't really like that idea. Maybe bpel is
>> just the better option in this case?
>>
>>
>>     
>
>   


Re: BPEL vs ContentEnricher Pattern

Posted by "Lukasz L." <Lu...@sabre.com>.
So why don't you use this concatenation offered by CE and do XSLT after that
to insert what you want to the original message?
Other question, wha is the relation between original request and the request
to token service?
Where are both of this request created?


JMan_JE wrote:
> 
> Ok,
> in the case i write my own bean, i have to invoke the token service
> inside from my bean? I wouldn't really like that idea. Maybe bpel is
> just the better option in this case?
> 
> 

-- 
View this message in context: http://www.nabble.com/BPEL-vs-ContentEnricher-Pattern-tp19810402p19852815.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: BPEL vs ContentEnricher Pattern

Posted by Johannes Elsinghorst <Jo...@gmx.net>.
Ok,
in the case i write my own bean, i have to invoke the token service
inside from my bean? I wouldn't really like that idea. Maybe bpel is
just the better option in this case?

cheers, Johannes
> Content enerichment is a very generic pattern and the default one
> provided by11 servicemix-eip uses a very simple scheme which is to
> aggregate the original request and the response from the service
> called into a single message by concatenating them.
> If it does not suit your needs, as it seems to be the case, you should
> define your own aggregation strategy.  You can do that by extending
> the ContentEnricher class and overriding the needed methods.
> Actually, the ContentEnricher should be split into two classes, one
> would be AbstractContentEnricher that provides the JBI exchange
> processing and the current one would inherit the
> AbstractContentEnricher to provide the default and simple behavior
> (feel free to submit a patch for this if you want).  Btw, another
> enhancement for the ContentEnricher class would be to support sending
> exchanges asynchronously.
>
> Anyway, as the current class is not really extensible, you'd have to
> copy it, modify the enrichment logic and deploy it using the spring
> syntax instead of using the eip namespace:
>
> <beans>
>    <bean id="myEnricherEndpoint" class="youclass">
>      <property name="service" value="uri:service" />
>      <property name="endpoint" value="endpoint" />
>      ...
>    </bean>
> </beans>
>
>
>
> On Mon, Oct 6, 2008 at 5:51 PM, Johannes Elsinghorst
> <Jo...@gmx.net> wrote:
>   
>> Hi Lukasz,
>>
>>     
>>> Here's how ContentEnricher works on SM EIP:
>>> actually it is similar to pipeline but the response from transformation
>>> service is concatenated with the original request like:
>>> <root><orinalRequest>originalMessageContent</originalRequest><tranformerResponse>transformerResponse</transformerResponse>
>>> </root>
>>> (you can customize this tag by CE properties).
>>> Most propably you'll need to do XSLT after that (so CE alone rarely gives
>>> you all what you want).
>>>
>>>       
>> Yes, concatenation is not what i need.
>>     
>>> As for the token service you don't need to write a bean to call it. The
>>> easiest way to call external service is to use CXF Provider (or HTTP
>>> provider if you don't use SOAP).
>>>
>>>       
>> Yes, of  course. My Question was how would i insert the response from
>> the token service invokation into the invokation of the actual service.
>> In theory this should be done
>> via the content enrichment pattern. Or in bpel i would assign the
>> repsonse to a temp variable and use this in the following invokation.
>> How can i do this in a smx way?
>>
>> cheers, Johannes
>>     
>>> regards
>>> Lukasz
>>>
>>>
>>> JMan_JE wrote:
>>>
>>>       
>>>> Hi,
>>>>
>>>> I need to enrich a message sent to a web service with a security token.
>>>> This token is obtained by calling another webservice first.
>>>> So, in theory i have to enrich the actual message with the token, but
>>>> how can i do that using eip (either camel or smx)? Is there an easy way?
>>>> I do not want to write a java bean that is responsible for calling the
>>>> token service or something like that. I could do it via a bpel process,
>>>> but that
>>>>  looks kind of overkill to me. So, can someone point me in the right
>>>> direction?
>>>>
>>>> cheers, Johannes
>>>>
>>>>
>>>>
>>>>         
>>>       
>>     
>
>
>
>   


Re: BPEL vs ContentEnricher Pattern

Posted by Guillaume Nodet <gn...@gmail.com>.
Content enrichment is a very generic pattern and the default one
provided by servicemix-eip uses a very simple scheme which is to
aggregate the original request and the response from the service
called into a single message by concatenating them.
If it does not suit your needs, as it seems to be the case, you should
define your own aggregation strategy.  You can do that by extending
the ContentEnricher class and overriding the needed methods.
Actually, the ContentEnricher should be split into two classes, one
would be AbstractContentEnricher that provides the JBI exchange
processing and the current one would inherit the
AbstractContentEnricher to provide the default and simple behavior
(feel free to submit a patch for this if you want).  Btw, another
enhancement for the ContentEnricher class would be to support sending
exchanges asynchronously.

Anyway, as the current class is not really extensible, you'd have to
copy it, modify the enrichment logic and deploy it using the spring
syntax instead of using the eip namespace:

<beans>
   <bean id="myEnricherEndpoint" class="youclass">
     <property name="service" value="uri:service" />
     <property name="endpoint" value="endpoint" />
     ...
   </bean>
</beans>



On Mon, Oct 6, 2008 at 5:51 PM, Johannes Elsinghorst
<Jo...@gmx.net> wrote:
> Hi Lukasz,
>
>> Here's how ContentEnricher works on SM EIP:
>> actually it is similar to pipeline but the response from transformation
>> service is concatenated with the original request like:
>> <root><orinalRequest>originalMessageContent</originalRequest><tranformerResponse>transformerResponse</transformerResponse>
>> </root>
>> (you can customize this tag by CE properties).
>> Most propably you'll need to do XSLT after that (so CE alone rarely gives
>> you all what you want).
>>
> Yes, concatenation is not what i need.
>> As for the token service you don't need to write a bean to call it. The
>> easiest way to call external service is to use CXF Provider (or HTTP
>> provider if you don't use SOAP).
>>
> Yes, of  course. My Question was how would i insert the response from
> the token service invokation into the invokation of the actual service.
> In theory this should be done
> via the content enrichment pattern. Or in bpel i would assign the
> repsonse to a temp variable and use this in the following invokation.
> How can i do this in a smx way?
>
> cheers, Johannes
>> regards
>> Lukasz
>>
>>
>> JMan_JE wrote:
>>
>>> Hi,
>>>
>>> I need to enrich a message sent to a web service with a security token.
>>> This token is obtained by calling another webservice first.
>>> So, in theory i have to enrich the actual message with the token, but
>>> how can i do that using eip (either camel or smx)? Is there an easy way?
>>> I do not want to write a java bean that is responsible for calling the
>>> token service or something like that. I could do it via a bpel process,
>>> but that
>>>  looks kind of overkill to me. So, can someone point me in the right
>>> direction?
>>>
>>> cheers, Johannes
>>>
>>>
>>>
>>
>>
>
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://open.iona.com

Re: BPEL vs ContentEnricher Pattern

Posted by Johannes Elsinghorst <Jo...@gmx.net>.
Hi Lukasz,

> Here's how ContentEnricher works on SM EIP:
> actually it is similar to pipeline but the response from transformation
> service is concatenated with the original request like:
> <root><orinalRequest>originalMessageContent</originalRequest><tranformerResponse>transformerResponse</transformerResponse>
> </root>
> (you can customize this tag by CE properties).
> Most propably you'll need to do XSLT after that (so CE alone rarely gives
> you all what you want).
>   
Yes, concatenation is not what i need.
> As for the token service you don't need to write a bean to call it. The
> easiest way to call external service is to use CXF Provider (or HTTP
> provider if you don't use SOAP).
>   
Yes, of  course. My Question was how would i insert the response from
the token service invokation into the invokation of the actual service.
In theory this should be done
via the content enrichment pattern. Or in bpel i would assign the
repsonse to a temp variable and use this in the following invokation.
How can i do this in a smx way?

cheers, Johannes
> regards
> Lukasz
>
>
> JMan_JE wrote:
>   
>> Hi,
>>
>> I need to enrich a message sent to a web service with a security token.
>> This token is obtained by calling another webservice first.
>> So, in theory i have to enrich the actual message with the token, but
>> how can i do that using eip (either camel or smx)? Is there an easy way?
>> I do not want to write a java bean that is responsible for calling the
>> token service or something like that. I could do it via a bpel process,
>> but that
>>  looks kind of overkill to me. So, can someone point me in the right
>> direction?
>>
>> cheers, Johannes
>>
>>
>>     
>
>   


Re: BPEL vs ContentEnricher Pattern

Posted by "Lukasz L." <Lu...@sabre.com>.
Here's how ContentEnricher works on SM EIP:
actually it is similar to pipeline but the response from transformation
service is concatenated with the original request like:
<root><orinalRequest>originalMessageContent</originalRequest><tranformerResponse>transformerResponse</transformerResponse>
</root>
(you can customize this tag by CE properties).
Most propably you'll need to do XSLT after that (so CE alone rarely gives
you all what you want).

As for the token service you don't need to write a bean to call it. The
easiest way to call external service is to use CXF Provider (or HTTP
provider if you don't use SOAP).

regards
Lukasz


JMan_JE wrote:
> 
> Hi,
> 
> I need to enrich a message sent to a web service with a security token.
> This token is obtained by calling another webservice first.
> So, in theory i have to enrich the actual message with the token, but
> how can i do that using eip (either camel or smx)? Is there an easy way?
> I do not want to write a java bean that is responsible for calling the
> token service or something like that. I could do it via a bpel process,
> but that
>  looks kind of overkill to me. So, can someone point me in the right
> direction?
> 
> cheers, Johannes
> 
> 

-- 
View this message in context: http://www.nabble.com/BPEL-vs-ContentEnricher-Pattern-tp19810402p19834410.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.