synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rajith Attapattu" <rajit...@gmail.com>
Subject Re: Synapse and JBI
Date Tue, 24 Jul 2007 00:42:52 GMT
Paul & Michael,

Thats exactly how I used synapse in Qpid.
To do CBR and Transformation of messages. It was done in a few simple steps,
largely due to the way synapse is designed.
Synapse does have a rich set of features that can be utilized outside of
it's primary domain. (primary domain as in WS mediation).

Here are a few ideas (I have to warn, that I only had a cursory glance at
the JBI spec)
These are based on my experiance with the Qpid integration.

You synapse Service component in the JBI container can convert from the
javax.jbi.messaging.NormalizedMessage to the synapse MessageContext.
You could then feed the message context to the synapse engine. It will do
transformation and/or CBR
Then you could take the message context and convert it back to a
javax.jbi.messaging.NormalizedMessage.
Now it can be handed back to the JBI container. The new NM message context
will now have new routing information and/or a transformed payload.

I broke it down to two steps to, so that I can easily type
NM = Normalized message
SC = Synapse Message Context

JBIContainer ------NM-------> Synapse Component ----SC-------> Synapse
Engine

Synapse Engine ----SC------->  Synapse Component -----NM-----> JBIContainer.



Your component can implement the SynapseEnvironment interface and in the
send method you can convert the message context in to a NM and hand over to
the JBI container.
Here is the code I used for Qpid and demonstrates the idea.

public void send(EndpointDefinition endpoint, MessageContext smc)
{
	if(endpoint != null)
	{
		smc.setTo(new EndpointReference(endpoint.getAddress()));
		AMQMessage newMessage = MessageContextCreatorForQpid.getAMQMessage(smc);
		try
		{	
			qpidExchange.getExchangeRegistry().routeContent(newMessage);
		}
		catch(Exception e)
		{
			throw new SynapseException("Faulty endpoint",e);
		}
	}	
	
}


You can find the complete code at,.
https://svn.apache.org/repos/asf/incubator/qpid/branches/client_restructure/java/broker/src/main/java/org/apache/qpid/server/exchange/synapse/

Regards,

Rajith

On 7/23/07, Michael Buchholz <m.buchholz@subnatural.de> wrote:
>
> Paul
>
> I search for a sub-topic of my master thesis about Web-Service Mediation
> Systems. After reading the JBI spec I had the idea that a WMS (Synapse)
> could be used as a CBR in JBI-Enviroments:
>
> The Normalized Message Router (NMR) does not provide content based
> routing (CBR). Each component (Service Enging / Binding Component)
> referres another component by service endpoint, name or interface. That
> means each component has its own routing logic included. Also the
> component that sends the normalized message to the NMR must make sure
> that the normalized message payload is understood by the referenced
> component. (if i got the specs right)
>
> Synapse could provide a more convenient method to route messages by
> providing CBR to a JBI enviroment.
>
> For this each component registered on the NMR could forward its
> normalized message (NM) to the Synapse-Service Engine. Synapse can now
> select the next component on the NMR for the incoming message type and
> transform it to the message type of the selected component so that it
> will understand it. All this is done by simply adding all the rules in
> synpase rule-engine.
>
> In summary Synpase could provide:
>   - validation & classification (incoming XML message from the NMR)
>   - enrichment (for example calling other external services and
> inserting this data into the xml message)
>   - content based routing (choose next endpoint on the NMR)
>   - transformation (transform outgoing message so that the selected
> nmr-endpoint can understand it)
>
> .. that is a VERTO pattern: validate - enrich - route - transform -
> operate.
>
> And all this information can be stored in the synapse registry. JBI
> routing in a centralized way. The components don´t need any more routing
> logic except sending their messages to the synapse endpoint.
>
> Well.. that´s it ;). What do you think?
>
> Michael
>
> Paul Fremantle schrieb:
> > So far we haven't done any work on JBI integration. You are the first
> > person to ask for it! :-)
> >
> > Could you give us some more information on your requirements and the
> > benefits you think there might be of integrating with a JBI container?
> >
> > Paul
> >
> > On 7/22/07, Michael Buchholz <m.buchholz@subnatural.de> wrote:
> >> Hi,
> >>
> >> I wonder how Synapse can be plugged into a JBI enviroment as service
> >> engine for content based routing.
> >>
> >> After googling for a while I found this:
> >>
> >> @http://wiki.apache.org/incubator/SynapseProposal
> >> "Synapse plans to support the Java Business Integration (JBI) standard,
> >> but we plan do so as an add-on rather than as core APIs."
> >>
> >> Is this still a planed feature? Do you have any more information on
> what
> >>   the steps are to achieve it?
> >>
> >> Thanks.
> >> Michael
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
> >> For additional commands, e-mail: synapse-dev-help@ws.apache.org
> >>
> >>
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: synapse-dev-help@ws.apache.org
>
>

Mime
View raw message