You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by jc <jo...@gmail.com> on 2006/02/12 16:46:52 UTC

creating new connectors / invokers

Hello,

I'm currently working on a proof of concept where my intent is to insert SM
transparently between two systems that currently communicate via Web
services (SOAP). I've sucessfully used either the HttpConnector or
HttpSoapConnector to go from system a (the client) to SM, but i'm having
issues using the HttpInvoker to pass the SOAP message to system b (the
server). I understand now that I need to develop my own HttpConnector and
Invoker to perform this task since in order to make it transparent, the
original request must be passed on almost intact (kinda like a reverse
proxy).

However, how do I approach the development and deployment of these
connectors? For instance, say I have MyHttpConnector, which say subclasses
HttpConnector, where does it get deployed? can I jar it up and drop it in
%SERVICEMIX_HOME%/lib ?

Is this the right approach? Should I for example create JBI components
instead?

In a related question, are there plans to update the documentation for 3.0?
I would be willing to submit documentation patches, as I learn things :)

Thanks,
John

Re: creating new connectors / invokers

Posted by Guillaume Nodet <gu...@worldonline.fr>.

jc wrote:

>The new servicemix-http component is much more powerful wrt soap, so you
>  
>
>>may want to give
>>it a try...
>>    
>>
>I've been looking at it, but I haven't seen any if much documentation around
>it. Is there an example available? And what would it give me instead of the
>regular HttpConnector/ Invoker.
>  
>
I really need to do document it ...
If you use the HttpConnector / Invoker, stay with them.  The 
servicemix-http can handle soap and
ws-addressing for example, but if you don't need them ...

>>Standard JBI components are useful mainly if you plan to be able to add
>>/ remove / update components
>>at runtime.  You can also embed servicemix in your app, in which case,
>>using lightweight components
>>is easier ...
>>    
>>
>
>Which brings up another question. How do you configure the Spring managed
>JBI container?
>
>  
>
I'm not sure to follow.
The servicemix.xml file is loaded by spring (with pre-processing done by 
xbean) and you should
be able to use it from your spring config.
The 3.0-SNAPSHOT distribution has an example for creating a web app and 
embedding servicemix with spring.
See ./examples/servicemix-web ...

Cheers,
Guillaume Nodet


Re: creating new connectors / invokers

Posted by jc <jo...@gmail.com>.
Thanks for the reply!. Please see inline...

On 2/13/06, Guillaume Nodet <gu...@worldonline.fr> wrote:
>
>
>
> jc wrote:
> What are the limitations of the HttpInvoker you ran into ?
> When you say the request must be passed on almost intact, what are you
> refering to ?
> http headers, soap headers, ?


Well it's not really a limitation i suppose. In terms of the request it does
have to be passed HTTP headers, soap headers, etc, intact into the other
system, so that no changes would be required on either end, but I would
still get the benefit of starting to use the ESB in the mix. The other issue
is that the original Content Type is ignored.

What I ended up doing is subclassing the HttpMarshaler to include the
original URI as a property in the MessageExchange. Then writing a new
HttpInvoker to fetch that property, and insert it into the PostMethod
(commons http client) object. This essentially gave me a pass through
between the 2 systems, while still putting the messages through the bus.

What i've come to understand since then is that what I likelly need is to
create multiple invokers. I have several SOAP messages each with a unique
invocation target URI. If i create one invoker per SOAP message, and add an
additional routing component which determines which invoker to use, that
gives me the ability to have message specific interaction between the
systems and the bus. I haven't tried this yet, but it looks like the right
approach.

Again the intent would be to transparently introduce servicemix between
these 2 systems, so that I can then add other components which would act on
interesting messages.

The new servicemix-http component is much more powerful wrt soap, so you
> may want to give
> it a try...


I've been looking at it, but I haven't seen any if much documentation around
it. Is there an example available? And what would it give me instead of the
regular HttpConnector/ Invoker.



>However, how do I approach the development and deployment of these
> >connectors? For instance, say I have MyHttpConnector, which say
> subclasses
> >HttpConnector, where does it get deployed? can I jar it up and drop it in
> >%SERVICEMIX_HOME%/lib ?
> >
> >
> If you want to use servicemix standalone, just dropping the jar in the
> lib or optional directory should
> be fine.


In my attempt, thats basically what i did. I subclassed the classes I
needed, jared them and put them in /lib


>Is this the right approach? Should I for example create JBI components
> >instead?
> >
> >
> Standard JBI components are useful mainly if you plan to be able to add
> / remove / update components
> at runtime.  You can also embed servicemix in your app, in which case,
> using lightweight components
> is easier ...


Which brings up another question. How do you configure the Spring managed
JBI container?

Thanks,
John

>In a related question, are there plans to update the documentation for 3.0?
> >I would be willing to submit documentation patches, as I learn things :)
> >
> >
> Sure, there are plans, but please, fell free to add / update any doc you
> wish :)
>
> Cheers,
> Guillaume Nodet
>
> >Thanks,
> >John
> >
> >
> >
>

Re: creating new connectors / invokers

Posted by Guillaume Nodet <gu...@worldonline.fr>.

jc wrote:

>Hello,
>
>I'm currently working on a proof of concept where my intent is to insert SM
>transparently between two systems that currently communicate via Web
>services (SOAP). I've sucessfully used either the HttpConnector or
>HttpSoapConnector to go from system a (the client) to SM, but i'm having
>issues using the HttpInvoker to pass the SOAP message to system b (the
>server). I understand now that I need to develop my own HttpConnector and
>Invoker to perform this task since in order to make it transparent, the
>original request must be passed on almost intact (kinda like a reverse
>proxy).
>  
>
What are the limitations of the HttpInvoker you ran into ?
When you say the request must be passed on almost intact, what are you 
refering to ?
http headers, soap headers, ?

The new servicemix-http component is much more powerful wrt soap, so you 
may want to give
it a try...

>However, how do I approach the development and deployment of these
>connectors? For instance, say I have MyHttpConnector, which say subclasses
>HttpConnector, where does it get deployed? can I jar it up and drop it in
>%SERVICEMIX_HOME%/lib ?
>  
>
If you want to use servicemix standalone, just dropping the jar in the 
lib or optional directory should
be fine.

>Is this the right approach? Should I for example create JBI components
>instead?
>  
>
Standard JBI components are useful mainly if you plan to be able to add 
/ remove / update components
at runtime.  You can also embed servicemix in your app, in which case, 
using lightweight components
is easier ...

>In a related question, are there plans to update the documentation for 3.0?
>I would be willing to submit documentation patches, as I learn things :)
>  
>
Sure, there are plans, but please, fell free to add / update any doc you 
wish :)

Cheers,
Guillaume Nodet

>Thanks,
>John
>
>  
>