Hi Mats

Sorry for the delay getting to you, been a bit hectic lately...

On 16 Aug 2005, at 15:36, Mats Norén wrote:
Hi,
I know this may not be the best place to ask my questions but since I'm evaluating ServiceMix I thought I at least should ask.
The involved components are:
- HTTP-bindings with a propriatary protocol based on S/MIME.
- Content Based Routing based on messageheader combined with lookup of endpoints from local or global directory (LDAP v3) - The delivery of messages are either async. or synchronous based on message header.

Typical async-scenario
======================

A client issues a HTTP-post to the BC (like the HTTP-binding example in SM). The content of the message is a multipart/mixed. The first part of the message is always text/xml and contains the header information used to determine how to process the message. The messages can be signed/encrypted but the header part is always unsigned/unencrypted. Based on a property in the header of the first mime-part the request is either async. or sync.
In this case we pretend that we have an async case.
Before returning an HTTP-result to the client the label must be validated against a DTD.

I've got a couple of different approaches on how to solve this with ServiceMix:

- build a complete solution based on application framework XXX and deploy and bootstrap within SM. - build the different BC:s (HTTP-client / HTTP-binding) and the RS- Async, RS-Sync as SE in ServiceMix and use the Spring-support for building services used for LDAP-lookup, Logging etc.

Do you have any suggestions on how to approach the problem?

Either is possible. Though where possible its always good to reuse components to avoid having too much cut and paste and plumbing code. We're trying to put in place reusable base classes or full components you can configure to do what you need.

In CVS HEAD we've a reusable BindingServlet together with implements like HttpInOutBinding, HttpInOnlyBinding and a useful base class, HttpBindingSupport.

If you could use either of those directly you could just use either dependency injection or inheritance to switch in a different HttpMarshaler to handle different ways of dealing with the S/MIME encoding and deciding how to turn them into a NormalizedMessage and back again. i.e. you could extend HttpMarshaler to decide how to extract the body & attachments and what NormalizedMessage properties to set and so forth.

To handle validation, you could put this into your HttpMarshaler or add it in a pipeline using a ValidationComponent.

The part I'm a little confused by is "Based on a property in the header of the first mime-part the request is either async. or sync.". Inside a Servlet call, you can either perform an InOnly (one way) request into JBI or you can perform an InOut, blocking until the result comes back, then returning the answer to the HTTP client. In both cases the Servlet is synchronous, as Servlets have to be. So when you said sync/async did you mean InOnly v InOut right? i.e. fire and forget versus blocking request response? If so its no biggie, you just have to add whatever logic you wish to decide whether to perform an InOnly or InOut


How granular should one be when designing services in ServiceMix if you want a system as performant as possible?

I'd be tempted to keep things fairly granular; the overhead of extra pipeline hops should be fairly minimal, they're fairly lightweight things. If down the road we find some common areas that need optimisation I'm sure we can come up with solutions on a case by case basis; for now I think keeping things easy to reuse is a good thing.

James
-------
http://radio.weblogs.com/0112098/

Reply via email to