<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3093388502742613483</id><updated>2012-01-27T18:39:27.992-05:00</updated><category term='SOA'/><category term='ETE'/><category term='SQS'/><category term='EC2'/><category term='typica'/><category term='ESB'/><category term='servicemix'/><category term='AWS'/><title type='text'>Tom's Tech Blog</title><subtitle type='html'>This blog will cover issues I encounter as well as solutions I find in my day to day battles in the IT world. The issues may arise due to my ignorance and the solutions may not be optimal. It is hoped, however, that the entries may help others if only by confirming their inherent superiority.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://tompurcellstechblog.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3093388502742613483/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://tompurcellstechblog.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Tom Purcell</name><uri>http://www.blogger.com/profile/08510857197497824041</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp1.blogger.com/_DBCG_WlTapw/ReW9YUZ9EEI/AAAAAAAAAAs/CsqmyFiELc4/s320/tpurcell.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>23</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3093388502742613483.post-8158349067299513805</id><published>2009-03-05T11:10:00.008-05:00</published><updated>2009-03-05T14:02:01.262-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='typica'/><category scheme='http://www.blogger.com/atom/ns#' term='SOA'/><category scheme='http://www.blogger.com/atom/ns#' term='SQS'/><category scheme='http://www.blogger.com/atom/ns#' term='ESB'/><category scheme='http://www.blogger.com/atom/ns#' term='ETE'/><category scheme='http://www.blogger.com/atom/ns#' term='EC2'/><category scheme='http://www.blogger.com/atom/ns#' term='servicemix'/><category scheme='http://www.blogger.com/atom/ns#' term='AWS'/><title type='text'>The Bus in the Clouds: A Use Case</title><content type='html'>There's been a lot of noise about The Cloud.  As a techie it sounds cool and, since its new, it must BE cool, right? I figured I'd take a look.&lt;br /&gt;&lt;br /&gt;Of course there is no point in doing anything other than "Hello World" if your not trying to solve some problem. There are plenty of problems out there but, if we think of The Cloud in terms of IaaS (Infrastructure as a Service), are there any benefits that can be derived from the introduction of The Cloud into our bag of tricks?&lt;br /&gt;&lt;br /&gt;A common SOA use case we have seen involves a scenario in which an enterprise must marshal  purchase orders(or any other type of document) from various trading partners into an internal enterprise system. Essentially:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;     Expose network protocol based end points to get messages on to the bus&lt;/li&gt;&lt;li&gt;     Transform incoming data to internal format&lt;/li&gt;&lt;li&gt;     Route to the appropriate internal service&lt;/li&gt;&lt;li&gt;     Return a response&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;Standard Operating Procedure&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;The diagram below describes the traditional approach. It uses an ESB to handle protocol translation, message transformation and routing. It has a lot of benefits in terms of flexibility and it gets the job done.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.phillyemergingtech.com/" title="photo sharing"&gt;&lt;img style="width: 500px; height: 193px;" src="http://farm4.static.flickr.com/3411/3330414707_f9dc66cef1.jpg?v=0" class="flickr-photo" alt="SOP" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This standard approach satisfies the use case requirements but introduces a number of problems: &lt;ul&gt;&lt;li&gt;Security - You've just poked a hole in your firewall to allow HTTP or FTP or whateverTP traffic into your enterprise&lt;/li&gt;&lt;li&gt;Scalability - Is one ESB server enough? Or will success be your worst nightmare?&lt;/li&gt;&lt;li&gt;Availability - What if you have an outage? Will your trading partner be able to resend? How many times can you ask them to resend before they start to think you may not be worth it?&lt;/li&gt;&lt;li&gt;Cost - You need to buy the hardware, the space to host it, the power to run it and its got to be strong enough for peak load. During non-peak it just sits there. Doing nothing.&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;Consider The Cloud&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;We're going to look at the specifics of how the infrastructure resources exposed by Amazon Web Services(AWS) provide an opportunity to address some of these issues (and raise a few new ones).&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.phillyemergingtech.com/" title="photo sharing"&gt;&lt;img style="width: 500px; height: 193px;" src="http://farm4.static.flickr.com/3662/3331250580_fe711f52d1.jpg?v=0" class="flickr-photo" alt="SOP" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Okay, what did we do? &lt;ul&gt;&lt;li&gt;Security - Trading Partners now communicate with SQS over SSL. They do not access your enterprise at all (no holes in the fire wall)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Scalability - SQS is infinitely scalable. Additional EC2 AMI instances running the ESB can be spun up on demand as volume increases. More importantly they can be stopped when load decreases(see Cost).&lt;/li&gt;&lt;li&gt;Availability - Redundancy across the AWS infrastructure. SQS is replicated across the infrastructure. In the unlikely event of an outage at Amazon your AMI can come up automatically at another Amazon site.&lt;/li&gt;&lt;li&gt;Cost - If you process orders every day from 12:00am till 2:00 then run your AMI for 2 hours and bring it down. In coming traffic will queue up on SQS till your ready for it. You only pay for what you use.&lt;/li&gt;&lt;/ul&gt;Note that many of the components in the two diagrams are identical. That's part of the beauty of the approach. While there are some nuances to the environment it is not a radical shift in paradigm with respect to the tools and development life cycle you are currently familiar with.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;Conclusion&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;AWS and IaaS are the best thing since whatever came before sliced bread. It solves all our problems, raises no new issues and even does your laundry. We can all go golf or fish or twitter or whatever.&lt;br /&gt;&lt;br /&gt;No.&lt;br /&gt;&lt;br /&gt;This is a new technology. Every new technology comes with its own set of gotcha's. So we'll start a new series of articles in which we'll implement our use case and see what happens. Some of the technologies we'll be using the following are:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://aws.amazon.com/sqs/"&gt;AWS Simple Queue Service (SQS)&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://aws.amazon.com/ec2/"&gt;AWS Elastic Cloud Computing(EC2)&lt;/a&gt; Amazon Machine Image(AMI)&lt;/li&gt;&lt;li&gt;&lt;a href="http://code.google.com/p/typica/"&gt;Typica&lt;/a&gt; - A Java library that wraps the AWS API (Thank you David Kavanagh)&lt;/li&gt;&lt;li&gt;&lt;a href="http://fusesource.com/products/enterprise-servicemix4/"&gt;Fuse ESB(ServiceMix) 4 &lt;/a&gt;- The ESB&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.hyperic.com/"&gt;Hyperic&lt;/a&gt; - ESB monitoring&lt;/li&gt;&lt;li&gt;&lt;a href="http://jakarta.apache.org/jmeter/"&gt;JMeter&lt;/a&gt; - Testing(our "trading partners")&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;In doing this I'm being helped by my friends(see list on the right) so I'll be referencing some other blogs a long the way.  I hope you find it all helpful.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;If You Find this Interesting&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;I'll be doing a presentation on it along with a full demo at  the &lt;a href="http://www.phillyemergingtech.com/"&gt;Emerging Technologies for the Enterprise&lt;/a&gt; conference being held in Philadelphia on March 26th and 27th. Hope to see you there.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3093388502742613483-8158349067299513805?l=tompurcellstechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tompurcellstechblog.blogspot.com/feeds/8158349067299513805/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3093388502742613483&amp;postID=8158349067299513805' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3093388502742613483/posts/default/8158349067299513805'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3093388502742613483/posts/default/8158349067299513805'/><link rel='alternate' type='text/html' href='http://tompurcellstechblog.blogspot.com/2009/03/bus-in-clouds-use-case.html' title='The Bus in the Clouds: A Use Case'/><author><name>Tom Purcell</name><uri>http://www.blogger.com/profile/08510857197497824041</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp1.blogger.com/_DBCG_WlTapw/ReW9YUZ9EEI/AAAAAAAAAAs/CsqmyFiELc4/s320/tpurcell.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3093388502742613483.post-871992159156162126</id><published>2009-02-23T14:28:00.003-05:00</published><updated>2009-03-05T13:38:07.297-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SOA'/><category scheme='http://www.blogger.com/atom/ns#' term='SQS'/><category scheme='http://www.blogger.com/atom/ns#' term='ESB'/><category scheme='http://www.blogger.com/atom/ns#' term='EC2'/><title type='text'>I'm Back</title><content type='html'>Okay, there seems to be a pattern here. Once a year I get the urge to blog and start spewing wisdom until I run out(usually does not take long). While my interests are still largely in the SOA area I'm finding the concept of Cloud Computing extremely compelling.&lt;br /&gt;&lt;br /&gt;I'm going to be doing some entries on the cloud and how it relates to SOA in the near future. Specifically I'll be talking about Amazon's Simple Queue Service(SQS) and Elastic Cloud Computing(EC2) so check back. I might say something interesting.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3093388502742613483-871992159156162126?l=tompurcellstechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tompurcellstechblog.blogspot.com/feeds/871992159156162126/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3093388502742613483&amp;postID=871992159156162126' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3093388502742613483/posts/default/871992159156162126'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3093388502742613483/posts/default/871992159156162126'/><link rel='alternate' type='text/html' href='http://tompurcellstechblog.blogspot.com/2009/02/im-back.html' title='I&apos;m Back'/><author><name>Tom Purcell</name><uri>http://www.blogger.com/profile/08510857197497824041</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp1.blogger.com/_DBCG_WlTapw/ReW9YUZ9EEI/AAAAAAAAAAs/CsqmyFiELc4/s320/tpurcell.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3093388502742613483.post-3123851307533539827</id><published>2008-02-13T13:24:00.003-05:00</published><updated>2008-02-13T13:34:02.531-05:00</updated><title type='text'>Emerging Technologies Conference</title><content type='html'>I'll be speaking at &lt;span class="headerBlue"&gt;the &lt;a href="http://phillyemergingtech.com/"&gt;Emerging Technologies Conference&lt;/a&gt; on some experiences we had with testing various ESB products in our SOA Lab.  The conference is being held on March 26th and 27th at Drexel University in Philadelphia. The conference has an impressive list of sponsors and speakers so you should check it out. If you do stop by and say hello.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3093388502742613483-3123851307533539827?l=tompurcellstechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tompurcellstechblog.blogspot.com/feeds/3123851307533539827/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3093388502742613483&amp;postID=3123851307533539827' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3093388502742613483/posts/default/3123851307533539827'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3093388502742613483/posts/default/3123851307533539827'/><link rel='alternate' type='text/html' href='http://tompurcellstechblog.blogspot.com/2008/02/emerging-technologies-conference.html' title='Emerging Technologies Conference'/><author><name>Tom Purcell</name><uri>http://www.blogger.com/profile/08510857197497824041</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp1.blogger.com/_DBCG_WlTapw/ReW9YUZ9EEI/AAAAAAAAAAs/CsqmyFiELc4/s320/tpurcell.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3093388502742613483.post-5200775397633761952</id><published>2008-02-11T09:37:00.000-05:00</published><updated>2008-02-11T10:00:55.847-05:00</updated><title type='text'>ServiceMix: When Things Go Wrong</title><content type='html'>Okay, that was great. Everything worked. Life is good. It always is!&lt;br /&gt;&lt;br /&gt;Yeah.&lt;br /&gt;&lt;br /&gt;Now back to reality. We all know that things break. So what does it look like when they do. That's what we'll look at now.&lt;br /&gt;&lt;br /&gt;In our use case we create a message that gets sent to service 1 which does some processing. The output from service 1 is sent to service 2 which also processes it. Then service 3 gets the output from service 2. Finally the output from service 3 gets routed back to the original caller. Now in light of the fact that today's topic is about things going wrong what would happen if service 2 failed? Glad you asked.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Code&lt;/span&gt;&lt;br /&gt;We want to make sure that we get an exception. One good way to do that is to throw one. So we will add a new POJO implementation.&lt;blockquote&gt;&lt;pre&gt;package com.chariotsolutions;&lt;br /&gt;&lt;br /&gt;import org.apache.commons.logging.Log;&lt;br /&gt;import org.apache.commons.logging.LogFactory;&lt;br /&gt;import org.apache.servicemix.MessageExchangeListener;&lt;br /&gt;import org.apache.servicemix.jbi.jaxp.SourceTransformer;&lt;br /&gt;import javax.annotation.Resource;&lt;br /&gt;import javax.jbi.messaging.*;&lt;br /&gt;&lt;br /&gt;public class MyExceptionBean implements MessageExchangeListener {&lt;br /&gt;@Resource&lt;br /&gt;private DeliveryChannel channel;&lt;br /&gt;&lt;br /&gt;private static final Log logger = LogFactory.getLog(MyExceptionBean.class);&lt;br /&gt;&lt;br /&gt;public void onMessageExchange(MessageExchange exchange) throws MessagingException {&lt;br /&gt;   if (exchange.getStatus() == ExchangeStatus.ACTIVE) {&lt;br /&gt;       logger.debug("## Received exchange with status ACTIVE: " + exchange);&lt;br /&gt;       throw new MessagingException("It Happened");&lt;br /&gt;   }&lt;br /&gt;   else{&lt;br /&gt;       logger.debug("## Received exchange but status not ACTIVE: " + exchange);&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt; I won't bother with the line by line. If the status is active it throws an exception.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Behavior Configuration&lt;/span&gt;&lt;br /&gt;We want our MyS2PojoService to call MyExceptionBean so that it will blow up(I feel like Gomez Adams). To do that we need to change the behavior configuration of MyS2PojoService as specified in its xbean.xml file. To do this go to:&lt;blockquote&gt;myS2Pojo/src/main/resources/xbean.xml&lt;/blockquote&gt;Change the implementation of the myBean bean from MyPojoBean to MyExceptionBean. When your done it should look like this:&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;br /&gt;&amp;lt;beans xmlns:bean="http://servicemix.apache.org/bean/1.0"&lt;br /&gt;  xmlns:test="http://test"&amp;gt;&lt;br /&gt;&amp;lt;bean:endpoint service="test:MyS2PojoService" endpoint="myS2PojoSu" bean="#myBean"/&amp;gt;&lt;br /&gt;&amp;lt;bean id="myBean" class="com.chariotsolutions.MyExceptionBean"/&amp;gt;&lt;br /&gt;&amp;lt;/beans&amp;gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Build the SU and SA&lt;/span&gt;&lt;br /&gt;We have changed the behavior configuration of the myS2Pojo bean (myS2Pojo/src/main/resources/xbean.xml) so we need to rebuild its SU so go the project root for myS2Pojo and enter the following command:&lt;blockquote&gt;mvn install&lt;/blockquote&gt;We changed an SU in our SA so the SA has to be repackaged to pick up the change. In the project root of the Sa &lt;project_root&gt; (mySA) enter the following command:&lt;/project_root&gt;&lt;blockquote&gt;mvn install&lt;/blockquote&gt;Now copy the SA to the ServiceMix hotdeploy directory and then start ServiceMix.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;The JUnit Test Client&lt;/span&gt;&lt;br /&gt;We're not quite ready to run the test. We need a new JUnit test client that expects an exception instead of a message. If we had one of those it would look kind of like this:&lt;blockquote&gt;&lt;pre&gt;package com.chariotsolutions.test.generic;&lt;br /&gt;&lt;br /&gt;import org.apache.activemq.ActiveMQConnectionFactory;&lt;br /&gt;import org.apache.activemq.command.ActiveMQObjectMessage;&lt;br /&gt;import javax.jms.*;&lt;br /&gt;import javax.jbi.messaging.MessagingException;&lt;br /&gt;import junit.framework.TestCase;&lt;br /&gt;import org.junit.Test;&lt;br /&gt;&lt;br /&gt;public class ExceptionResponseQActiveMqJmsTest extends TestCase {&lt;br /&gt;&lt;br /&gt;// Test to ensure we get expected results&lt;br /&gt;@Test(expected=MessagingException.class)&lt;br /&gt;public void testJMSTest() throws Exception {&lt;br /&gt;// Set up JMS environment&lt;br /&gt;   ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616");&lt;br /&gt;   QueueConnection queueConnection = connectionFactory.createQueueConnection();&lt;br /&gt;   QueueSession queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);&lt;br /&gt;   Queue requestQueue = queueSession.createQueue("myJmsQueueTest");&lt;br /&gt;   QueueSender queueSender = queueSession.createSender(requestQueue);&lt;br /&gt;   Destination tempResponseQueue = queueSession.createTemporaryQueue();&lt;br /&gt;   MessageConsumer responseMessageConsumer = queueSession.createConsumer(tempResponseQueue);&lt;br /&gt;&lt;br /&gt;// Set up JMS requestMessage&lt;br /&gt;   TextMessage msg = queueSession.createTextMessage();&lt;br /&gt;   msg.setText("&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;");&lt;br /&gt;   msg.setJMSReplyTo(tempResponseQueue);&lt;br /&gt;   msg.setJMSCorrelationID(String.valueOf(System.currentTimeMillis()));&lt;br /&gt;&lt;br /&gt;// Print some stuff about the request&lt;br /&gt;   System.out.println("#######################################");&lt;br /&gt;   System.out.println("#");&lt;br /&gt;   System.out.println("# About to send msg.getText(): " + msg.getText());&lt;br /&gt;   System.out.println("# msg.getJMSReplyTo(): " + msg.getJMSReplyTo());&lt;br /&gt;   System.out.println("# msg.getJMSCorrelationID(): " + msg.getJMSCorrelationID());&lt;br /&gt;   System.out.println("#");&lt;br /&gt;   System.out.println("#######################################");&lt;br /&gt;&lt;br /&gt;// Start connection, send the message and wait for a response&lt;br /&gt;   queueConnection.start();&lt;br /&gt;   queueSender.send(msg, DeliveryMode.NON_PERSISTENT, 0, 100000000);&lt;br /&gt;   Message responseMessage = responseMessageConsumer.receive(100000000);&lt;br /&gt;&lt;br /&gt;// Print some stuff about the response and print it out&lt;br /&gt;   System.out.println("#######################################");&lt;br /&gt;   System.out.println("#");&lt;br /&gt;   System.out.println("# responseMessage.getClass(): " + responseMessage.getClass());&lt;br /&gt;   System.out.println("# responseMessage.getJMSDestination(): " + responseMessage.getJMSDestination());&lt;br /&gt;   System.out.println("# responseMessage.getJMSCorrelationID(): " + responseMessage.getJMSCorrelationID());&lt;br /&gt;&lt;br /&gt;// Get the TextMessage from the response&lt;br /&gt;   ActiveMQObjectMessage activeMQObjectMessage = (ActiveMQObjectMessage) responseMessage;&lt;br /&gt;   MessagingException messagingException = (MessagingException) activeMQObjectMessage.getObject();&lt;br /&gt;   System.out.println("# messagingException.getMessage(): " + messagingException.getMessage());&lt;br /&gt;   System.out.println("# messagingException.getStackTrace(): " + (messagingException.getStackTrace()[0]).toString());&lt;br /&gt;   System.out.println("#");&lt;br /&gt;   System.out.println("#######################################");&lt;br /&gt;&lt;br /&gt;// Clean up after ourselves&lt;br /&gt;   queueSender.close();&lt;br /&gt;   queueSession.close();&lt;br /&gt;   queueConnection.close();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;Again, no line by line here. It is identical to the test we ran in &lt;a href="http://tompurcellstechblog.blogspot.com/2008/02/servicemix-test-client.html"&gt;ServiceMix: The Test Client (Part 1)&lt;/a&gt;. The changes are in the test:&lt;blockquote&gt;&lt;pre&gt;@Test(expected=MessagingException.class)&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;And the fact that we are expecting to get back an ActiveMQObjectMessage instead of a standard JMS TextMessage. We get the object out of that message, cast it to a MessageException and display enough to show it really is the same exception that occurred on the ServiceMix side.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;Run The Client&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Run the JUnit test client the via your preferred method. You should get output similar to this:&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;#######################################&lt;br /&gt;#&lt;br /&gt;# About to send msg.getText(): &amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;&lt;br /&gt;# msg.getJMSReplyTo(): temp-queue://ID:tpurcell-15260-1202504355369-1:0:1&lt;br /&gt;# msg.getJMSCorrelationID(): 1202504355780&lt;br /&gt;#&lt;br /&gt;#######################################&lt;br /&gt;#######################################&lt;br /&gt;#&lt;br /&gt;# responseMessage.getClass(): class org.apache.activemq.command.ActiveMQObjectMessage&lt;br /&gt;# responseMessage.getJMSDestination(): temp-queue://ID:tpurcell-15260-1202504355369-1:0:1&lt;br /&gt;# responseMessage.getJMSCorrelationID(): 1202504355780&lt;br /&gt;# messagingException.getMessage(): It Happened&lt;br /&gt;# messagingException.getStackTrace(): com.chariotsolutions.MyExceptionBean.onMessageExchange(MyExceptionBean.java:21)&lt;br /&gt;#&lt;br /&gt;#######################################&lt;br /&gt;&lt;br /&gt;Process finished with exit code 0&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;center&gt;We FAILED! SUCCESS!!!&lt;/center&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;On the ServiceMix Side&lt;/span&gt;&lt;br /&gt;Now lets look at the ServiceMix log. Don't worry. Not all of it. It is pretty much the same as what we saw in &lt;a href="http://tompurcellstechblog.blogspot.com/2008/02/servicemix-test-client-part-2.html"&gt;ServiceMix: The Test Client (Part 2)&lt;/a&gt; up to the point of failure. We'll pick it up from there:&lt;br /&gt;&lt;pre&gt;DEBUG - MyExceptionBean                - ## Received exchange with status ACTIVE: InOut[&lt;br /&gt;id: ID:127.0.0.2-117fad74ca4-18:3&lt;br /&gt;status: Active&lt;br /&gt;role: provider&lt;br /&gt;service: {http://test}MyS2PojoService&lt;br /&gt;endpoint: myS2PojoSu&lt;br /&gt;operation: {http://test}processThis&lt;br /&gt;in: &amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&amp;lt;bean1&amp;gt;&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;&amp;lt;/bean1&amp;gt;&lt;br /&gt;]&lt;br /&gt;&lt;/pre&gt;We pick it up as we enter our code ("##") in MyS2PojoService. At this point in the code we have not yet thrown the exception. That happens next. (Feel the anticipation?)&lt;br /&gt;&lt;pre&gt;ERROR - BeanComponent                  - Error processing exchange InOut[&lt;br /&gt;id: ID:127.0.0.2-117fad74ca4-18:3&lt;br /&gt;status: Active&lt;br /&gt;role: provider&lt;br /&gt;service: {http://test}MyS2PojoService&lt;br /&gt;endpoint: myS2PojoSu&lt;br /&gt;operation: {http://test}processThis&lt;br /&gt;in: &amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&amp;lt;bean1&amp;gt;&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;&amp;lt;/bean1&amp;gt;&lt;br /&gt;]&lt;br /&gt;javax.jbi.messaging.MessagingException: It Happened&lt;br /&gt;   at com.chariotsolutions.MyExceptionBean.onMessageExchange(MyExceptionBean.java:21)&lt;br /&gt;   at org.apache.servicemix.bean.BeanEndpoint.onProviderExchange(BeanEndpoint.java:235)&lt;br /&gt;   at org.apache.servicemix.bean.BeanEndpoint.process(BeanEndpoint.java:211)&lt;br /&gt;   at org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:538)&lt;br /&gt;   at org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:490)&lt;br /&gt;   at org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLifeCycle.java:46)&lt;br /&gt;   at org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)&lt;br /&gt;   at org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:170)&lt;br /&gt;   at org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:167)&lt;br /&gt;   at org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)&lt;br /&gt;   at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)&lt;br /&gt;   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)&lt;br /&gt;   at java.lang.Thread.run(Thread.java:595)&lt;br /&gt;&lt;/pre&gt;BOOM!!! There it goes.&lt;br /&gt;Note that this is the exception object that gets serialized and sent back to our JUnit test client. That is good. We get the exception actually thrown by the application. Well, at least its good if what the exception the application throws is meaningful.&lt;br /&gt;&lt;pre&gt;DEBUG - SedaFlow                       - Called Flow send&lt;br /&gt;DEBUG - SedaQueue                      - org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1@be41d5 dequeued exchange: InOut[&lt;br /&gt;id: ID:127.0.0.2-117fad74ca4-18:3&lt;br /&gt;status: Error&lt;br /&gt;role: consumer&lt;br /&gt;service: {http://test}MyS2PojoService&lt;br /&gt;endpoint: myS2PojoSu&lt;br /&gt;operation: {http://test}processThis&lt;br /&gt;in: &amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&amp;lt;bean1&amp;gt;&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;&amp;lt;/bean1&amp;gt;&lt;br /&gt;error: javax.jbi.messaging.MessagingException: It Happened&lt;br /&gt;]&lt;br /&gt;&lt;/pre&gt;Because of the MessageExchange state is ERROR this process is ending. In MyS2PojoService we used the MyExceptionBean which implements MessageExchangeListener. Note here that our onMessageExchange() method does not get called. This is because the status is ERROR, If its status was DONE it would be called one more time.&lt;pre&gt;DEBUG - SedaFlow                       - Called Flow send&lt;br /&gt;DEBUG - SedaFlow                       - Called Flow send&lt;br /&gt;DEBUG - SedaQueue                      - org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1@1e91c40 dequeued exchange: InOut[&lt;br /&gt;id: ID:127.0.0.2-117fad74ca4-18:2&lt;br /&gt;status: Done&lt;br /&gt;role: provider&lt;br /&gt;service: {http://test}MyS1PojoService&lt;br /&gt;endpoint: myS1PojoSu&lt;br /&gt;in: &amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&amp;lt;bean1&amp;gt;&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;&amp;lt;/bean1&amp;gt;&lt;br /&gt;out: &amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&amp;lt;bean1&amp;gt;&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;&amp;lt;/bean1&amp;gt;&lt;br /&gt;]&lt;br /&gt;DEBUG - BeanComponent                  - Received exchange: status: Done, role: provider&lt;br /&gt;DEBUG - BeanComponent                  - Retrieved correlation id: ID:127.0.0.2-117fad74ca4-3:1&lt;br /&gt;DEBUG - MyMessageExchangeListenerBean  - ## Received exchange but status not ACTIVE: InOut[&lt;br /&gt;id: ID:127.0.0.2-117fad74ca4-18:2&lt;br /&gt;status: Done&lt;br /&gt;role: provider&lt;br /&gt;service: {http://test}MyS1PojoService&lt;br /&gt;endpoint: myS1PojoSu&lt;br /&gt;in: &amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&amp;lt;bean1&amp;gt;&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;&amp;lt;/bean1&amp;gt;&lt;br /&gt;out: &amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&amp;lt;bean1&amp;gt;&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;&amp;lt;/bean1&amp;gt;&lt;br /&gt;]&lt;br /&gt;&lt;/pre&gt;Here we see that MyS1PojoService does get called again. This is because its MessageExchange status is DONE. Note that MyS3PojoService is not mentioned at all. It never gets called. The process stops when a fault condition occurs in the Static Routing Slip EIP.&lt;br /&gt;&lt;pre&gt;DEBUG - SedaQueue                      - org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1@13ddbdd dequeued exchange: InOut[&lt;br /&gt;id: ID:127.0.0.2-117fad74ca4-3:1&lt;br /&gt;status: Error&lt;br /&gt;role: consumer&lt;br /&gt;service: {http://test}MyStaticRoutingSlipService&lt;br /&gt;endpoint: myStaticRoutingSlipSu&lt;br /&gt;operation: {http://test}processThis&lt;br /&gt;in: &amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;&lt;br /&gt;error: javax.jbi.messaging.MessagingException: It Happened&lt;br /&gt;]&lt;br /&gt;DEBUG - JmsComponent                   - Received exchange: status: Error, role: consumer&lt;br /&gt;DEBUG - JmsComponent                   - Retrieved correlation id: ID:127.0.0.2-117fad74ca4-3:1&lt;br /&gt;&lt;/pre&gt;The MessageExchange is now in an ERROR state. Its inMeassage was &amp;gt;&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;. Its outMessage is a MessageException Object. It packs it up and sends it back via JMS.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;DONE&lt;/span&gt;&lt;br /&gt;There you have it, use case to implementaion, what you need to do get moving with ServiceMix. There is, of course, more. Much, much more. But that's the basics. I hope its helpful. I also hope its correct. If it isn't let me know and I'll update it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3093388502742613483-5200775397633761952?l=tompurcellstechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tompurcellstechblog.blogspot.com/feeds/5200775397633761952/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3093388502742613483&amp;postID=5200775397633761952' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3093388502742613483/posts/default/5200775397633761952'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3093388502742613483/posts/default/5200775397633761952'/><link rel='alternate' type='text/html' href='http://tompurcellstechblog.blogspot.com/2008/02/servicemix-when-things-go-wrong.html' title='ServiceMix: When Things Go Wrong'/><author><name>Tom Purcell</name><uri>http://www.blogger.com/profile/08510857197497824041</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp1.blogger.com/_DBCG_WlTapw/ReW9YUZ9EEI/AAAAAAAAAAs/CsqmyFiELc4/s320/tpurcell.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3093388502742613483.post-4499920333066200727</id><published>2008-02-05T15:53:00.000-05:00</published><updated>2008-02-08T11:15:44.679-05:00</updated><title type='text'>ServiceMix: The Test Client (Part 2)</title><content type='html'>Okay, last time we got the thing to run,  got our output and it was what we expected. Now were going to look at the ServiceMix log and see what actually happened.&lt;br /&gt;&lt;br /&gt;I have to say that, while what actually happened was interesting, I did not understand what actually happened. It took a little time to figure out what actually happened and I'm not quite sure I completely understand what actually happened but at any rate here is what actually happened.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Log4j&lt;/span&gt;&lt;br /&gt;In order to see what actually happens we first have to edit the ServiceMix log4j configuration. Go to &amp;lt;serviceMix-home&amp;gt;/config and make the following additions to the log4j.xml file:&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;&amp;lt;logger name="org.apache.servicemix.jbi.messaging"&amp;gt;&lt;br /&gt; &amp;lt;!-- To enable debug logging, replace the INFO by DEBUG --&amp;gt;&lt;br /&gt; &amp;lt;level value="DEBUG"/&amp;gt;&lt;br /&gt;&amp;lt;/logger&amp;gt;&lt;br /&gt;&amp;lt;logger name="org.apache.servicemix.jms"&amp;gt;&lt;br /&gt; &amp;lt;!-- To enable debug logging, replace the INFO by DEBUG --&amp;gt;&lt;br /&gt; &amp;lt;level value="DEBUG"/&amp;gt;&lt;br /&gt;&amp;lt;/logger&amp;gt;&lt;br /&gt;&amp;lt;logger name="org.apache.servicemix.jbi.nmr.flow"&amp;gt;&lt;br /&gt; &amp;lt;!-- To enable debug logging, replace the INFO by DEBUG --&amp;gt;&lt;br /&gt; &amp;lt;level value="DEBUG"/&amp;gt;&lt;br /&gt;&amp;lt;/logger&amp;gt;&lt;br /&gt; &amp;lt;logger name="com.chariotsolutions"&amp;gt;&lt;br /&gt; &amp;lt;level value="DEBUG"/&amp;gt;&lt;br /&gt;&amp;lt;/logger&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Things to Remember&lt;/span&gt;&lt;br /&gt;Review the code and remember that we have two different implementations of our POJO: &lt;a href="http://tompurcellstechblog.blogspot.com/2008/01/servicemix-pojo-part-1.html"&gt;MyMessageExchangeListenerBean&lt;/a&gt; and &lt;a href="http://tompurcellstechblog.blogspot.com/2008/01/servicemix-pojo-part-2.html"&gt;MyPojoBean&lt;/a&gt;. The difference in the way these are processed will be revealed in the log. Also note the log messages in our POJO's are prefixed with "&lt;span style="font-weight: bold;"&gt;##&lt;/span&gt;" to help them standout.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;SEDA?&lt;/span&gt;&lt;br /&gt;Throughout the log we'll see the term SedaFlow and SedaQueue referred to. What is SEDA? "Staged Event Driven Architecture".&lt;br /&gt;&lt;br /&gt;Okay, what does THAT mean?&lt;br /&gt;&lt;br /&gt;You may recall in our discussion 0f &lt;a href="http://tompurcellstechblog.blogspot.com/2008/01/servicemix-pojo-part-1.html"&gt;POJO 1&lt;/a&gt; we talked about how the NMR uses the Delivery Channel to send messages from consumers to providers(Service Invocation). There are &lt;a href="http://servicemix.apache.org/nmr-flows.html"&gt;4 different flow types supported by ServiceMix&lt;/a&gt; that define policies for how that will actually occur. SEDA is the default.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Run it (Again, again, again)&lt;/span&gt;&lt;br /&gt;Now restart ServiceMix and then go to your IDE or command line or however you choose to run your JUnit test client and run it. When its done look at the console window where ServiceMix is running. You should see something like the following (without my comments interspersed).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;What Actually Happened&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;DEBUG - MultiplexingConsumerProcessor  - Received jms message ActiveMQTextMessage {commandId = 7, responseRequired = true, messageId = ID:tpurcell-7873-1202&lt;br /&gt;326079357-1:0:1:1:1, originalDestination = null, originalTransactionId = null, producerId = ID:tpurcell-7873-1202326079357-1:0:1:1, destination = queue://my&lt;br /&gt;JmsQueueTest, transactionId = null, expiration = 0, timestamp = 1202326082926, arrival = 0, correlationId = 1202326082641, replyTo = temp-queue://ID:tpurcel&lt;br /&gt;l-7873-1202326079357-1:0:1, persistent = true, type = null, priority = 4, groupID = null, groupSequence = 0, targetConsumerId = null, compressed = false, us&lt;br /&gt;erID = null, content = org.apache.activemq.util.ByteSequence@43a8b8, marshalledProperties = null, dataStructure = null, redeliveryCounter = 0, size = 0, pro&lt;br /&gt;perties = null, readOnlyProperties = true, readOnlyBody = true, droppable = false, text = null}&lt;br /&gt;DEBUG - MultiplexingConsumerProcessor  - Handling jms message ActiveMQTextMessage {commandId = 7, responseRequired = true, messageId = ID:tpurcell-7873-1202&lt;br /&gt;326079357-1:0:1:1:1, originalDestination = null, originalTransactionId = null, producerId = ID:tpurcell-7873-1202326079357-1:0:1:1, destination = queue://my&lt;br /&gt;JmsQueueTest, transactionId = null, expiration = 0, timestamp = 1202326082926, arrival = 0, correlationId = 1202326082641, replyTo = temp-queue://ID:tpurcel&lt;br /&gt;l-7873-1202326079357-1:0:1, persistent = true, type = null, priority = 4, groupID = null, groupSequence = 0, targetConsumerId = null, compressed = false, us&lt;br /&gt;erID = null, content = org.apache.activemq.util.ByteSequence@43a8b8, marshalledProperties = null, dataStructure = null, redeliveryCounter = 0, size = 0, pro&lt;br /&gt;perties = null, readOnlyProperties = true, readOnlyBody = true, droppable = false, text = null}&lt;br /&gt;DEBUG - JmsComponent                   - Created correlation id: ID:127.0.0.2-117f0314f57-3:0&lt;br /&gt;DEBUG - DeliveryChannelImpl            - Send ID:127.0.0.2-117f0314f57-3:0 in DeliveryChannel{servicemix-jms}&lt;br /&gt;DEBUG - SedaFlow                       - Called Flow send&lt;br /&gt;DEBUG - SedaQueue                      - org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1@bf989e dequeued exchange: InOut[&lt;br /&gt;id: ID:127.0.0.2-117f0314f57-3:0&lt;br /&gt;status: Active&lt;br /&gt;role: provider&lt;br /&gt;service: {http://test}MyStaticRoutingSlipService&lt;br /&gt;endpoint: myStaticRoutingSlipSu&lt;br /&gt;operation: {http://test}processThis&lt;br /&gt;in: &amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;&lt;br /&gt;]&lt;br /&gt;&lt;/pre&gt;The JMS component that was listening to the queue got our message. Note that our message has been altered slightly. It now has encoding information.&lt;br /&gt;&lt;br /&gt;The JMS component passed the message off to the Delivery Channel which invoked SedaFlow which enqueued our message (staged it). SedaQueue "dequeued" our message and sent it to MyStaticRoutingSlipService. We are on our way.&lt;br /&gt;&lt;pre&gt;DEBUG - DeliveryChannelImpl            - Send ID:127.0.0.2-117f0314f57-18:0 in DeliveryChannel{servicemix-eip}&lt;br /&gt;DEBUG - SedaFlow                       - Called Flow send&lt;br /&gt;DEBUG - SedaQueue                      - org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1@1faf398 dequeued exchange: InOut[&lt;br /&gt;id: ID:127.0.0.2-117f0314f57-18:0&lt;br /&gt;status: Active&lt;br /&gt;role: provider&lt;br /&gt;service: {http://test}MyS1PojoService&lt;br /&gt;endpoint: myS1PojoSu&lt;br /&gt;in: &amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;&lt;br /&gt;]&lt;br /&gt;&lt;/pre&gt;MyStaticRoutingSlipService sent the message back to the Delivery Channel with instructions to route it to MyS1PojoService.  Then SedaFlow and SedaQueue do their enqueue/dequeue thing.&lt;br /&gt;&lt;pre&gt;DEBUG - MyMessageExchangeListenerBean  - ## Received exchange with status ACTIVE: InOut[&lt;br /&gt;id: ID:127.0.0.2-117f0314f57-18:0&lt;br /&gt;status: Active&lt;br /&gt;role: provider&lt;br /&gt;service: {http://test}MyS1PojoService&lt;br /&gt;endpoint: myS1PojoSu&lt;br /&gt;in: &amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;&lt;br /&gt;]&lt;br /&gt;DEBUG - MyMessageExchangeListenerBean  - ## In Message: &amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;&lt;br /&gt;DEBUG - MyMessageExchangeListenerBean  - ## Out Message: &amp;lt;bean1&amp;gt;&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;&amp;lt;/bean1&amp;gt;&lt;br /&gt;&lt;/pre&gt;For the first time we see the magic "##" which means we are in our POJO code. Specifically we are in MyS1PojoService which is implemented by MyMessageExchangeListenerBean. Note that our InOut MEP has "&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;" on the inMessage and "&amp;lt;bean1&amp;gt;&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;&amp;lt;/bean1&amp;gt;" on the outMessage. So far, so good.&lt;br /&gt;&lt;pre&gt;DEBUG - DeliveryChannelImpl            - Send ID:127.0.0.2-117f0314f57-18:0 in DeliveryChannel{servicemix-bean}&lt;br /&gt;DEBUG - SedaFlow                       - Called Flow send&lt;br /&gt;DEBUG - SedaQueue                      - org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1@9dc0a8 dequeued exchange: InOut[&lt;br /&gt;id: ID:127.0.0.2-117f0314f57-18:0&lt;br /&gt;status: Active&lt;br /&gt;role: consumer&lt;br /&gt;service: {http://test}MyS1PojoService&lt;br /&gt;endpoint: myS1PojoSu&lt;br /&gt;in: &amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&amp;lt;bean1&amp;gt;&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;&amp;lt;/bean1&amp;gt;&lt;br /&gt;out: &amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&amp;lt;bean1&amp;gt;&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;&amp;lt;/bean1&amp;gt;&lt;br /&gt;]&lt;br /&gt;DEBUG - DeliveryChannelImpl            - Send ID:127.0.0.2-117f0314f57-18:1 in DeliveryChannel{servicemix-eip}&lt;br /&gt;DEBUG - SedaFlow                       - Called Flow send&lt;br /&gt;DEBUG - SedaQueue                      - org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1@1f020af dequeued exchange: InOut[&lt;br /&gt;id: ID:127.0.0.2-117f0314f57-18:1&lt;br /&gt;status: Active&lt;br /&gt;role: provider&lt;br /&gt;service: {http://test}MyS2PojoService&lt;br /&gt;endpoint: myS2PojoSu&lt;br /&gt;operation: {http://test}processThis&lt;br /&gt;in: &amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&amp;lt;bean1&amp;gt;&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;&amp;lt;/bean1&amp;gt;&lt;br /&gt;]&lt;br /&gt;&lt;/pre&gt;Our message got handed back to the Delivery Channel so SedaFlow enqueues and SedaQueue dequeues the message coming out of MyS1PojoService. The ServiceMix StaticRoutingSlip class has no log messages but it moved on to the next endpoint in our routing slip so we see another enqueue/dequeue which results in our MyS2PojoService being invoked.&lt;br /&gt;&lt;pre&gt;DEBUG - MyPojoBean                     - ## Received exchange: InOut[&lt;br /&gt;id: ID:127.0.0.2-117f0314f57-18:1&lt;br /&gt;status: Active&lt;br /&gt;role: provider&lt;br /&gt;service: {http://test}MyS2PojoService&lt;br /&gt;endpoint: myS2PojoSu&lt;br /&gt;operation: {http://test}processThis&lt;br /&gt;in: &amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&amp;lt;bean1&amp;gt;&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;&amp;lt;/bean1&amp;gt;&lt;br /&gt;]&lt;br /&gt;DEBUG - MyPojoBean                     - ## In Message: &amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&amp;lt;bean1&amp;gt;&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;&amp;lt;/bean1&amp;gt;&lt;br /&gt;DEBUG - MyPojoBean                     - ## Out Message: &amp;lt;bean2&amp;gt;&amp;lt;bean1&amp;gt;&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;&amp;lt;/bean1&amp;gt;&amp;lt;/bean2&amp;gt;&lt;br /&gt;&lt;/pre&gt;We are in our code again. This time its MyS2PojoService implemented by MyPojoBean. Note that on the outMessage we've appended the &amp;lt;bean2&amp;gt; tags. Cool!&lt;br /&gt;&lt;pre&gt;DEBUG - DeliveryChannelImpl            - Send ID:127.0.0.2-117f0314f57-18:1 in DeliveryChannel{servicemix-bean}&lt;br /&gt;DEBUG - SedaFlow                       - Called Flow send&lt;br /&gt;DEBUG - SedaQueue                      - org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1@11b16 dequeued exchange: InOut[&lt;br /&gt;id: ID:127.0.0.2-117f0314f57-18:1&lt;br /&gt;status: Active&lt;br /&gt;role: consumer&lt;br /&gt;service: {http://test}MyS2PojoService&lt;br /&gt;endpoint: myS2PojoSu&lt;br /&gt;operation: {http://test}processThis&lt;br /&gt;in: &amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&amp;lt;bean2&amp;gt;&amp;lt;bean1&amp;gt;&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;&amp;lt;/bean1&amp;gt;&amp;lt;/bean2&amp;gt;&lt;br /&gt;out: &amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&amp;lt;bean2&amp;gt;&amp;lt;bean1&amp;gt;&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;&amp;lt;/bean1&amp;gt;&amp;lt;/bean2&amp;gt;&lt;br /&gt;]&lt;br /&gt;DEBUG - DeliveryChannelImpl            - Send ID:127.0.0.2-117f0314f57-18:2 in DeliveryChannel{servicemix-eip}&lt;br /&gt;DEBUG - SedaFlow                       - Called Flow send&lt;br /&gt;DEBUG - SedaQueue                      - org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1@9957eb dequeued exchange: InOut[&lt;br /&gt;id: ID:127.0.0.2-117f0314f57-18:2&lt;br /&gt;status: Active&lt;br /&gt;role: provider&lt;br /&gt;service: {http://test}MyS3PojoService&lt;br /&gt;endpoint: myS3PojoSu&lt;br /&gt;in: &amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&amp;lt;bean2&amp;gt;&amp;lt;bean1&amp;gt;&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;&amp;lt;/bean1&amp;gt;&amp;lt;/bean2&amp;gt;&lt;br /&gt;]&lt;br /&gt;&lt;/pre&gt;MyS2PojoService-&gt;DeliveryChannel-&gt;SedaFlow-&gt;SedaQueue-&gt;MyStaticRoutingSlipService-&gt;DeliveryChannel-&gt;SedaFlow-&gt;SedaQueue-&gt;MyS3PojoService&lt;br /&gt;&lt;pre&gt;DEBUG - MyMessageExchangeListenerBean  - ## Received exchange with status ACTIVE: InOut[&lt;br /&gt;id: ID:127.0.0.2-117f0314f57-18:2&lt;br /&gt;status: Active&lt;br /&gt;role: provider&lt;br /&gt;service: {http://test}MyS3PojoService&lt;br /&gt;endpoint: myS3PojoSu&lt;br /&gt;in: &amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&amp;lt;bean2&amp;gt;&amp;lt;bean1&amp;gt;&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;&amp;lt;/bean1&amp;gt;&amp;lt;/bean2&amp;gt;&lt;br /&gt;]&lt;br /&gt;DEBUG - MyMessageExchangeListenerBean  - ## In Message: &amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&amp;lt;bean2&amp;gt;&amp;lt;bean1&amp;gt;&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;&amp;lt;/bean1&amp;gt;&amp;lt;/bean2&amp;gt;&lt;br /&gt;DEBUG - MyMessageExchangeListenerBean  - ## Out Message: &amp;lt;bean3&amp;gt;&amp;lt;bean2&amp;gt;&amp;lt;bean1&amp;gt;&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;&amp;lt;/bean1&amp;gt;&amp;lt;/bean2&amp;gt;&amp;lt;/bean3&amp;gt;&lt;br /&gt;&lt;/pre&gt;The ball's been passed back to us. This time its MyS3PojoService implemented by MyMessageExchangeListenerBean. &amp;lt;bean3&amp;gt; tags have been added. Awesome!&lt;br /&gt;&lt;pre&gt;DEBUG - DeliveryChannelImpl            - Send ID:127.0.0.2-117f0314f57-18:2 in DeliveryChannel{servicemix-bean}&lt;br /&gt;DEBUG - SedaFlow                       - Called Flow send&lt;br /&gt;DEBUG - SedaQueue                      - org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1@3037a0 dequeued exchange: InOut[&lt;br /&gt;id: ID:127.0.0.2-117f0314f57-18:2&lt;br /&gt;status: Active&lt;br /&gt;role: consumer&lt;br /&gt;service: {http://test}MyS3PojoService&lt;br /&gt;endpoint: myS3PojoSu&lt;br /&gt;in: &amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&amp;lt;bean3&amp;gt;&amp;lt;bean2&amp;gt;&amp;lt;bean1&amp;gt;&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;&amp;lt;/bean1&amp;gt;&amp;lt;/bean2&amp;gt;&amp;lt;/bean3&amp;gt;&lt;br /&gt;out: &amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&amp;lt;bean3&amp;gt;&amp;lt;bean2&amp;gt;&amp;lt;bean1&amp;gt;&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;&amp;lt;/bean1&amp;gt;&amp;lt;/bean2&amp;gt;&amp;lt;/bean3&amp;gt;&lt;br /&gt;]&lt;br /&gt;&lt;/pre&gt;Our final message gets sent back to the Delivery Channel.&lt;pre&gt;DEBUG - DeliveryChannelImpl            - Send ID:127.0.0.2-117f0314f57-3:0 in DeliveryChannel{servicemix-eip}&lt;br /&gt;DEBUG - SedaFlow                       - Called Flow send&lt;br /&gt;DEBUG - DeliveryChannelImpl            - Send ID:127.0.0.2-117f0314f57-18:1 in DeliveryChannel{servicemix-eip}&lt;br /&gt;DEBUG - SedaFlow                       - Called Flow send&lt;br /&gt;DEBUG - SedaQueue                      - org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1@147e60 dequeued exchange: InOut[&lt;br /&gt;id: ID:127.0.0.2-117f0314f57-18:1&lt;br /&gt;status: Done&lt;br /&gt;role: provider&lt;br /&gt;service: {http://test}MyS2PojoService&lt;br /&gt;endpoint: myS2PojoSu&lt;br /&gt;operation: {http://test}processThis&lt;br /&gt;in: &amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&amp;lt;bean2&amp;gt;&amp;lt;bean1&amp;gt;&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;&amp;lt;/bean1&amp;gt;&amp;lt;/bean2&amp;gt;&lt;br /&gt;out: &amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&amp;lt;bean2&amp;gt;&amp;lt;bean1&amp;gt;&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;&amp;lt;/bean1&amp;gt;&amp;lt;/bean2&amp;gt;&lt;br /&gt;]&lt;br /&gt;&lt;/pre&gt;What happened there? I thought we were done with MyS2PojoService. Well, not quite. If you've &lt;span style="font-style: italic;"&gt;really&lt;/span&gt; been looking at the log messages you may have noticed that each of our services actually received their own copy of the MessageExchange.&lt;br /&gt;&lt;br /&gt;&lt;table border="2" cellpadding="2" cellspacing="2" width="50%"&gt;  &lt;tbody&gt;&lt;tr&gt;&lt;td&gt;MyStaticRoutingSlipService&lt;/td&gt;&lt;td&gt; 127.0.0.2-117f0314f57-3:0&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;MyS1PojoService&lt;/td&gt;&lt;td&gt;127.0.0.2-117f0314f57-18:0&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;MyS2PojoService&lt;/td&gt;&lt;td&gt;127.0.0.2-117f0314f57-18:1&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;MyS3PojoService&lt;/td&gt;&lt;td&gt;127.0.0.2-117f0314f57-18:2&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt;&lt;br /&gt;As work on each MessageExchange is completed each is marked DONE. Then they are routed back to the DeliveryChannel. In cases where our POJO implemented MessageExchangeListener (MyS1PojoService, MyS3PojoService) the onMessageExchange() method is called and we see the "## Received exchange but status not ACTIVE" log message. For MyS2PojoService, because it does not implement MessageExchangeListener, nothing is called.&lt;br /&gt;&lt;pre&gt;DEBUG - SedaQueue                      - org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1@17504fb dequeued exchange: InOut[&lt;br /&gt;id: ID:127.0.0.2-117f0314f57-3:0&lt;br /&gt;status: Active&lt;br /&gt;role: consumer&lt;br /&gt;service: {http://test}MyStaticRoutingSlipService&lt;br /&gt;endpoint: myStaticRoutingSlipSu&lt;br /&gt;operation: {http://test}processThis&lt;br /&gt;in: &amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;&lt;br /&gt;out: &amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&amp;lt;bean3&amp;gt;&amp;lt;bean2&amp;gt;&amp;lt;bean1&amp;gt;&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;&amp;lt;/bean1&amp;gt;&amp;lt;/bean2&amp;gt;&amp;lt;/bean3&amp;gt;&lt;br /&gt;]&lt;br /&gt;DEBUG - JmsComponent                   - Received exchange: status: Active, role: consumer&lt;br /&gt;DEBUG - JmsComponent                   - Retrieved correlation id: ID:127.0.0.2-117f0314f57-3:0&lt;br /&gt;&lt;/pre&gt;Here the MyStaticRoutingSlipService sees its ACTIVE MessageExchange for the last time. Notice the inMessage is the original "&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;" sent by the JUnit test client. The outMessage is the full message as processed by all of our services.&lt;br /&gt;&lt;br /&gt;Next the MessageExchange gets passed to the JMS component for routing back to our JUnit test client. At this point our client has its response and completes its processing. What's left is all related to the remaining MessageExchanges being marked DONE and the NMR performing processing related to that state.&lt;br /&gt;&lt;pre&gt;DEBUG - DeliveryChannelImpl            - Send ID:127.0.0.2-117f0314f57-18:0 in DeliveryChannel{servicemix-eip}&lt;br /&gt;DEBUG - SedaFlow                       - Called Flow send&lt;br /&gt;DEBUG - SedaQueue                      - org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1@17d8938 dequeued exchange: InOut[&lt;br /&gt;id: ID:127.0.0.2-117f0314f57-18:0&lt;br /&gt;status: Done&lt;br /&gt;role: provider&lt;br /&gt;service: {http://test}MyS1PojoService&lt;br /&gt;endpoint: myS1PojoSu&lt;br /&gt;in: &amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&amp;lt;bean1&amp;gt;&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;&amp;lt;/bean1&amp;gt;&lt;br /&gt;out: &amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&amp;lt;bean1&amp;gt;&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;&amp;lt;/bean1&amp;gt;&lt;br /&gt;]&lt;br /&gt;DEBUG - MyMessageExchangeListenerBean  - ## Received exchange but status not ACTIVE: InOut[&lt;br /&gt;id: ID:127.0.0.2-117f0314f57-18:0&lt;br /&gt;status: Done&lt;br /&gt;role: provider&lt;br /&gt;service: {http://test}MyS1PojoService&lt;br /&gt;endpoint: myS1PojoSu&lt;br /&gt;in: &amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&amp;lt;bean1&amp;gt;&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;&amp;lt;/bean1&amp;gt;&lt;br /&gt;out: &amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&amp;lt;bean1&amp;gt;&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;&amp;lt;/bean1&amp;gt;&lt;br /&gt;]&lt;br /&gt;&lt;/pre&gt;Here notice the "##" in the log messages for MyS1PojoService. We're in our code in the MyMessageExchangeListenerBean, which implements MessageExchangeListener, and our onMessageExchange() method was called.&lt;br /&gt;&lt;pre&gt;DEBUG - DeliveryChannelImpl            - Send ID:127.0.0.2-117f0314f57-3:0 in DeliveryChannel{servicemix-jms}&lt;br /&gt;DEBUG - SedaFlow                       - Called Flow send&lt;br /&gt;DEBUG - SedaQueue                      - org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1@68ef48 dequeued exchange: InOut[&lt;br /&gt;id: ID:127.0.0.2-117f0314f57-3:0&lt;br /&gt;status: Done&lt;br /&gt;role: provider&lt;br /&gt;service: {http://test}MyStaticRoutingSlipService&lt;br /&gt;endpoint: myStaticRoutingSlipSu&lt;br /&gt;operation: {http://test}processThis&lt;br /&gt;in: &amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;&lt;br /&gt;out: &amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&amp;lt;bean3&amp;gt;&amp;lt;bean2&amp;gt;&amp;lt;bean1&amp;gt;&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;&amp;lt;/bean1&amp;gt;&amp;lt;/bean2&amp;gt;&amp;lt;/bean3&amp;gt;&lt;br /&gt;]&lt;br /&gt;DEBUG - DeliveryChannelImpl            - Send ID:127.0.0.2-117f0314f57-18:2 in DeliveryChannel{servicemix-eip}&lt;br /&gt;DEBUG - SedaFlow                       - Called Flow send&lt;br /&gt;DEBUG - SedaQueue                      - org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1@1358e57 dequeued exchange: InOut[&lt;br /&gt;id: ID:127.0.0.2-117f0314f57-18:2&lt;br /&gt;status: Done&lt;br /&gt;role: provider&lt;br /&gt;service: {http://test}MyS3PojoService&lt;br /&gt;endpoint: myS3PojoSu&lt;br /&gt;in: &amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&amp;lt;bean3&amp;gt;&amp;lt;bean2&amp;gt;&amp;lt;bean1&amp;gt;&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;&amp;lt;/bean1&amp;gt;&amp;lt;/bean2&amp;gt;&amp;lt;/bean3&amp;gt;&lt;br /&gt;out: &amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&amp;lt;bean3&amp;gt;&amp;lt;bean2&amp;gt;&amp;lt;bean1&amp;gt;&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;&amp;lt;/bean1&amp;gt;&amp;lt;/bean2&amp;gt;&amp;lt;/bean3&amp;gt;&lt;br /&gt;]&lt;br /&gt;DEBUG - MyMessageExchangeListenerBean  - ## Received exchange but status not ACTIVE: InOut[&lt;br /&gt;id: ID:127.0.0.2-117f0314f57-18:2&lt;br /&gt;status: Done&lt;br /&gt;role: provider&lt;br /&gt;service: {http://test}MyS3PojoService&lt;br /&gt;endpoint: myS3PojoSu&lt;br /&gt;in: &amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&amp;lt;bean3&amp;gt;&amp;lt;bean2&amp;gt;&amp;lt;bean1&amp;gt;&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;&amp;lt;/bean1&amp;gt;&amp;lt;/bean2&amp;gt;&amp;lt;/bean3&amp;gt;&lt;br /&gt;out: &amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&amp;lt;bean3&amp;gt;&amp;lt;bean2&amp;gt;&amp;lt;bean1&amp;gt;&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;&amp;lt;/bean1&amp;gt;&amp;lt;/bean2&amp;gt;&amp;lt;/bean3&amp;gt;&lt;br /&gt;]&lt;br /&gt;&lt;/pre&gt;Notice the "##" again. MyS3PojoService's onMessageExchange() method was called. That's it. We're DONE.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Is There Anything Left?&lt;/span&gt;&lt;br /&gt;Well, actually quite a bit. For instance, what would happen if one of our services got an exception and failed? Next we'll alter our code a bit to make sure that occurs and we'll see, yer..., what actually happens.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3093388502742613483-4499920333066200727?l=tompurcellstechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tompurcellstechblog.blogspot.com/feeds/4499920333066200727/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3093388502742613483&amp;postID=4499920333066200727' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3093388502742613483/posts/default/4499920333066200727'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3093388502742613483/posts/default/4499920333066200727'/><link rel='alternate' type='text/html' href='http://tompurcellstechblog.blogspot.com/2008/02/servicemix-test-client-part-2.html' title='ServiceMix: The Test Client (Part 2)'/><author><name>Tom Purcell</name><uri>http://www.blogger.com/profile/08510857197497824041</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp1.blogger.com/_DBCG_WlTapw/ReW9YUZ9EEI/AAAAAAAAAAs/CsqmyFiELc4/s320/tpurcell.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3093388502742613483.post-8147678170424153041</id><published>2008-02-04T13:27:00.000-05:00</published><updated>2008-02-05T14:21:28.190-05:00</updated><title type='text'>ServiceMix: The Test Client (Part 1)</title><content type='html'>Okay, we've done everything we need to do in ServiceMix. What we need to do now is put a message on a JMS queue so our Static Routing Slip process can process it. We'll write a JUnit test client to do that but before we start lets quickly review the use case.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;The Use Case&lt;/span&gt;&lt;br /&gt;An external system (our JUnit test client) sends a message in on a JMS queue and waits for a response on a temporary JMS queue. The JMS message is picked up by our BC (MyJmsQueueTest) which is bound to our Static Routing Slip SE (MyStaticRoutingSlipService) which routes the messge to Service 1(MyS1PojoService) which does some processing. The output from Service 1 then gets routed to to Service 2(MyS2PojoService). Then the output from Service 2 then gets routed to to Service 3(MyS3PojoService). Then, finally, the output for Service 3 gets routed back to the external system(our JUnit test client).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;The Code&lt;/span&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;package com.chariotsolutions.test.generic;&lt;br /&gt;&lt;br /&gt;import org.apache.activemq.ActiveMQConnectionFactory;&lt;br /&gt;import org.apache.activemq.command.ActiveMQObjectMessage;&lt;br /&gt;import javax.jms.*;&lt;br /&gt;import javax.jbi.messaging.MessagingException;&lt;br /&gt;import junit.framework.TestCase;&lt;br /&gt;&lt;br /&gt;public class EchoResponseQActiveMqJmsTest extends TestCase {&lt;br /&gt;&lt;br /&gt;    public void testJMSTest() throws Exception {&lt;br /&gt;// Set up JMS environment&lt;br /&gt;        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616");&lt;br /&gt;        QueueConnection queueConnection = connectionFactory.createQueueConnection();&lt;br /&gt;        QueueSession queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);&lt;br /&gt;        Queue requestQueue = queueSession.createQueue("myJmsQueueTest");&lt;br /&gt;        QueueSender queueSender = queueSession.createSender(requestQueue);&lt;br /&gt;        Destination tempResponseQueue = queueSession.createTemporaryQueue();&lt;br /&gt;        MessageConsumer responseMessageConsumer = queueSession.createConsumer(tempResponseQueue);&lt;br /&gt;&lt;br /&gt;// Set up JMS requestMessage&lt;br /&gt;        TextMessage msg = queueSession.createTextMessage();&lt;br /&gt;        msg.setText("&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;");&lt;br /&gt;        msg.setJMSReplyTo(tempResponseQueue);&lt;br /&gt;        msg.setJMSCorrelationID(String.valueOf(System.currentTimeMillis()));&lt;br /&gt;&lt;br /&gt;// Print some stuff about the request&lt;br /&gt;        System.out.println("#######################################");&lt;br /&gt;        System.out.println("#");&lt;br /&gt;        System.out.println("# About to send msg.getText(): " + msg.getText());&lt;br /&gt;        System.out.println("# msg.getJMSReplyTo(): " + msg.getJMSReplyTo());&lt;br /&gt;        System.out.println("# msg.getJMSCorrelationID(): " + msg.getJMSCorrelationID());&lt;br /&gt;        System.out.println("#");&lt;br /&gt;        System.out.println("#######################################");&lt;br /&gt;&lt;br /&gt;// Start connection, send the message and wait for a response&lt;br /&gt;        queueConnection.start();&lt;br /&gt;        queueSender.send(msg);&lt;br /&gt;        Message responseMessage = responseMessageConsumer.receive();&lt;br /&gt;&lt;br /&gt;// Print some stuff about the response&lt;br /&gt;        System.out.println("#######################################");&lt;br /&gt;        System.out.println("#");&lt;br /&gt;        System.out.println("# responseMessage.getClass(): " + responseMessage.getClass());&lt;br /&gt;        System.out.println("# responseMessage.getJMSDestination(): " + responseMessage.getJMSDestination());&lt;br /&gt;        System.out.println("# responseMessage.getJMSCorrelationID(): " + responseMessage.getJMSCorrelationID());&lt;br /&gt;&lt;br /&gt;// Get the TextMessage from the response and print it out&lt;br /&gt;        TextMessage textMessage = (TextMessage) responseMessage;&lt;br /&gt;&lt;br /&gt;        System.out.println("# textMessage.getText(): " + textMessage.getText());&lt;br /&gt;        System.out.println("#");&lt;br /&gt;        System.out.println("#######################################");&lt;br /&gt;&lt;br /&gt;// Test to ensure we get expected results&lt;br /&gt;        assertEquals("&amp;lt;?xml version='1.0' encoding='UTF-8'?&amp;gt;&amp;lt;bean3&amp;gt;&amp;lt;bean2&amp;gt;&amp;lt;bean1&amp;gt;&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;&amp;lt;/bean1&amp;gt;&amp;lt;/bean2&amp;gt;&amp;lt;/bean3&amp;gt;", textMessage.getText());&lt;br /&gt;&lt;br /&gt;// Clean up after ourselves&lt;br /&gt;        queueSender.close();&lt;br /&gt;        queueSession.close();&lt;br /&gt;        queueConnection.close();&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Set up JMS environment&lt;/span&gt;&lt;br /&gt;Much of what is here is standard JMS client stuff but there are a few things worth noting. First there is the URL passed to the ActiveMQConnectionFactory. Notice this is the same value ("tcp://localhost:61616") as was set on the brokerURL attribute of the #connectionFactory inner XBean definition in our &lt;a href="http://tompurcellstechblog.blogspot.com/2008/01/servicemix-behavior-configuration.html"&gt;MyJmsQueueTest&lt;/a&gt; definition.&lt;br /&gt;&lt;br /&gt;Also note that the value specified on the createQueue() call is the same value("myJmsQueueTest") we used for the jmsProviderDestinationName attribute of the JMS endpoint defined in MyJmsQueueTest.&lt;br /&gt;&lt;br /&gt;Finally notice that we are asking our JMS provider to set up a temporary queue for us(Destination tempResponseQueue). We will set the "replyTo" destination on our JMS request to the value returned by this call and then we'll set up a JMS consumer to listen to it for our response.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Set up JMS requestMessage&lt;/span&gt;&lt;br /&gt;Remember we have to send XML so we set up a real fundamental XML snippet for our little test. Then, as we mentioned above, we set the JMS reply to destination in our JMS message's header to the temporary queue that we set up for that purpose.&lt;br /&gt;&lt;br /&gt;The last piece of business is the correlationId. Typically this field is used to ensure that the client which made a request gets the response intended for it. This is particularly important in high volume applications. If we were coding for such a scenario we would use something more certain of being unique then System.currentTimeMillis(). What we really want to see in this little demo, however, is that the value gets preserved throughout the round trip.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Print some stuff about the request&lt;/span&gt;&lt;br /&gt;Its nice to see something happening so we'll display values prior to sending our message. But notice that we're printing out the JMS replyTo destination and correlationId. We'll print them out again when we get our response. They should be the same.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Start connection, send the message and wait for a response&lt;/span&gt;&lt;br /&gt;Not much to say. That's what we do.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Print some stuff about the response&lt;/span&gt;&lt;br /&gt;We print out some stuff so we get that instant gratification but also to show that the JMS replyTo destination and correlationId are what we expected.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Get the TextMessage from the response&lt;/span&gt;&lt;br /&gt;We cast the response message to the JMS TextMessage type and display the text. It should show that each of our POJO's wrapped the original message with its bean tag.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Test to ensure we get expected results&lt;/span&gt;&lt;br /&gt;Here we use JUnit to assert the validity of the response TextMessage.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Clean up after ourselves&lt;/span&gt;&lt;br /&gt;Being the good citizens we are we do our part to help keep the environment clean.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Run It&lt;/span&gt;&lt;br /&gt;First make sure your SA is deployed and ServiceMix is up and running. Then run the JUnit test client. How you do this depends on your environment. I'm running Intellij so I just created a JUnit run configuration and ran it from the IDE. Similar capabilities are available in most IDEs.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;Ugh! Problems&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;The first time I ran the JUnit JMS client it sent the message and just stalled waiting for a response. On the ServiceMix side the  process started but then stopped and displayed the following stack trace:&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;java.lang.NoClassDefFoundError: org/aopalliance/intercept/MethodInvocation&lt;br /&gt;at org.apache.servicemix.bean.support.BeanInfo.introspect(BeanInfo.java:130)&lt;br /&gt;at org.apache.servicemix.bean.support.BeanInfo.introspect(BeanInfo.java:95)&lt;br /&gt;at org.apache.servicemix.bean.support.BeanInfo.introspect(BeanInfo.java:69)&lt;br /&gt;at org.apache.servicemix.bean.BeanEndpoint.getBeanInfo(BeanEndpoint.java:184)&lt;br /&gt;at org.apache.servicemix.bean.BeanEndpoint.onProviderExchange(BeanEndpoint.java:248)&lt;br /&gt;at org.apache.servicemix.bean.BeanEndpoint.process(BeanEndpoint.java:211)&lt;br /&gt;at org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:538)&lt;br /&gt;at org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:490)&lt;br /&gt;at org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLifeCycle.java:46)&lt;br /&gt;at org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBound(DeliveryChannelImpl.java:610)&lt;br /&gt;at org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlow.java:170)&lt;br /&gt;at org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.java:167)&lt;br /&gt;at org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.java:134)&lt;br /&gt;at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)&lt;br /&gt;at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)&lt;br /&gt;at java.lang.Thread.run(Thread.java:595)&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;Clearly not what we had hoped for. It turns out there was a jar file, aopalliance-1.0.jar, missing from the &amp;lt;servicemix-home&amp;gt;/lib directory. The Jira issue is &lt;a href="https://issues.apache.org/activemq/browse/SM-1216"&gt;SM-1216&lt;/a&gt;. In the mean time, where can you get it? Well if you download the ServiceMix source and build it using Maven it will get downloaded to your local Maven repository. You can also download it from &lt;a href="http://sourceforge.net/project/showfiles.php?group_id=75329"&gt;SourceForge&lt;/a&gt;. So get it, stick it in &amp;lt;servicemix-home&amp;gt;/lib and then...&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Run It (again)&lt;/span&gt;&lt;br /&gt;Now, when you run it, you should get output similar to the following.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;The Ouput&lt;/span&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;#######################################&lt;br /&gt;#&lt;br /&gt;# About to send msg.getText(): &amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;&lt;br /&gt;# msg.getJMSReplyTo(): temp-queue://ID:tpurcell-16663-1202227340393-1:0:1&lt;br /&gt;# msg.getJMSCorrelationID(): 1202227340826&lt;br /&gt;#&lt;br /&gt;#######################################&lt;br /&gt;#######################################&lt;br /&gt;#&lt;br /&gt;# responseMessage.getClass(): class org.apache.activemq.command.ActiveMQTextMessage&lt;br /&gt;# responseMessage.getJMSDestination(): temp-queue://ID:tpurcell-16663-1202227340393-1:0:1&lt;br /&gt;# responseMessage.getJMSCorrelationID(): 1202227340826&lt;br /&gt;# textMessage.getText(): &amp;lt;?xml version='1.0' encoding='UTF-8'?&amp;gt;&amp;lt;bean3&amp;gt;&amp;lt;bean2&amp;gt;&amp;lt;bean1&amp;gt;&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;&amp;lt;/bean1&amp;gt;&amp;lt;/bean2&amp;gt;&amp;lt;/bean3&amp;gt;&lt;br /&gt;#&lt;br /&gt;#######################################&lt;br /&gt;&lt;br /&gt;Process finished with exit code 0&lt;/pre&gt;&lt;/blockquote&gt;So we sent our message, "&amp;lt;text&amp;gt;Hello!&amp;lt;/text&amp;gt;", specified a queue to reply to and a correlationId to tie the response to our request.&lt;br /&gt;&lt;br /&gt;The response came back on the expected queue with the expected correlationId and notice our "enhanced" message. MyS1PojoService took our message and wrapped it in its "&amp;lt;bean1&amp;gt;" tag, then MyS2PojoService wrapped that output it in its "&amp;lt;bean2&amp;gt;" tag and, finally, MyS3PojoService wrapped that output it in its "&amp;lt;bean3&amp;gt;" tag.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;SUCCESS!!!&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;What Happened on the ServiceMix Side?&lt;/span&gt;&lt;br /&gt;Glad you asked. We'll look at that in the next post.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3093388502742613483-8147678170424153041?l=tompurcellstechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tompurcellstechblog.blogspot.com/feeds/8147678170424153041/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3093388502742613483&amp;postID=8147678170424153041' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3093388502742613483/posts/default/8147678170424153041'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3093388502742613483/posts/default/8147678170424153041'/><link rel='alternate' type='text/html' href='http://tompurcellstechblog.blogspot.com/2008/02/servicemix-test-client.html' title='ServiceMix: The Test Client (Part 1)'/><author><name>Tom Purcell</name><uri>http://www.blogger.com/profile/08510857197497824041</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp1.blogger.com/_DBCG_WlTapw/ReW9YUZ9EEI/AAAAAAAAAAs/CsqmyFiELc4/s320/tpurcell.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3093388502742613483.post-5675066621720473126</id><published>2008-02-04T09:48:00.001-05:00</published><updated>2008-02-04T11:19:37.971-05:00</updated><title type='text'>ServiceMix: Deployment Configuration</title><content type='html'>Now we need to package each of our SUs and then wrap them into an SA. Back in the post entitled "&lt;a href="http://tompurcellstechblog.blogspot.com/2008/01/routingslip200.html"&gt;ServiceMix: The Use Case and What You Need to Implement It&lt;/a&gt;" we ran some Maven goals that generated the project structures for our SUs and SA. One of the items that got created in each project was a Maven pom.xml file. We now need to configure the poms so we can build our SUs and package the SA.They are located at:&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;&amp;lt;project_root&amp;gt;/pom.xml&lt;/pre&gt;&lt;/blockquote&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;The SUs (myJmsSu, myStaticRoutingSlip, myS1Pojo, myS2Pojo, myS3Pojo)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;These are easy. The Maven archetypes did all of the important work. I made just two changes in each largely just to be neat and tidy.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&amp;lt;name&amp;gt;&lt;/span&gt;&lt;br /&gt;The default placed here was "A custom project". I just changed the names to something more descriptive. My updates are as follows:&lt;br /&gt;&lt;br /&gt;&lt;table border="2" cellpadding="2" cellspacing="2" width="75%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;myJmsSu&lt;/td&gt;&lt;td&gt;&lt;pre&gt;&amp;lt;name&amp;gt;MyJmsTest :: myJmsSu&amp;lt;/name&amp;gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;myStaticRoutingSlip&lt;/td&gt;&lt;td&gt;&lt;pre&gt;&amp;lt;name&amp;gt;MyJmsTest :: myStaticRoutingSlip&amp;lt;/name&amp;gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;myS1Pojo&lt;/td&gt;&lt;td&gt;&lt;pre&gt;&amp;lt;name&amp;gt;MyJmsTest :: myS1Pojo&amp;lt;/name&amp;gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;myS2Pojo&lt;/td&gt;&lt;td&gt;&lt;pre&gt;&amp;lt;name&amp;gt;MyJmsTest :: myS2Pojo&amp;lt;/name&amp;gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;myS3Pojo&lt;/td&gt;&lt;td&gt;&lt;pre&gt;&amp;lt;name&amp;gt;MyJmsTest :: myS3Pojo&amp;lt;/name&amp;gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&amp;lt;url&amp;gt;&lt;/span&gt;&lt;br /&gt;This I changed in each to match that of my company:&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;&amp;lt;url&amp;gt;http://www.&amp;lt;YourCompantHere&amp;gt;.com&amp;lt;/url&amp;gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;The SA (mySa)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;There is a little more work to do here. We start out with the same changes as we made to the SUs but then we have to add dependencies.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&amp;lt;name&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;&amp;lt;name&amp;gt;MyJmsTest :: myJmsTestSa&amp;lt;/name&amp;gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;&amp;lt;url&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;&amp;lt;url&amp;gt;http://www.&amp;lt;YourCompantHere&amp;gt;.com&amp;lt;/url&amp;gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;&amp;lt;dependency&amp;gt;&lt;/span&gt;&lt;br /&gt;Remember that in the JBI world you must package your SUs into an SA in order to deploy. That means that our SA is dependent on our SUs so we have to add &amp;lt;dependency&amp;gt; entries to our SA's pom to describe that relationship to Maven. So in the SA's pom find the junit dependency entry and add the following after it:&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;&amp;lt;dependency&amp;gt;&lt;br /&gt;   &amp;lt;groupId&amp;gt;com.chariotsolutions&amp;lt;/groupId&amp;gt;&lt;br /&gt;   &amp;lt;artifactId&amp;gt;myJmsSu&amp;lt;/artifactId&amp;gt;&lt;br /&gt;   &amp;lt;version&amp;gt;1.0-SNAPSHOT&amp;lt;/version&amp;gt;&lt;br /&gt;&amp;lt;/dependency&amp;gt;&lt;br /&gt;&amp;lt;dependency&amp;gt;&lt;br /&gt;   &amp;lt;groupId&amp;gt;com.chariotsolutions&amp;lt;/groupId&amp;gt;&lt;br /&gt;   &amp;lt;artifactId&amp;gt;myStaticRoutingSlip&amp;lt;/artifactId&amp;gt;&lt;br /&gt;   &amp;lt;version&amp;gt;1.0-SNAPSHOT&amp;lt;/version&amp;gt;&lt;br /&gt;&amp;lt;/dependency&amp;gt;&lt;br /&gt;&amp;lt;dependency&amp;gt;&lt;br /&gt;   &amp;lt;groupId&amp;gt;com.chariotsolutions&amp;lt;/groupId&amp;gt;&lt;br /&gt;   &amp;lt;artifactId&amp;gt;myS1Pojo&amp;lt;/artifactId&amp;gt;&lt;br /&gt;   &amp;lt;version&amp;gt;1.0-SNAPSHOT&amp;lt;/version&amp;gt;&lt;br /&gt;&amp;lt;/dependency&amp;gt;&lt;br /&gt;&amp;lt;dependency&amp;gt;&lt;br /&gt;   &amp;lt;groupId&amp;gt;com.chariotsolutions&amp;lt;/groupId&amp;gt;&lt;br /&gt;   &amp;lt;artifactId&amp;gt;myS3Pojo&amp;lt;/artifactId&amp;gt;&lt;br /&gt;   &amp;lt;version&amp;gt;1.0-SNAPSHOT&amp;lt;/version&amp;gt;&lt;br /&gt;&amp;lt;/dependency&amp;gt;&lt;br /&gt;&amp;lt;dependency&amp;gt;&lt;br /&gt;   &amp;lt;groupId&amp;gt;com.chariotsolutions&amp;lt;/groupId&amp;gt;&lt;br /&gt;   &amp;lt;artifactId&amp;gt;myS2Pojo&amp;lt;/artifactId&amp;gt;&lt;br /&gt;   &amp;lt;version&amp;gt;1.0-SNAPSHOT&amp;lt;/version&amp;gt;&lt;br /&gt;&amp;lt;/dependency&amp;gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;Build the SUs&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Okay we're ready to build our SU's. In EACH SU &amp;lt;project_root&amp;gt; (myJmsSu, myStaticRoutingSlip, myS1Pojo, myS2Pojo, myS3Pojo) enter the following command:&lt;br /&gt;&lt;pre&gt;&lt;blockquote&gt;mvn install&lt;/blockquote&gt;&lt;/pre&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;Build the SAs&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Now we'll wrap the SUs into an SA. In the Sa &amp;lt;project_root&amp;gt; (mySA) enter the following command:&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;mvn install&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;Ugh! Problems&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;I made it through the SU's without a problem but when I ran the mvn install for mySa I got the following:&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;[INFO] ------------------------------------------------------------------------&lt;br /&gt;[ERROR] BUILD ERROR&lt;br /&gt;[INFO] ------------------------------------------------------------------------&lt;br /&gt;[INFO] The service unit myS2Pojo does not have a dependency which is packaged as a jbi-component or a project property 'componentName'&lt;br /&gt;[INFO] ------------------------------------------------------------------------&lt;br /&gt;[INFO] For more information, run Maven with the -e switch&lt;br /&gt;[INFO] ------------------------------------------------------------------------&lt;br /&gt;[INFO] Total time: 10 seconds&lt;br /&gt;[INFO] Finished at: Fri Feb 01 11:36:53 GMT-05:00 2008&lt;br /&gt;[INFO] Final Memory: 12M/25M&lt;br /&gt;[INFO] ------------------------------------------------------------------------&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;Okay, what did I do wrong? Nothing. It turns out that this is a bug in the jbi-maven-plugin that comes with ServiceMix. I'm using the binary 3.2.1 distribution of ServiceMix. If you  are using a different version YMMV but this is the work around recommended in &lt;a href="https://issues.apache.org/activemq/browse/SM-694"&gt;ServiceMix's Jira issue SM-694&lt;/a&gt;. It works.&lt;br /&gt;&lt;br /&gt;In each of the POJO poms(myS1Pojo, myS2Pojo and myS3Pojo) find the following entry:&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;&amp;lt;properties&amp;gt;&lt;br /&gt;   &amp;lt;servicemix-version&amp;gt;3.2.1&amp;lt;/servicemix-version&amp;gt;&lt;br /&gt;&amp;lt;/properties&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;Add the following immediately after the &amp;lt;servicemix-version&amp;gt; entry:&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;    &amp;lt;componentName&amp;gt;servicemix-bean&amp;lt;/componentName&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;Now, run mvn install on for each of your POJO projects and then run mySa's mvn install again. It should end with the celebratory:&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;[INFO] ------------------------------------------------------------------------&lt;br /&gt;[INFO] BUILD SUCCESSFUL&lt;br /&gt;[INFO] ------------------------------------------------------------------------&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;Deploy&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;The fruit of our labor is a deployable SA. It  actually comes in two flavors: a jar file and a zip file. They are identical and you can deploy ether one simply by coping it to your &amp;lt;servicemix-root&amp;gt;/hotdeploy directory. Of course in order to do that you need to know where it is.  The jar will be in your mySa project:&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;mySmTest/mySa/target/mySa-1.0-SNAPSHOT.jar&lt;/pre&gt;&lt;/blockquote&gt;Maven put the zip in your local Maven repository:&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;&lt;home&gt;/.m2/repository/com/chariotsolutions/mySa/1.0-SNAPSHOT/mySa-1.0-SNAPSHOT.zip&lt;/home&gt;&lt;/pre&gt;&lt;/blockquote&gt;So copy the SA to the ServiceMix hotdeploy directory and then, if you haven't already, start ServiceMix. You should see messages indicating the success of the SA's deployment and stating "Service unit started" for each SU.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;Next?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Well it is nice that we have a deployed SA that will satisfy the requirements of our use case but how do we find out if it will work? We need a client that will put messages on the JMS queue. We'll write that next.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3093388502742613483-5675066621720473126?l=tompurcellstechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tompurcellstechblog.blogspot.com/feeds/5675066621720473126/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3093388502742613483&amp;postID=5675066621720473126' title='14 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3093388502742613483/posts/default/5675066621720473126'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3093388502742613483/posts/default/5675066621720473126'/><link rel='alternate' type='text/html' href='http://tompurcellstechblog.blogspot.com/2008/02/servicemix-deployment-configuration.html' title='ServiceMix: Deployment Configuration'/><author><name>Tom Purcell</name><uri>http://www.blogger.com/profile/08510857197497824041</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp1.blogger.com/_DBCG_WlTapw/ReW9YUZ9EEI/AAAAAAAAAAs/CsqmyFiELc4/s320/tpurcell.jpg'/></author><thr:total>14</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3093388502742613483.post-2381500052282762656</id><published>2008-01-31T14:40:00.000-05:00</published><updated>2008-01-31T15:52:50.746-05:00</updated><title type='text'>ServiceMix: Behavior Configuration (Revisited)</title><content type='html'>As noted in "The POJO (Parts 1 and 2)" implementation of the POJOs forced me to expand my understanding of what JBI and ServiceMix are all about. As a result we will have to make some minor tweaks to the behavior(xbean) configuration we set up earlier. Let's get started.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;Where's the Code?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Let's first make sure where clear as to where our POJOs should be:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;myS1Pojo/src/main/java/com/chariotsolutions/MyMessageExchangeListenerBean.java&lt;/li&gt;&lt;li&gt;myS2Pojo/src/main/java/com/chariotsolutions/MyPojoBean.java&lt;/li&gt;&lt;li&gt;myS3Pojo/src/main/java/com/chariotsolutions/MyMessageExchangeListenerBean.java&lt;/li&gt;&lt;/ul&gt;Yes we copied MyMessageExchangeListenerBean from myS1Pojo to myS3Pojo(remember, we'll get fancy later). The only difference between the two is in the processXML() method where the myS1Pojo  copy wraps the XML in &amp;lt;bean1&amp;gt; while myS3Pojo wraps it in &amp;lt;bean3&amp;gt;.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="font-size:130%;"&gt; MyJmsQueueTest&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;The configuration for this BC SU is located at:&lt;br /&gt;&lt;blockquote&gt;   myJmsSu/src/main/resources/xbean.xml&lt;/blockquote&gt;The only change is to the defaultOperation attribute. It should now be:&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;defaultOperation="test:processThis"&lt;/pre&gt;&lt;/blockquote&gt;The value specified here must match the method we want to call in the MyS2PojoService POJO which is implemented by MyPojoBean. This is because that POJO does not implement the MessageExchangeListener interface. The other two POJOs, in MyS1PojoService and MyS3PojoService, are implemented by MyMessageExchangeListenerBean which does implement MessageExchangeListener. For both of them the onMessageExchange() method will get called regardless of what we specify here.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;b&gt;MyStaticRoutingSlipService&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;The configuration for this SE SU is located at:&lt;br /&gt;&lt;blockquote&gt;   myStaticRoutingSlip/src/main/resources/xbean.xml&lt;/blockquote&gt;Here we add an operation attribute to the definition of MyS2PojoService:&lt;blockquote&gt;&lt;pre&gt;&amp;lt;eip:exchange-target service="test:MyS2PojoService" endpoint="myS2PojoSu" operation="test:processThis"/&amp;gt;&lt;/pre&gt;&lt;/blockquote&gt;This change is, of course, related to the defaultOperation change in MyJmsQueueTest. Note that the  definitions for MyS1PojoService and MyS3PojoService do not change.&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;&lt;br /&gt;MyS1PojoService and MyS3PojoService&lt;/span&gt;&lt;br /&gt;The configuration for these SE SUs are located at:&lt;br /&gt;&lt;blockquote&gt;   myS&lt;span style="font-style: italic;"&gt;n&lt;/span&gt;Pojo/src/main/resources/xbean.xml&lt;br /&gt;&lt;br /&gt;Where: &lt;span style="font-style: italic;"&gt;n&lt;/span&gt; is the POJO number (1 or 3)&lt;br /&gt;&lt;/blockquote&gt;The name of the class that implements our internal xbean changed so we change it here like so:&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;&amp;lt;bean id="myBean" class="com.chariotsolutions.MyMessageExchangeListenerBean"/&amp;gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;MyS2PojoService&lt;/span&gt;&lt;br /&gt;The configuration for this SE SU is located at:&lt;br /&gt;&lt;blockquote&gt;   myS2Pojo/src/main/resources/xbean.xml&lt;/blockquote&gt;This internal xbean implementation also changed so:&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;&amp;lt;bean id="myBean" class="com.chariotsolutions.MyPojoBean"/&amp;gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Next Deployment&lt;/span&gt;&lt;br /&gt;Okay, we've built our Service Unit(SU) structures, configured their behavior and built a couple of POJO services to call. Next we'll use Maven to package or SUs into an Service Assembly(SA) .&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3093388502742613483-2381500052282762656?l=tompurcellstechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tompurcellstechblog.blogspot.com/feeds/2381500052282762656/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3093388502742613483&amp;postID=2381500052282762656' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3093388502742613483/posts/default/2381500052282762656'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3093388502742613483/posts/default/2381500052282762656'/><link rel='alternate' type='text/html' href='http://tompurcellstechblog.blogspot.com/2008/01/servicemix-behavior-configuration_31.html' title='ServiceMix: Behavior Configuration (Revisited)'/><author><name>Tom Purcell</name><uri>http://www.blogger.com/profile/08510857197497824041</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp1.blogger.com/_DBCG_WlTapw/ReW9YUZ9EEI/AAAAAAAAAAs/CsqmyFiELc4/s320/tpurcell.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3093388502742613483.post-3229356841971996353</id><published>2008-01-31T09:36:00.000-05:00</published><updated>2008-01-31T10:50:00.498-05:00</updated><title type='text'>ServiceMix: The POJO (Part 2)</title><content type='html'>We built a POJO and it will work (trust me).  In building it, however, we implemented a ServiceMix interface, MessageExchangeListener, that ties us to ServiceMix, dictates which method will be called and forces us to deal with life cycle issues that we really have no need to deal with in our simple use case. Is there another way? Glad you asked.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;Review Our POJO's Mission (again)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;There's nothing new:  get a message, alter it, put it back on the NMR (read BUS).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Implementation 2: MyPojoBean&lt;/span&gt;&lt;br /&gt;The Code:&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;package com.chariotsolutions;&lt;br /&gt;&lt;br /&gt;import org.apache.commons.logging.Log;&lt;br /&gt;import org.apache.commons.logging.LogFactory;&lt;br /&gt;import org.apache.servicemix.jbi.jaxp.SourceTransformer;&lt;br /&gt;import org.apache.servicemix.jbi.jaxp.StringSource;&lt;br /&gt;import org.apache.servicemix.jbi.util.MessageUtil;&lt;br /&gt;&lt;br /&gt;import javax.annotation.Resource;&lt;br /&gt;import javax.jbi.messaging.*;&lt;br /&gt;&lt;br /&gt;public class MyPojoBean {&lt;br /&gt;&lt;br /&gt;   @Resource&lt;br /&gt;   private DeliveryChannel channel;&lt;br /&gt;&lt;br /&gt;   private static final Log logger = LogFactory.getLog(MyPojoBean.class);&lt;br /&gt;&lt;br /&gt;   public void processThis(MessageExchange exchange) throws MessagingException {&lt;br /&gt;       logger.debug("## Received exchange: " + exchange);&lt;br /&gt;       InOut inOut = (InOut) exchange;&lt;br /&gt;       NormalizedMessage normalizedMessage = inOut.getInMessage();&lt;br /&gt;&lt;br /&gt;       String outMessage = processXml(normalizedMessage);&lt;br /&gt;&lt;br /&gt;       normalizedMessage.setContent(new StringSource(outMessage));&lt;br /&gt;       MessageUtil.transferInToOut(inOut, inOut);&lt;br /&gt;       channel.send(inOut);&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   private String processXml(NormalizedMessage normalizedMessage) throws MessagingException {&lt;br /&gt;       SourceTransformer sourceTransformer = new SourceTransformer();&lt;br /&gt;       String inMessage = "";&lt;br /&gt;&lt;br /&gt;       try {&lt;br /&gt;           inMessage = sourceTransformer.contentToString(normalizedMessage);&lt;br /&gt;       } catch (Exception e) {&lt;br /&gt;           throw new MessagingException(e);&lt;br /&gt;       }&lt;br /&gt;       logger.debug("## In Message: " + inMessage);&lt;br /&gt;&lt;br /&gt;       String coreMessage = inMessage.replace("&amp;lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&amp;gt;", "");&lt;br /&gt;       String outMessage = "&amp;lt;bean2&amp;gt;" + coreMessage + "&amp;lt;/bean2&amp;gt;";&lt;br /&gt;&lt;br /&gt;       logger.debug("## Out Message: " + outMessage);&lt;br /&gt;       return outMessage;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;span style="font-style: italic;"&gt;Implemented Interface&lt;/span&gt;&lt;br /&gt;Note: NONE&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Annotation&lt;br /&gt;&lt;/span&gt;We saw this in the MyMessageExchangeListenerBean implementation: @Resource Delivery. Its declaration, purpose and use are exactly the same in this implementation.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;The Operation&lt;/span&gt;&lt;br /&gt;Note our method name: processThis(). It could be anything we like. I liked processThs(). We will see how the JBI container will know which method to call when we re-address the behavior configuration.&lt;br /&gt;&lt;br /&gt;Status?&lt;br /&gt;Note we are not checking. Our processThis() method will only be called once when the MessageExchange status is ACTIVE.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;And All The Rest&lt;/span&gt;&lt;br /&gt;The rest of our code is identical to the MyMessageExchangeListenerBean implementation. We:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Get the NormalizedMessage out of the inMessage of the MessageExchange&lt;/li&gt;&lt;li&gt;Muck with the XML&lt;/li&gt;&lt;li&gt;Update the contents of the NormalizedMessage&lt;/li&gt;&lt;li&gt;Transfer the inMessage to the outMessage on the MessageExchange&lt;/li&gt;&lt;li&gt;Send the MessageExchange back to the DeliveryChannel&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;Next? &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Well we mucked about with our POJO implementation so we'll have to revisit our behavior configuration. We'll do that next.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3093388502742613483-3229356841971996353?l=tompurcellstechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tompurcellstechblog.blogspot.com/feeds/3229356841971996353/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3093388502742613483&amp;postID=3229356841971996353' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3093388502742613483/posts/default/3229356841971996353'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3093388502742613483/posts/default/3229356841971996353'/><link rel='alternate' type='text/html' href='http://tompurcellstechblog.blogspot.com/2008/01/servicemix-pojo-part-2.html' title='ServiceMix: The POJO (Part 2)'/><author><name>Tom Purcell</name><uri>http://www.blogger.com/profile/08510857197497824041</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp1.blogger.com/_DBCG_WlTapw/ReW9YUZ9EEI/AAAAAAAAAAs/CsqmyFiELc4/s320/tpurcell.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3093388502742613483.post-336301113068767518</id><published>2008-01-30T09:47:00.002-05:00</published><updated>2008-05-22T14:21:37.388-04:00</updated><title type='text'>ServiceMix: The POJO (Part 1)</title><content type='html'>Before we get started let me acknowledge that there are eighty-seven different ways to do this and all of them are better than this one. For instance, we could package our POJO as a component and instead of having separate projects but that would be getting ahead of ourselves. Lets just get through getting it to work and understanding what's going on with the basics. Latter we'll get fancy.&lt;br /&gt;&lt;br /&gt;Next the title of this entry is a lie. We all know that POJO stands for Plain Old Java Object. The ugly truth is that JBI simply does not support POJOs. It supports JBI components which must adhere to certain interface contracts that involve life cycle methods and the like. That being said requirements are terribly onerous so we'll buck up and do what needs to be done.&lt;br /&gt;&lt;br /&gt;Finally there is the question of what kind of JBI POJO you want to implement. I have to admit I struggled with this quite a bit. We'll look at two ways to do it. They each have subtle configuration impacts and each behaves differently at runtime. I'm not sure which I'd prefer but it would probably depend on what I was trying to accomplish. At any rate we'll go through two and let you decide.&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-weight: bold;"&gt;NOTE:&lt;/span&gt; If you've been following along you'll remember I stated earlier that "I reserve the right to swerve wildly off the road and into a ditch along the way". This is where I did exactly that. I did not fully realize the implications for behavior and configuration when I posted the "ServiceMix: Behavior Configuration" entry. There will be some small changes.&lt;br /&gt;&lt;/blockquote&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;Review Our POJO's Mission&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Now, what we need to do is get a message, alter it to show we did our job and then put it back on the NMR (read BUS). In our MyS?PojoService we don't care where it came form or where it is going. That is handled by our MyStaticRoutingSlipService.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;Where is Our POJO&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;There are three services and each one has its own POJO. When we ran our Maven SU archetype to create our bean projects back in "ServiceMix: The Use Case and What You Need to Implement It" we created:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;myS1Pojo/src/main/java/com/chariotsolutions/MyBean.java&lt;/li&gt;&lt;li&gt;myS2Pojo/src/main/java/com/chariotsolutions/MyBean.java&lt;/li&gt;&lt;li&gt;myS3Pojo/src/main/java/com/chariotsolutions/MyBean.java&lt;/li&gt;&lt;/ul&gt;We are going to change the names of those classes to:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;myS1Pojo/src/main/java/com/chariotsolutions/MyMessageExchangeListenerBean.java&lt;/li&gt;&lt;li&gt;myS2Pojo/src/main/java/com/chariotsolutions/MyPojoBean.java&lt;/li&gt;&lt;li&gt;myS3Pojo/src/main/java/com/chariotsolutions/MyMessageExchangeListenerBean.java&lt;/li&gt;&lt;/ul&gt;I know but bare with me. We could avoid two separate implementations of MyMessageExchangeListenerBean but first of all we're dealing with basics(remember?).  We'll do the fancy packaging later. Also think about what this means. Each POJO SU has its own implementation making them completely decoupled from each other. You could have different versions of the code running for different implementations.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Implementation 1: MyMessageExchangeListenerBean&lt;/span&gt;&lt;br /&gt;This was the first type of POJO I implemented. It is the one that had the most examples on the ServiceMix &lt;a href="http://servicemix.apache.org/servicemix-bean.html"&gt;servicemix-bean&lt;/a&gt; component page. It is also referred to as a "Being even more POJO" on the ServiceMix &lt;a href="http://servicemix.apache.org/pojo-support.html"&gt;POJO Support&lt;/a&gt; page. It should be noted however that on that first page (&lt;a href="http://servicemix.apache.org/servicemix-bean.html"&gt;servicemix-bean&lt;/a&gt; component page) there is this statement:&lt;br /&gt;&lt;blockquote&gt;These POJOs are low-level POJOs: you need to understand the JBI Api and Message Exchange Patterns to correctly handle incoming exchanges.&lt;/blockquote&gt;We'll begin to see the impact of this in the code but we will really see it at run time.&lt;br /&gt;&lt;br /&gt;Now, without further adieu, the code:&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;package com.chariotsolutions;&lt;br /&gt;&lt;br /&gt;import org.apache.commons.logging.Log;&lt;br /&gt;import org.apache.commons.logging.LogFactory;&lt;br /&gt;import org.apache.servicemix.MessageExchangeListener;&lt;br /&gt;import org.apache.servicemix.jbi.jaxp.SourceTransformer;&lt;br /&gt;import org.apache.servicemix.jbi.jaxp.StringSource;&lt;br /&gt;import org.apache.servicemix.jbi.util.MessageUtil;&lt;br /&gt;&lt;br /&gt;import javax.annotation.Resource;&lt;br /&gt;import javax.jbi.messaging.*;&lt;br /&gt;&lt;br /&gt;public class MyMessageExchangeListenerBean implements MessageExchangeListener {&lt;br /&gt;&lt;br /&gt;@Resource&lt;br /&gt;private DeliveryChannel channel;&lt;br /&gt;&lt;br /&gt;private static final Log logger = LogFactory.getLog(MyMessageExchangeListenerBean.class);&lt;br /&gt;&lt;br /&gt;public void onMessageExchange(MessageExchange exchange) throws MessagingException {&lt;br /&gt;  if (exchange.getStatus() == ExchangeStatus.ACTIVE) {&lt;br /&gt;      logger.debug("## Received exchange with status ACTIVE: " + exchange);&lt;br /&gt;      InOut inOut = (InOut)exchange;&lt;br /&gt;      NormalizedMessage normalizedMessage = inOut.getInMessage();&lt;br /&gt;&lt;br /&gt;      String outMessage = processXml(normalizedMessage);&lt;br /&gt;&lt;br /&gt;      normalizedMessage.setContent(new StringSource(outMessage));&lt;br /&gt;      MessageUtil.transferInToOut(inOut, inOut);&lt;br /&gt;      channel.send(inOut);&lt;br /&gt;  }&lt;br /&gt;  else{&lt;br /&gt;      logger.debug("## Received exchange but status not ACTIVE: " + exchange);&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private String processXml(NormalizedMessage normalizedMessage) throws MessagingException {&lt;br /&gt;  SourceTransformer sourceTransformer = new SourceTransformer();&lt;br /&gt;  String inMessage = "";&lt;br /&gt;&lt;br /&gt;  try {&lt;br /&gt;      inMessage = sourceTransformer.contentToString(normalizedMessage);&lt;br /&gt;  } catch (Exception e) {&lt;br /&gt;      throw new MessagingException(e);&lt;br /&gt;  }&lt;br /&gt;  logger.debug("## In Message: " + inMessage);&lt;br /&gt;&lt;br /&gt;  String coreMessage = inMessage.replace("&amp;lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&amp;gt;", "")    &lt;br /&gt;  String outMessage = "&amp;lt;bean1&amp;gt;" + coreMessage + "&amp;lt;/bean1&amp;gt;";&lt;br /&gt;&lt;br /&gt;  logger.debug("## Out Message: " + outMessage);&lt;br /&gt;  return outMessage;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;/pre&gt;&lt;/blockquote&gt;&lt;span style="font-style: italic;"&gt;Implemented Interface&lt;/span&gt;&lt;br /&gt;Now let's go through it. The first thing to notice is we're implementing a ServiceMix interface: MessageExchangeListener. We use a few other ServiceMix classes but only because they provide some conveniences(which we will point out). MessageExchangeListener is the only one that ties us permanently to the ServiceMix JBI implementation. Using it means our "Service" would not be deployable to an other JBI implementaion (&lt;a href="https://open-esb.dev.java.net/"&gt;OpenESB&lt;/a&gt; for instance).  However given the ServiceMix comment sited earlier about this being a  "low-level POJO" there may be cases where you might want to use it.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Annotation&lt;/span&gt;&lt;br /&gt;The next thing you will notice is the annotation @Resource. This provides an injection point for the container to provide a reference to the DeliveryChannel. We'll use this to put the message back on the NMR later.&lt;br /&gt;&lt;br /&gt;In the plumbing of our NMR the DeliveryChannel is the actual pipeline across which service consumers request services from service providers. A consumer performs a Service Invocation by placing a Message Exchange on the Delivery Channel. The provider service is invoked when the NMR routes the Message Exchange over the Delivery Channel to that service.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;The Operation&lt;br /&gt;&lt;/span&gt;Note our method name: onMessageExchange(). You may recall that when we configured our "MyJmsQueueTest" BC SU we included the setting: defaultOperation="test:onMessage". Well like I said I swerved into a ditch.&lt;br /&gt;&lt;br /&gt;As it turns out defaultOperation is the operation that will get called &lt;span style="font-weight: bold; font-style: italic;"&gt;unless&lt;/span&gt; you implement the MessageExchangeListener interface. If you implement this interface, which I did here, the defaultOperation setting is ignored and the onMessageExchange() method is the one that gets called.&lt;br /&gt;&lt;br /&gt;My code worked even though my setting did not match my method name. That bothered me. What I found was that the in the servicemix-bean component, in the class BeanEndpoint, the type of the bean is checked  (instanceof MessageExchangeListener). If its a MessageExchangeListener then OnMessageExchange() is called, end of story. This is true whether the bean is a provider or a consumer of a service. In "The POJO (Part 2)" we'll find out how to get around this.&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;Status?&lt;br /&gt;&lt;/span&gt;In our next line of code we check the status of the MessageExchange that was past in on the call to OnMessageExchange(). Why? Well remember again the statement about "low-level POJOS". Our POJO will get called twice: once on Service Invocation when the MessageExchange's status is ACTIVE and once after all processing completes and the MessageExchange's status is DONE. In our case we only want to manipulate the message while the MessageExchange is  ACTIVE.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;The Ins and Outs of the Exchange&lt;/span&gt;&lt;br /&gt;Recalling once more our "MyJmsQueueTest" configuration, remember the  setting: defaultMep="http://www.w3.org/2004/08/wsdl/in-out"? What we were telling our JBI container was that we wanted to use the "in-out" MEP. So our MessageExchange is of type InOut. This means it can hold a inMessage and an outMessage. We will take the inMessage, manipulate it and then transfer it to the outMessage before sending it on.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;NormalizedMessages and XML&lt;br /&gt;&lt;/span&gt;There is only one type of message JBI deals with and that's the NormalizedMessage. There is only one message format NormalizedMessages carry and that's XML. Okay, it can be XML with attachments, it can be XML with an XSD that describes complex types, but it must be XML. Later we will write a client to test our use case. We will put a JMS TextMessage on a JMS queue. By the time it gets to our POJO it will be wrapped in XML.&lt;br /&gt;&lt;br /&gt;You can write a marshaler to change that but, agan, just the basics here so our POJO will have to just deal with it. That's what the processXml() method does. Here we use two of those ServiceMix convenience  classes to strip out our core message and add a some graffiti to show we were here ("&amp;lt;bean&lt;span style="font-style: italic;"&gt;n&lt;/span&gt;&amp;gt;", "&amp;lt;/bean&lt;span style="font-style: italic;"&gt;n&lt;/span&gt;&amp;gt;").&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Update the Message&lt;/span&gt;&lt;br /&gt;Next we change our NormalizedMessage by setting its contents to our new and improved message.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Transfer, Please&lt;br /&gt;&lt;/span&gt;Then we use another ServiceMix convenience  class, MessageUtil, to transfer the NormaizedMessage that was in the inMessage of our MessageExchange to the outMessage in our MessageExchange.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Send&lt;/span&gt;&lt;br /&gt;Finally we send our message on its way. Remember our @Resource DeliveryChannel annotation? Well here is where we use it to send our MessageExchange back on to the DeliveryChannel to be routed by the NMR.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;Now What?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Okay that's our first POJO, or POJO (Part 1). Next we'll look at a slightly different implementation that avoids the MessageExchangeListener interface and lets us control the method to be invoked.&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3093388502742613483-336301113068767518?l=tompurcellstechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tompurcellstechblog.blogspot.com/feeds/336301113068767518/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3093388502742613483&amp;postID=336301113068767518' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3093388502742613483/posts/default/336301113068767518'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3093388502742613483/posts/default/336301113068767518'/><link rel='alternate' type='text/html' href='http://tompurcellstechblog.blogspot.com/2008/01/servicemix-pojo-part-1.html' title='ServiceMix: The POJO (Part 1)'/><author><name>Tom Purcell</name><uri>http://www.blogger.com/profile/08510857197497824041</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp1.blogger.com/_DBCG_WlTapw/ReW9YUZ9EEI/AAAAAAAAAAs/CsqmyFiELc4/s320/tpurcell.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3093388502742613483.post-1398510008610810708</id><published>2008-01-28T09:44:00.000-05:00</published><updated>2008-01-30T09:47:01.463-05:00</updated><title type='text'>ServiceMix: Behavior Configuration</title><content type='html'>Okay, we have the skeleton of our SOA use case implementation in place but we have to configure it to make it actually work. First let's recognize that we need to do two types of configuration: behavior and deployment.&lt;br /&gt;&lt;br /&gt;By behavior I mean configuring the JBI components in our SUs to perform their tasks. This is done in the xbean.xml file located in the &lt;su_home&gt;/src/main/resources of each of our SUs.&lt;br /&gt;&lt;br /&gt;By deployment I mean packaging the various SUs and their dependencies into a SA that can be deployed into our JBI container (ServiceMix). This  configuration is done in the Maven pom.xml file located at the root of each SU and the SA.&lt;br /&gt;&lt;br /&gt;We'll look at the behavior, xbean.xml, configuration first. We'll address each SU in the order they appear in our use case. So review the use case in the last post then we'll get started.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="font-size:130%;"&gt;JBI&lt;/span&gt;&lt;br /&gt;&lt;/b&gt;But before we do lets think about JBI. Java Business Integration is a product of JSR-208 and, as mentioned before,  is the standard upon which ServiceMix is based. The standard describes a Normalized Message Router(NMR) over which components communicate via message exchanges. The NMR is, essentially, our bus. Four methods of calling a service, called Service Invocations, are required by the JBI standard. They are defined by Message Exchange Patterns(MEPs) . Service Invocations map to MEPs as follows:&lt;br /&gt;&lt;br /&gt;&lt;/su_home&gt;&lt;table border="2" cellpadding="2" cellspacing="2" height="129" width="536"&gt;    &lt;tbody&gt;     &lt;tr&gt;       &lt;td align="center" valign="top"&gt;&lt;b&gt;Service Invocation&lt;/b&gt;&lt;br /&gt;&lt;/td&gt;       &lt;td align="center" valign="top"&gt;&lt;b&gt;Message Exchange Pattern(MEP)&lt;/b&gt;&lt;br /&gt;&lt;/td&gt;     &lt;/tr&gt;     &lt;tr&gt;       &lt;td valign="top"&gt;One-way&lt;br /&gt;&lt;/td&gt;       &lt;td valign="top"&gt;In-Only&lt;br /&gt;&lt;/td&gt;     &lt;/tr&gt;     &lt;tr&gt;       &lt;td valign="top"&gt;Reliable One-way&lt;br /&gt;&lt;/td&gt;       &lt;td valign="top"&gt;Robust In-Only&lt;br /&gt;&lt;/td&gt;     &lt;/tr&gt;     &lt;tr&gt;       &lt;td valign="top"&gt;Request-Response&lt;br /&gt;&lt;/td&gt;       &lt;td valign="top"&gt;In-Out&lt;br /&gt;&lt;/td&gt;     &lt;/tr&gt;     &lt;tr&gt;       &lt;td valign="top"&gt;Request Optional-Response&lt;br /&gt;&lt;/td&gt;       &lt;td valign="top"&gt;In Optional-Out&lt;br /&gt;&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt; &lt;/table&gt;&lt;br /&gt;Implementations are free to extend from this to implement additional MEPs but we're dealing with basics now so we'll leave it at that. Why is it important to point these out now? Well in the next step we'll define a "defaultMep".&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt; MyJmsQueueTest&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;This is the entry and exit point for our process. It receives a message from the outside world and eventually sends the response back. ServiceMix comes with ActiveMq embedded so we'll use that as the host for the JMS queue. Our JMS request/response scenario will be implemented using temporary queues.&lt;br /&gt;&lt;br /&gt;Now down to brass tacks. Our MyJmsQueueTest service is a Binding Component(BC) Service Unit(SU). The configuration XML file is located at:&lt;br /&gt;&lt;blockquote&gt;   myJmsSu/src/main/resources/xbean.xml&lt;/blockquote&gt;Here are the contents:&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;br /&gt;&amp;lt;beans xmlns:jms="http://servicemix.apache.org/jms/1.0"&lt;br /&gt;xmlns:test="http://test"&lt;br /&gt;xmlns:amq="http://activemq.org/config/1.0"&amp;gt;&lt;br /&gt;&amp;lt;jms:endpoint service="test:MyJmsQueueTest"&lt;br /&gt;        endpoint="jmsQueue"&lt;br /&gt;        targetService="test:MyStaticRoutingSlipService"&lt;br /&gt;        targetEndpoint="myStaticRoutingSlipSu"&lt;br /&gt;        role="consumer"&lt;br /&gt;        destinationStyle="queue"&lt;br /&gt;        jmsProviderDestinationName="myJmsQueueTest"&lt;br /&gt;        defaultMep="http://www.w3.org/2004/08/wsdl/in-out"&lt;br /&gt;        defaultOperation="test:onMessage"&lt;br /&gt;        connectionFactory="#connectionFactory"&amp;gt;&amp;lt;/jms:endpoint&amp;gt;&lt;br /&gt;&amp;lt;amq:connectionFactory id="connectionFactory" brokerURL="tcp://localhost:61616" /&amp;gt;&lt;br /&gt;&amp;lt;/beans&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;First note the name space definitions:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;xmlns:jms=&lt;a class="moz-txt-link-rfc2396E" href="http://servicemix.apache.org/jms/1.0"&gt;"http://servicemix.apache.org/jms/1.0"&lt;/a&gt;&lt;br /&gt;This identifies the entries for the servicemix-jms component which is the JBI standard JMS BC provided by ServiceMix.&lt;br /&gt;&lt;/li&gt;&lt;li&gt; xmlns:test=&lt;a class="moz-txt-link-rfc2396E" href="http://test/"&gt;"http://test"&lt;/a&gt;&lt;br /&gt;These entries are relevant to our particular use case implementation.&lt;br /&gt;&lt;/li&gt;&lt;li&gt; xmlns:amq=&lt;a class="moz-txt-link-rfc2396E" href="http://activemq.org/config/1.0"&gt;"http://activemq.org/config/1.0"&lt;/a&gt;&lt;br /&gt;Here we define the entries for ActiveMq.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;Now let's look at each setting:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;endpoint&lt;/li&gt;&lt;ul&gt;&lt;li&gt;service="test:MyJmsQueueTest"&lt;br /&gt;This identifies our service on the NMR.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;endpoint="jmsQueue"&lt;br /&gt;This identifies the endpoint within the service. Why an endpoint? Isn't service enough? Well if we decide latter that we want to also expose our "service" via SOAP we just add a new endpoint.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;targetService="test:MyStaticRoutingSlipService"&lt;br /&gt;Our SU in this case is a Binding Component(BC). It is used to expose a service on our NMR to the outside world via a standard protocol. Here the "test:MyJmsQueueTest" service is being used to bind our "test:MyStaticRoutingSlipService" to a JMS queue.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;targetEndpoint="myStaticRoutingSlipSu"&lt;br /&gt;Remember a service can have more than one endpoint. This is the specific endpoint within our "test:MyStaticRoutingSlipService" that we want to pass our message to.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;role="consumer"&lt;br /&gt;Here we define our BC as a "consumer" of the inbound message. In other words it will listen to the defined JMS transport.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;destinationStyle="queue"&lt;br /&gt;We define the JMS destination type as a queue (as opposed to a topic).&lt;br /&gt;&lt;/li&gt;&lt;li&gt;jmsProviderDestinationName="myJmsQueueTest"&lt;br /&gt;This is the name of the JMS queue our BC will listen to. Remember that we are using the version of ActiveMq that is embedded in ServiceMix as the JMS provider. In ActiveMq there is no need to configure the queue in advance of using it. If it does not exist ActiveMq will simply create it so no further configuration on the JMS provider side is reqired. This is not true of all JMS implementations (BEA for instance).&lt;br /&gt;&lt;/li&gt;&lt;li&gt;defaultMep=&lt;a class="moz-txt-link-rfc2396E" href="http://www.w3.org/2004/08/wsdl/in-out"&gt;"http://www.w3.org/2004/08/wsdl/in-out"&lt;/a&gt;&lt;br /&gt;Here we are declaring that we want to use the Request-Response Service Invocation (In-Out MEP) defined in the JBI standard. What will happen is ServiceMix will send our eventual response to the replyTo destination, defined in the header of the incoming JMS message, using the correlation id that is also defined in the header of the incoming JMS message.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;defaultOperation="test:onMessage"&lt;br /&gt;This is the method to call on the target service (our POJOs).&lt;br /&gt;&lt;/li&gt;&lt;li&gt;connectionFactory="#connectionFactory"&lt;br /&gt;The connection factory, defined below, that contains JMS provider specific configuration details. Note the "#". This is XBean syntax to reference an inner bean definition.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;connectionFactory&lt;br /&gt;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;id="connectionFactory"&lt;br /&gt;The name referred to by the "connectionFactory" attribute of the endpoint element above. It identifies an inner bean definition with in this XBean&lt;br /&gt;&lt;/li&gt;&lt;li&gt;brokerURL="tcp://localhost:61616"&lt;br /&gt;The URL for the broker. Since we are using the embedded ActiveMq that's all we need.&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;  &lt;b&gt;&lt;span style="font-size:130%;"&gt;MyStaticRoutingSlipService&lt;/span&gt;&lt;br /&gt;&lt;/b&gt;    So a client puts a message on a queue and the&lt;b&gt; &lt;/b&gt;MyJmsQueueTest BC SU picks it up and routes it to our first SE SU the MyStaticRoutingSlipService. This service is going to want to route our message to a service, wait for a response and then send that response on to the next service on our "routing slip". Our routing slip is defined in:&lt;br /&gt;&lt;blockquote&gt;myStaticRoutingSlip/src/main/resources/xbean.xml&lt;/blockquote&gt;Its contents:&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;br /&gt;&amp;lt;beans xmlns:eip="http://servicemix.apache.org/eip/1.0"&lt;br /&gt;xmlns:test="http://test"&amp;gt;&lt;br /&gt;&amp;lt;eip:static-routing-slip service="test:MyStaticRoutingSlipService" endpoint="myStaticRoutingSlipSu"&amp;gt;&lt;br /&gt;&amp;lt;eip:targets&amp;gt;&lt;br /&gt;&amp;lt;eip:exchange-target service="test:MyS1PojoService" endpoint="myS1PojoSu"/&amp;gt;&lt;br /&gt;&amp;lt;eip:exchange-target service="test:MyS2PojoService" endpoint="myS2PojoSu"/&amp;gt;&lt;br /&gt;&amp;lt;eip:exchange-target service="test:MyS3PojoService" endpoint="myS3PojoSu"/&amp;gt;&lt;br /&gt;&amp;lt;/eip:targets&amp;gt;&lt;br /&gt;&amp;lt;/eip:static-routing-slip&amp;gt;&lt;br /&gt;&amp;lt;/beans&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;First the name space definitions:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;xmlns:jms=&lt;a class="moz-txt-link-rfc2396E" href="http://servicemix.apache.org/jms/1.0"&gt;"http://servicemix.apache.org/eip/1.0"&lt;/a&gt;&lt;br /&gt;This identifies the entries for the servicemix-eip component. This is the component ships with ServiceMix to support the standard set of Enterprise Integration Patterns. There appears to be a move toward deprecating this implementation in favor of the one provided by the Apache Camel effort. Camel, however, does not yet support the Routing Slip pattern so we'll use the servicemix.eip implementation for now.&lt;br /&gt;&lt;/li&gt;&lt;li&gt; xmlns:test=&lt;a class="moz-txt-link-rfc2396E" href="http://test/"&gt;"http://test"&lt;/a&gt;&lt;br /&gt;Entries relevant to our particular use case implementation.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;      Now the meat:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;static-routing-slip&lt;br /&gt;The following entries simply identify our service and its only endpoint. This is the same as what was done for the MyJmsQueueTest BC SU.&lt;br /&gt;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;service="test:MyStaticRoutingSlipService"&lt;br /&gt;&lt;/li&gt;&lt;li&gt;endpoint="myStaticRoutingSlipSu"&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;targets&lt;br /&gt;Okay, here's the interesting part. What follows is a list of service endpoints. This is our "static-routing-slip". Each service will be called in the order in which they appear in the list with the output of the previous service.&lt;br /&gt;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;exchange-target service="test:MyS1PojoService" endpoint="myS1PojoSu"&lt;/li&gt;&lt;li&gt;exchange-target service="test:MyS2PojoService" endpoint="myS2PojoSu"&lt;/li&gt;&lt;li&gt;exchange-target service="test:MyS3PojoService" endpoint="myS3PojoSu"&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;  &lt;b&gt;&lt;span style="font-size:130%;"&gt;MyS1PojoService, MyS2PojoService, MyS3PojoService&lt;/span&gt;&lt;br /&gt;&lt;/b&gt;    Now we need to define an SE SU for each of the services in our routing slip. In our contrived example they are simple POJOs that merely add something to the incoming message to prove that they did something. We have a separate definition for each. Since they are practically identical we'll look at the configurations then discuss the entries. (Yes, there are other ways but, again, basics first then we'll get fancy).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;MyS1PojoService Configuration&lt;/span&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;    XBean configuration location:&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;blockquote&gt;        myS1Pojo/src/main/resources/xbean.xml&lt;/blockquote&gt;Contents:&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;br /&gt;&amp;lt;beans xmlns:bean="http://servicemix.apache.org/bean/1.0"&lt;br /&gt;xmlns:test="http://test"&amp;gt;&lt;br /&gt;&amp;lt;bean:endpoint service="test:MyS1PojoService" endpoint="myS1PojoSu" bean="#myBean"/&amp;gt;&lt;br /&gt;&amp;lt;bean id="myBean" class="com.chariotsolutions.MyBean"/&amp;gt;&lt;br /&gt;&amp;lt;/beans&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;span style="font-style: italic;"&gt;MyS2PojoService Configuration&lt;/span&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;    XBean configuration location:&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;blockquote&gt;        myS2Pojo/src/main/resources/xbean.xml&lt;/blockquote&gt;Contents:&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;br /&gt;&amp;lt;beans xmlns:bean="http://servicemix.apache.org/bean/1.0"&lt;br /&gt;xmlns:test="http://test"&amp;gt;&lt;br /&gt;&amp;lt;bean:endpoint service="test:MyS2PojoService" endpoint="myS2PojoSu" bean="#myBean"/&amp;gt;&lt;br /&gt;&amp;lt;bean id="myBean" class="com.chariotsolutions.MyBean"/&amp;gt;&lt;br /&gt;&amp;lt;/beans&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;span style="font-style: italic;"&gt;MyS3PojoService Configuration&lt;/span&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;    XBean configuration location:&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;blockquote&gt;        myS3Pojo/src/main/resources/xbean.xml&lt;/blockquote&gt;Contents:&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;br /&gt;&amp;lt;beans xmlns:bean="http://servicemix.apache.org/bean/1.0"&lt;br /&gt;xmlns:test="http://test"&amp;gt;&lt;br /&gt;&amp;lt;bean:endpoint service="test:MyS3PojoService" endpoint="myS3PojoSu" bean="#myBean"/&amp;gt;&lt;br /&gt;&amp;lt;bean id="myBean" class="com.chariotsolutions.MyBean"/&amp;gt;&lt;br /&gt;&amp;lt;/beans&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;Now lets look at the details. First the name spaces:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;xmlns:bean=&lt;a class="moz-txt-link-rfc2396E" href="http://servicemix.apache.org/bean/1.0"&gt;"http://servicemix.apache.org/bean/1.0"&lt;/a&gt;&lt;br /&gt;These entries are for the servicemix-bean component. This component ships with ServiceMix to provide for the integration of POJOs into the JBI container. We can think of them as Message Driven Pojos (MDP) similar, in concept at least, to J2EE's Message Driven Beans(MDB).&lt;br /&gt;Note: The servicemix-jsr181 SE also provides POJO support by exposing the POJO as a web service (CXF).&lt;br /&gt;&lt;/li&gt;&lt;li&gt; xmlns:test=&lt;a class="moz-txt-link-rfc2396E" href="http://test/"&gt;"http://test"&lt;/a&gt;&lt;br /&gt;Entries relevant to our particular use case implementation.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;      Now the meat:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;endpoint&lt;br /&gt;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;service="test:MyS&lt;span style="font-style: italic;"&gt;n&lt;/span&gt;PojoService" endpoint="myS&lt;span style="font-style: italic;"&gt;n&lt;/span&gt;PojoSu"&lt;br /&gt;These should be familiar by now. They identify our service and its only endpoint.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;bean="#myBean"&lt;br /&gt;Here we use XBean syntax (remember # from the MyJmsQueueTest SU?) to reference an inner bean definition that describes our POJO.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;bean&lt;br /&gt;This is the inner bean definition that describes our POJO.&lt;br /&gt;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;id="myBean"&lt;br /&gt;A name to reference it by.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;class="com.chariotsolutions.MyBean"&lt;br /&gt;The fully qualified name of our POJO.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;  Okay, we have finished configuring the behavior of our BC (MyJmsQueueTest) and SE (MyStaticRoutingSlipService, MyS1PojoService, MyS2PojoService and MyS3PojoService) SUs. They will have to be packaged in a Service Assembly(SA) before we can deploy. Before we get to that, however, there is one more thing to consider. Our POJO, com.chariotsolutions.MyBean, where did that come from? We'll look at that next.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3093388502742613483-1398510008610810708?l=tompurcellstechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tompurcellstechblog.blogspot.com/feeds/1398510008610810708/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3093388502742613483&amp;postID=1398510008610810708' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3093388502742613483/posts/default/1398510008610810708'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3093388502742613483/posts/default/1398510008610810708'/><link rel='alternate' type='text/html' href='http://tompurcellstechblog.blogspot.com/2008/01/servicemix-behavior-configuration.html' title='ServiceMix: Behavior Configuration'/><author><name>Tom Purcell</name><uri>http://www.blogger.com/profile/08510857197497824041</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp1.blogger.com/_DBCG_WlTapw/ReW9YUZ9EEI/AAAAAAAAAAs/CsqmyFiELc4/s320/tpurcell.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3093388502742613483.post-3226370141745237202</id><published>2008-01-25T11:56:00.001-05:00</published><updated>2008-01-28T12:00:19.402-05:00</updated><title type='text'>ServiceMix: The Use Case and What You Need to Implement It</title><content type='html'>&lt;span style="font-size:100%;"&gt;Okay, so I have some basic understanding of what the JBI Components are and how to package them up. Now, can I actually do anything. We'll see. First I'll lay out a use case. Then I'll try to implement it.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;The Use Case&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;An external system sends a message in on a JMS queue and waits for a response on a temporary JMS queue. The message gets routed to Service 1(S1) which does some processing. The output from S1 then gets routed to to Service 2(S2). Then the output from S2 then gets routed to to Service 3(S3). Then, finally, the output for S3 gets routed back to the external system via a temporary JMS queue.&lt;/span&gt;&lt;br /&gt;&lt;su_home&gt;&lt;br /&gt;&lt;a href="http://www.flickr.com/photos/23238204@N08/2219100148/" title="photo sharing"&gt;&lt;img src="http://farm3.static.flickr.com/2275/2219100148_20699ff8f7.jpg" class="flickr-photo" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/su_home&gt;&lt;span style="font-size:100%;"&gt;Okay so looking at this it looks like a match for the Static Routing Slip Enterprise Integration Pattern(EIP). It appears that Camel is the preferred EIP implementation but it does not yet support the Static Routing Slip pattern while servicemix-eip does so we'll go with it.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;The Components&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;The next question is what components do we actually need? Lets go throught the use case and make a list:&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;A JMS Service Unit(SU) to act as a Binding Component(BC) and provide the protocol translation required to get the message on to the Normalized Message Router(NMR). We'll use servicemix-jms.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;A Static Routng Slip SU to control the flow of our message through the NMR. To do this we'll use the Service Engine(SE) servicemix-eip. &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;A SU for each of our services (S1, S2 and S3). If we were going to talk to real external services we would need a BC SU for each that described the protocol for communication with each of the services. In this case, however, we are going to keep it simple just to demonstrate what we want to accomplish. We will use a simple POJO implementation. Our POJO will simply append some text to the input message to demonstrate that the message has been acted upon by each service in order. The POJOs will be SE components. No BC component is needed for them because they are hosted on the NMR.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Finally there will be a Service Assembly (SA) which pulls all this together into a deployable unit. &lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;Configuration Strategy&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;Now how do we need configure ServiceMix? Well there's the old static method using servicemix.xml and the new JBI method. The JBI method has several advantages. First, each SA is independent and hot deployable. An other is that the JBI method seems far more JBI compliant. Finally, it seems that the static method, while not deprecated, is certainly falling from favor. We'll go with the new JBI strategy.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Get The Stuff&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:100%;"&gt;Okay, we're clicking along pretty good here but hold on. We need a few things before we move any further. We need, if we haven't already, to download and install:&lt;/span&gt;&lt;a href="http://maven.apache.org/"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;&lt;a href="http://maven.apache.org/"&gt;Maven&lt;/a&gt;&lt;span style="text-decoration: underline;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;span style="font-size:100%;"&gt;-&lt;/span&gt;&lt;span style="font-size:100%;"&gt; I'm using version 2.0.8&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;&lt;a href="http://servicemix.apache.org/"&gt;ServiceMix&lt;/a&gt; - I'm using version 3.2.1&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;&lt;br /&gt;Let's Get Started&lt;/span&gt;&lt;br /&gt;ServiceMix comes with a number of Maven archetypes which automatically construct the structure of the various types of ServiceMix projects you may need to work with. This is what the Fuse version of Eclipse is doing under the cover when you're clicking through the tutorial. Doing it this way, however, forced me to realize what was happening instead of just going along for the ride. I guess its a question of learning styles and what works for you. At any rate this worked for me (or at least I think it did).&lt;br /&gt;&lt;br /&gt;We're going to be working from the command line. For me that means a Linux shell. If you're on windows it should be rather easy to adjust.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Housekeeping&lt;/span&gt;&lt;br /&gt;- Create a directory&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;tpurcell@tpurcell:/data&gt; mkdir mySmTest&lt;/pre&gt;&lt;/blockquote&gt; - Add Maven to our path&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;tpurcell@tpurcell:/data&gt; export PATH=/data/apache-maven-2.0.8/bin/:$PATH&lt;/pre&gt;&lt;/blockquote&gt; - Add ServiceMix to our path&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;tpurcell@tpurcell:/data&gt; export PATH=/data/apache-servicemix-3.2.1/bin/:$PATH&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Create Our SU Projects&lt;/span&gt;&lt;br /&gt;- We need to create the SU project for our JMS SU using the Maven archetype for the servicemix-jms BC.&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;tpurcell@tpurcell:/data/mySmTest&gt; smx-arch su jms-consumer -DgroupId=com.chariotsolutions -DartifactId=myJmsSu&lt;/pre&gt;&lt;/blockquote&gt;- Now our Static Routng Slip SU. We're going to use the using the Maven archetype for the Service Engine(SE) servicemix-eip&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;tpurcell@tpurcell:/data/mySmTest&gt; smx-arch su eip -DgroupId=com.chariotsolutions -DartifactId=myStaticRoutingSlip&lt;/pre&gt;&lt;/blockquote&gt;- Next we create a SU for each of our POJO services using the Maven archetype for the servicemix-bean SE&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;tpurcell@tpurcell:/data/mySmTest&gt; smx-arch su bean -DgroupId=com.chariotsolutions -DartifactId=myS1Pojo&lt;br /&gt;tpurcell@tpurcell:/data/mySmTest&gt; smx-arch su bean -DgroupId=com.chariotsolutions -DartifactId=myS2Pojo&lt;br /&gt;tpurcell@tpurcell:/data/mySmTest&gt; smx-arch su bean -DgroupId=com.chariotsolutions -DartifactId=myS3Pojo&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;  Okay this is where we are at. We found the JBI components, BCs and SEs, we need to perform tasks. They need to be configured to behave so we wrap their configuration into SUs. We just created all SU projects for each of our JBI Components so we have a place to define and build their configuration. But we still have to be pull them all together into a SA so they can be deployed. So...&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Create Our SA Project&lt;/span&gt;&lt;br /&gt;- Finally we create our SA:&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;tpurcell@tpurcell:/data/mySmTest&gt; smx-arch sa -DgroupId=com.chariotsolutions -DartifactId=mySa&lt;/pre&gt;&lt;/blockquote&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;What Have We Got?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;We have a directory structure with some template Java classes and XML files and it all looks like this:&lt;br /&gt;-myJmsSu/&lt;br /&gt;--pom.xml&lt;br /&gt;--src/&lt;br /&gt;---main/&lt;br /&gt;----resources/&lt;br /&gt;-----xbean.xml&lt;br /&gt;-myS1Pojo/&lt;br /&gt;--pom.xml&lt;br /&gt;--src/&lt;br /&gt;---main/&lt;br /&gt;----java/&lt;br /&gt;-----com/&lt;br /&gt;------chariotsolutions/&lt;br /&gt;-------MyBean.java&lt;br /&gt;----resources/&lt;br /&gt;-----xbean.xml&lt;br /&gt;-myS2Pojo/&lt;br /&gt;--pom.xml&lt;br /&gt;--src/&lt;br /&gt;---main/&lt;br /&gt;----java/&lt;br /&gt;-----com/&lt;br /&gt;------chariotsolutions/&lt;br /&gt;-------MyBean.java&lt;br /&gt;----resources/&lt;br /&gt;-----xbean.xml&lt;br /&gt;-myS3Pojo/&lt;br /&gt;--pom.xml&lt;br /&gt;--src/&lt;br /&gt;---main/&lt;br /&gt;----java/&lt;br /&gt;-----com/&lt;br /&gt;------chariotsolutions/&lt;br /&gt;-------MyBean.java&lt;br /&gt;----resources/&lt;br /&gt;-----xbean.xml&lt;br /&gt;-mySa/&lt;br /&gt;--pom.xml&lt;br /&gt;-myStaticRoutingSlip/&lt;br /&gt;--pom.xml&lt;br /&gt;--src/&lt;br /&gt;---main/&lt;br /&gt;----resources/&lt;br /&gt;-----xbean.xml&lt;br /&gt;&lt;br /&gt;This gives us a structure for the required components but now we have to configure and package them in order to create a solution for our use case. We'll tackle that next.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3093388502742613483-3226370141745237202?l=tompurcellstechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tompurcellstechblog.blogspot.com/feeds/3226370141745237202/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3093388502742613483&amp;postID=3226370141745237202' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3093388502742613483/posts/default/3226370141745237202'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3093388502742613483/posts/default/3226370141745237202'/><link rel='alternate' type='text/html' href='http://tompurcellstechblog.blogspot.com/2008/01/routingslip200.html' title='ServiceMix: The Use Case and What You Need to Implement It'/><author><name>Tom Purcell</name><uri>http://www.blogger.com/profile/08510857197497824041</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp1.blogger.com/_DBCG_WlTapw/ReW9YUZ9EEI/AAAAAAAAAAs/CsqmyFiELc4/s320/tpurcell.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://farm3.static.flickr.com/2275/2219100148_20699ff8f7_t.jpg' height='72' width='72'/><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3093388502742613483.post-6770971870662594660</id><published>2008-01-24T09:24:00.000-05:00</published><updated>2008-01-24T09:31:18.344-05:00</updated><title type='text'>ServiceMix: What I Did Not Understand</title><content type='html'>JBI. That's what I did not understand. Now this will not be "Everything You Ever Wanted to Know About JBI But Were Afraid To Ask" but ServiceMix is a JBI implementation. If you don't understand some of the basic building blocks of that spec you will likely get lost. I know I did. So lets look at the basic basics.&lt;br /&gt;&lt;br /&gt;      In JBI land there is a Normalized Message Router(NMR). This is your "BUS". It is the conduit over which JBI Components communicate. We'll talk more about how they communicate at a later date. For now lets stick with the components.&lt;br /&gt;&lt;br /&gt;     JBI Components? Yes, there are two types of JBI Components:&lt;br /&gt; &lt;ul&gt;&lt;li&gt;Binding Component(BC)&lt;br /&gt;These expose a service on your bus (NMR) to the outside world via some standard protocol (HTTP (servicemix-http), JMS (servicemix-jms), FTP (servicemix-ftp), etc)&lt;/li&gt;&lt;li&gt;Service Engine(SE)&lt;br /&gt;These components do work. This is where you put logic. It may be a POJO you write or a rules engine (servicemix-drools) or a third party standard JBI component that provides BPEL support (ODE).&lt;/li&gt;&lt;/ul&gt;      And then there is the Service Unit(SU). This threw me. I understood the first two but I started to get lost in talk about Service Unit(SU) and Service Assembly(SA) and is a BC a SU or an SA and where does the SE come in and is that a JBI Component and who's on first and what's on second and... You get the point.&lt;br /&gt;&lt;br /&gt;     Okay, so we do not get confused lets start over on the Service Unit.&lt;br /&gt;&lt;br /&gt;     We've mentioned some BCs (servicemix-http, servicemix-jms, servicemix-ftp) and an SE (servicemix-drools). If you look in the "hotdeploy" directory of the ServiceMix install you'll see that these JBI Components are already installed. They do nothing. They are sitting there waiting to be told how to behave. In order to get them to behave the way you want them to you must configure their behavior.&lt;br /&gt;&lt;br /&gt;     Now since they are sitting there for everybody to use you don't just unpack them, configure them to your evil purposes and pack them up again. No, you create a Service Unit(SU) with your configuration. That's what an SU is. It configures the behavior you want to get out of a BC or a SE. This keeps the configuration of behavior (which JMS queue to listen to, which rule set to use) separate from the implementation of the service (servicemix-jms, servicemix-drools).&lt;br /&gt;&lt;br /&gt;     So a Service Unit(SU) packages the configuration of the behavior you want out of a JBI Component. Binding Components(BC) and Service Engines are the two types of JBI components. To use ether one you must create a Service Unit(SU) which configures their behavior.&lt;br /&gt;&lt;br /&gt;     I hope that's clear.&lt;br /&gt;&lt;br /&gt;     There is one more item: the Service Assembly(SA). What is that and why do I need it? Glad you asked.&lt;br /&gt;&lt;br /&gt;     Say we have a BC SU that defines a JMS queue to listen to and a target SE SU which is a Drools rules engine that will process the message. How does the the JBI Container know that the BC SU and the SE SU are related? It knows because they are packaged together in a Service Assembly(SA).&lt;br /&gt;&lt;br /&gt;     This is good. Say we need to change a rule or the name of the JMS queue or anything else in our little SA. We rebuild the effected SU and then rebuild and redeploy our SA. We touch nothing outside our little world. Life is good.&lt;br /&gt;&lt;br /&gt;     Okay, that's what I did not understand. Okay, there was (and is) a lot more I didn't (don't) understand but that was a big part of it. In Fuse I was clicking this and dragging that and I had no idea why. It a worked and I had no idea how. If something broke I'd have no idea what. If I had to build something from scratch I'd have no idea where to start.&lt;br /&gt;&lt;br /&gt;     Now, with some knowledge of what the building blocks are and how they fit together I feel like I can start to begin to commence to try and actually attempt to start something... kind  of.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3093388502742613483-6770971870662594660?l=tompurcellstechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tompurcellstechblog.blogspot.com/feeds/6770971870662594660/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3093388502742613483&amp;postID=6770971870662594660' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3093388502742613483/posts/default/6770971870662594660'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3093388502742613483/posts/default/6770971870662594660'/><link rel='alternate' type='text/html' href='http://tompurcellstechblog.blogspot.com/2008/01/servicemix-what-i-did-not-understand.html' title='ServiceMix: What I Did Not Understand'/><author><name>Tom Purcell</name><uri>http://www.blogger.com/profile/08510857197497824041</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp1.blogger.com/_DBCG_WlTapw/ReW9YUZ9EEI/AAAAAAAAAAs/CsqmyFiELc4/s320/tpurcell.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3093388502742613483.post-4178629186184542844</id><published>2008-01-23T09:49:00.000-05:00</published><updated>2008-02-11T10:16:41.887-05:00</updated><title type='text'>Remember Me?</title><content type='html'>April, Friday the 13th, 2007 was my last entry. No, Jason did not get me, but project and personal demands combined to decapitate my spare time. That made it difficult to continue my investigation of Fuse. I apologize for the absence and hope to make a more regular appearance in the blogosphere in the future.&lt;br /&gt;&lt;br /&gt;I also want to apologize to those at ServiceMix/Iona. I got some positive feed back from them on the entries and a request to add the content to their site but the same demands interfered with that effort. At this point Fuse is on a new release so rather than post obsolete info on their site I'll eventually try to update my efforts here. If this evolves into something useful I'll certainly make the effort to port it to their more accessible address on the web.&lt;br /&gt;&lt;br /&gt;At any rate the project I was involved with used Mule as the ESB. There are some lessons learned there that I'll try to share in the future but I really want to get back to Fuse and ServiceMix. This is because I felt there was a lot that, while I got it to work, I just did not understand.   So for the immediate future that is what I'll be doing, trying to understand.&lt;br /&gt;&lt;br /&gt;In order to understand I will not be going through a tutorial. In tutorials you download, you click what they tell you, you enter a command and everything works. Well, as indicated with my Fuse tutorial entries, it doesn't always go that smoothly but even though I hit some bumps and figured somethings out what I learned was more about &lt;span style="font-weight: bold;"&gt;what&lt;/span&gt; to click then about  &lt;span style="font-weight: bold;"&gt;WHY&lt;/span&gt; you should click it.&lt;br /&gt;&lt;br /&gt;So this time I'm not doing a tutorial and I'm not starting with Fuse. I'm going to start with ServiceMix and my own use case and build everything from the ground up. This way the only way I can progress is to understand what I'm doing rather than mechanically moving on to the next click.&lt;br /&gt;&lt;br /&gt;So here's the roadmap:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;a href="http://tompurcellstechblog.blogspot.com/2008/01/servicemix-what-i-did-not-understand.html"&gt;ServiceMix: What I Did Not Understand&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://tompurcellstechblog.blogspot.com/2008/01/routingslip200.html"&gt;ServiceMix: The Use Case &amp;amp; What You Need to Implement It&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://tompurcellstechblog.blogspot.com/2008/01/servicemix-behavior-configuration.html"&gt;ServiceMix: Behavior Configuration&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://tompurcellstechblog.blogspot.com/2008/01/servicemix-pojo-part-1.html"&gt;ServiceMix: The POJO (Part 1)&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://tompurcellstechblog.blogspot.com/2008/01/servicemix-pojo-part-2.html"&gt;ServiceMix: The POJO (Part 2)&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://tompurcellstechblog.blogspot.com/2008/01/servicemix-behavior-configuration_31.html"&gt;ServiceMix: Behavior Configuration (Revisited)&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://tompurcellstechblog.blogspot.com/2008/02/servicemix-deployment-configuration.html"&gt;ServiceMix: Deployment Configuration&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://tompurcellstechblog.blogspot.com/2008/02/servicemix-test-client.html"&gt;ServiceMix: The Test Client (Part 1)&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://tompurcellstechblog.blogspot.com/2008/02/servicemix-test-client-part-2.html"&gt;ServiceMix: The Test Client (Part 2)&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://tompurcellstechblog.blogspot.com/2008/02/servicemix-when-things-go-wrong.html"&gt;ServiceMix: When Things Go Wrong&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;Okay, that's where we're going. Of course I reserve the right to swerve wildly off the road and into a ditch along the way. But, that's the point. When your sitting in the ditch, that's when you find out how to work a winch.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3093388502742613483-4178629186184542844?l=tompurcellstechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tompurcellstechblog.blogspot.com/feeds/4178629186184542844/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3093388502742613483&amp;postID=4178629186184542844' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3093388502742613483/posts/default/4178629186184542844'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3093388502742613483/posts/default/4178629186184542844'/><link rel='alternate' type='text/html' href='http://tompurcellstechblog.blogspot.com/2008/01/remember-me.html' title='Remember Me?'/><author><name>Tom Purcell</name><uri>http://www.blogger.com/profile/08510857197497824041</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp1.blogger.com/_DBCG_WlTapw/ReW9YUZ9EEI/AAAAAAAAAAs/CsqmyFiELc4/s320/tpurcell.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3093388502742613483.post-3939561445287997667</id><published>2007-04-13T20:00:00.000-04:00</published><updated>2007-04-13T16:41:01.567-04:00</updated><title type='text'>My Lucky Day: Iona Buys LogicBlaze</title><content type='html'>Well here it is, Friday the 13th, and I just found out that, after spending the last week looking into Fuse, Iona bought LogicBlaze. What does that mean for ServiceMix? It probably increases it viability. Iona is the big company behind  Celtix. Celtix now incorporates ServiceMix and ActiveMq (another LogicBlaze effort) in its stack. This is not case where we are left trying to decide what will survive. At least that is true for ServiceMix and ActiveMq but what about Fuse?&lt;br /&gt;&lt;br /&gt;Celtix lists the Eclipse STP (SOA Tools Platform) plugins as the tooling apparatus of choice. So, is Fuse dead?&lt;br /&gt;&lt;br /&gt;Too soon to tell and, frankly, I have not asked but my gut says Fuse will survive. It seems, from the little I know about  about Fuse and STP, that they address very different areas. STP seems to be more SCA and BPEL modeling (drag and drop GUI stuff). Fuse seems to be more about JBI installation and deployment.&lt;br /&gt;&lt;br /&gt;There is some overlap in the area of code generation but that will get resolved. At any rate it looks like Iona bought LogicBlaze more for the talent than the business. The talent likes Maven, which is the prime ingredient in Fuse, so I suspect that will stay.&lt;br /&gt;&lt;br /&gt;Will Fuse and STP play nice together? Good question, I was wondering about that too...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3093388502742613483-3939561445287997667?l=tompurcellstechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tompurcellstechblog.blogspot.com/feeds/3939561445287997667/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3093388502742613483&amp;postID=3939561445287997667' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3093388502742613483/posts/default/3939561445287997667'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3093388502742613483/posts/default/3939561445287997667'/><link rel='alternate' type='text/html' href='http://tompurcellstechblog.blogspot.com/2007/04/my-lucky-day-iona-buys-logicblaze.html' title='My Lucky Day: Iona Buys LogicBlaze'/><author><name>Tom Purcell</name><uri>http://www.blogger.com/profile/08510857197497824041</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp1.blogger.com/_DBCG_WlTapw/ReW9YUZ9EEI/AAAAAAAAAAs/CsqmyFiELc4/s320/tpurcell.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3093388502742613483.post-1005750428727668960</id><published>2007-04-13T19:25:00.000-04:00</published><updated>2007-04-13T16:21:24.547-04:00</updated><title type='text'>Fuse Tutorial: Dumb Stuff I Did (Chapter 2)</title><content type='html'>Okay, so this was dumb too, but at least I was able to figure out what I screwed up. After figuring out the first dumb mistake I ran the Maven2 install on the PricingAssembly project and got this:&lt;pre&gt;&lt;span style="font-size:100%;"&gt;&lt;blockquote&gt;[ERROR] project-execute :&lt;br /&gt;    com.mycompany:PricingAssemply:jbi-service-assembly:1.0-SNAPSHOT&lt;br /&gt;         (  task-segment: [install] )&lt;br /&gt;Diagnosis: Missing:&lt;br /&gt;----------&lt;br /&gt;1) com.mycompany:PricingService:jar:1.0-SNAPSHOT&lt;br /&gt;&lt;br /&gt;Try downloading the file manually from the project website.&lt;br /&gt;&lt;br /&gt;Then, install it using the command:&lt;br /&gt;mvn install:install-file -DgroupId=com.mycompany -DartifactId=PricingService \&lt;br /&gt;-Dversion=1.0-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file&lt;br /&gt;&lt;br /&gt;Path to dependency:&lt;br /&gt;1) com.mycompany:PricingAssemply:jbi-service-assembly:1.0-SNAPSHOT&lt;br /&gt;2) com.mycompany:PricingService:jar:1.0-SNAPSHOT&lt;/blockquote&gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;Early in the tutorial, when I created the PricingService, I poked around and looked at the pom.xml. I noticed the  groupId element had the value "com.mycompany" . I decided to get tricky and changed it to "MY" company (com.chariotsolutions) and promptly forgot about it. I did not change the groupId element on the PricingHttp project's pom and, more importantly, I used "com.mycompany" as the groupId entries for both PricingHttp and PricingService in the pom for the PricingAssemply.&lt;br /&gt;&lt;br /&gt;This meant that my PricingService got created in the "$HOME\.m2\repository\com\&lt;span style="font-weight: bold;"&gt;chariotsolutions&lt;/span&gt;" directory but the Maven build for the PricingAssembly was looking for it in "$HOME\.m2\repository\com\&lt;span style="font-weight: bold;"&gt;mycompany&lt;/span&gt;".&lt;br /&gt;&lt;br /&gt;So I went back to the PricingService project pom, changed "com.chariotsolutions" back to "com.mycompany", ran install on the PricingService project, ran install on the PricingAssembly project, ran publish on the server and then, finally, all was well.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3093388502742613483-1005750428727668960?l=tompurcellstechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tompurcellstechblog.blogspot.com/feeds/1005750428727668960/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3093388502742613483&amp;postID=1005750428727668960' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3093388502742613483/posts/default/1005750428727668960'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3093388502742613483/posts/default/1005750428727668960'/><link rel='alternate' type='text/html' href='http://tompurcellstechblog.blogspot.com/2007/04/fuse-tutorial-dumb-stuff-i-did-chapter_11.html' title='Fuse Tutorial: Dumb Stuff I Did (Chapter 2)'/><author><name>Tom Purcell</name><uri>http://www.blogger.com/profile/08510857197497824041</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp1.blogger.com/_DBCG_WlTapw/ReW9YUZ9EEI/AAAAAAAAAAs/CsqmyFiELc4/s320/tpurcell.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3093388502742613483.post-2324115196028135311</id><published>2007-04-11T18:45:00.000-04:00</published><updated>2007-04-11T17:02:26.674-04:00</updated><title type='text'>Fuse Tutorial: Dumb Stuff I Did (Chapter 1)</title><content type='html'>Well, nobody's perfect. In going through the "Create Contract First Web Services In Fuse" tutorial for Fuse two error conditions were raised that were probably my fault. Okay, strike that, I screwed up. I know &lt;span style="font-weight: bold; font-style: italic;"&gt;YOU&lt;/span&gt; won't make these mistakes but I thought I'd share them here in case someone &lt;span style="font-weight: bold; font-style: italic;"&gt;else&lt;/span&gt; screws up.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;First Dumb Mistake:&lt;/span&gt;&lt;br /&gt;On the first one I have to say I honestly do not know what went wrong. I think I followed the instructions pretty well but I did jump around a little (curiosity and the cat). If your PricingAssemply deploys and you do not get a 404 when you run the Web Service Explorer you can skip over this.  Anyway this is what happened.&lt;br /&gt;&lt;br /&gt;I made it all the way to the end of the tutorial. The Maven build said the  PricingAssembly deployed. When I went to the server console  &lt;span style="font-style: italic;"&gt;(http://localhost:8080/group/fuse/servicemix)&lt;/span&gt; my PricingAssembly was listed in the "JBI Upload" portlet and its status was started. I went back to Eclipse and followed the instructions for launching the Web Services Explorer and testing the PricingService. This is what I got:&lt;pre&gt;&lt;span style="font-size:130%;"&gt;&lt;blockquote&gt;IWAB0135E An unexpected error has occurred.&lt;br /&gt;404&lt;br /&gt;Not Found&lt;/blockquote&gt;&lt;/span&gt;&lt;/pre&gt;Well, that's not good. I checked the server logs and found nothing. Checked all my source files and found nothing. I started to, being a Java kind of guy, check my jar files and realized I was looking in the wrong place.&lt;br /&gt;&lt;br /&gt;ServiceMix, and ergo Fuse, is a JBI container. A JBI Service Assembly gets deployed as a zip file. Where's my PricingAssembly zip file? Its not in my Eclipse workspace. Its not in the hotdeploy directory under my Fuse server.  Wait a minute, its in my "home" directory. In windows that means:&lt;pre&gt;&lt;span style="font-size:130%;"&gt;&lt;blockquote&gt;C:\Documents and Settings\&amp;lt;yourIdHere&amp;gt;\.m2\repository\&lt;br /&gt;    com\mycompany\PricingAssemply\1.0-SNAPSHOT\&lt;br /&gt;         PricingAssemply-1.0-SNAPSHOT.zip&lt;/blockquote&gt;&lt;/span&gt;&lt;/pre&gt;I was a little surprised to see it there but, okay, whatever...&lt;br /&gt;&lt;br /&gt;According to JBI spec, and what we did in the tutorial, there ought to be two zips inside my Service Assembly zip: PricingHttp (binding component) and PricingService (service engine). When I checked PricingAssemply-1.0-SNAPSHOT.zip, however, there were no zips. There was a pom.xml and it had the following in the dependencies element:&lt;br /&gt;&lt;pre&gt;&lt;span style="font-size:130%;"&gt;&lt;blockquote&gt;&amp;lt;dependency&amp;gt;&lt;br /&gt;   &amp;lt;groupId&amp;gt;junit&amp;lt;/groupId&amp;gt;&lt;br /&gt;   &amp;lt;artifactId&amp;gt;junit&amp;lt;/artifactId&amp;gt;&lt;br /&gt;   &amp;lt;version&amp;gt;3.8.1&amp;lt;/version&amp;gt;&lt;br /&gt;   &amp;lt;scope&amp;gt;test&amp;lt;/scope&amp;gt;&lt;br /&gt;&amp;lt;/dependency&amp;gt;&lt;/blockquote&gt;&lt;/span&gt;&lt;/pre&gt;That is not what I had in my source. Remember that in creating the PricingAssembly project we were instructed to add the PricingHttp and PricingService as dependencies and to take Junit out. That's what I did. My pom.xml looked like this:&lt;br /&gt;&lt;pre&gt;&lt;span style="font-size:130%;"&gt;&lt;blockquote&gt;&amp;lt;dependency&amp;gt;&lt;br /&gt;   &amp;lt;groupId&amp;gt;com.mycompany&amp;lt;/groupId&amp;gt;&lt;br /&gt;   &amp;lt;artifactId&amp;gt;PricingHttp&amp;lt;/artifactId&amp;gt;&lt;br /&gt;   &amp;lt;version&amp;gt;1.0-SNAPSHOT&amp;lt;/version&amp;gt;&lt;br /&gt;&amp;lt;/dependency&amp;gt;&lt;br /&gt;&amp;lt;dependency&amp;gt;&lt;br /&gt;   &amp;lt;groupId&amp;gt;com.mycompany&amp;lt;/groupId&amp;gt;&lt;br /&gt;   &amp;lt;artifactId&amp;gt;PricingService&amp;lt;/artifactId&amp;gt;&lt;br /&gt;   &amp;lt;version&amp;gt;1.0-SNAPSHOT&amp;lt;/version&amp;gt;&lt;br /&gt;&amp;lt;/dependency&amp;gt;&lt;/blockquote&gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;Somewhere along the line I must have done something out of order and deployed the PricingAssembly before making the change. Anyway, I needed to redeploy?&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;Redeploy With Maven:&lt;/span&gt;&lt;br /&gt;I found it a little difficult to figure out exactly how to get Maven to really redeploy. And, in fact, it doesn't. What you want in the end is to rebuild and redeploy the "1.0-SNAPSHOT\PricingAssemply-1.0-SNAPSHOT.zip" that is in your windows home directory (C:\Documents and Settings\... See above).&lt;br /&gt;&lt;br /&gt;The Maven "Clean" phase does not help. It will "clean" out what is in your Eclipse workspace but the zip you want to rebuild is in your your windows home directory. There are a number of other phases exposed through the IDE  (test, generate sources, etc) however, the ones that looked most promising were build and install. So I gave them a whirl.&lt;br /&gt;&lt;br /&gt;Guess what, they both do the same thing. Launch either one and this is what you'll see:&lt;pre&gt;&lt;span style="font-size:130%;"&gt;&lt;blockquote&gt;[INFO] -------------------------------&lt;br /&gt;[INFO] Building A custom project&lt;br /&gt;[INFO]    task-segment: [install]&lt;br /&gt;[INFO] -------------------------------&lt;/blockquote&gt;&lt;/span&gt;&lt;/pre&gt;Which is okay because they do most of what you want. They rebuild the "1.0-SNAPSHOT\PricingAssemply-1.0-SNAPSHOT.zip". They do not, however, redeploy.&lt;br /&gt;&lt;br /&gt;After you run one of them you'll notice that your server's state in Eclipse is "Republish". Right click on the server and select "Publish". There you go. Your brand new "1.0-SNAPSHOT\PricingAssemply-1.0-SNAPSHOT.zip" is up and running.&lt;br /&gt;&lt;br /&gt;Unless, of course, you made the other dumb mistake I made. More on that in the next post.&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3093388502742613483-2324115196028135311?l=tompurcellstechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tompurcellstechblog.blogspot.com/feeds/2324115196028135311/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3093388502742613483&amp;postID=2324115196028135311' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3093388502742613483/posts/default/2324115196028135311'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3093388502742613483/posts/default/2324115196028135311'/><link rel='alternate' type='text/html' href='http://tompurcellstechblog.blogspot.com/2007/04/fuse-tutorial-dumb-stuff-i-did-chapter.html' title='Fuse Tutorial: Dumb Stuff I Did (Chapter 1)'/><author><name>Tom Purcell</name><uri>http://www.blogger.com/profile/08510857197497824041</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp1.blogger.com/_DBCG_WlTapw/ReW9YUZ9EEI/AAAAAAAAAAs/CsqmyFiELc4/s320/tpurcell.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3093388502742613483.post-5544684264230908238</id><published>2007-04-10T13:39:00.000-04:00</published><updated>2007-04-10T13:55:36.053-04:00</updated><title type='text'>Code Display Apologies</title><content type='html'>If you've been following this blog for a while you've probably realised that I've blogging for less than a week. I'm trying to get used to the constraints of what can be displayed. If your just ranting about your neighbor's barking dog then the text formatting that is available here is just fine. If, on the other hand, you are trying to show an excerpt from a log or an XML snippet or something where line wraps or a  missing &amp;lt;/ mean something, well, its a bit challenging.&lt;br /&gt;&lt;br /&gt;I've tried using &amp;lt;pre&amp;gt; tags and fiddled with fonts but I'm still not happy with the result. I will say it comes out a little better in IE then FireFox but that's not great since I prefer Linux.&lt;br /&gt;&lt;br /&gt;Well that's the end of my format rant for now. I promise I'll try to get better with the code stuff.&lt;br /&gt;&lt;br /&gt;Now, about that dog...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3093388502742613483-5544684264230908238?l=tompurcellstechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tompurcellstechblog.blogspot.com/feeds/5544684264230908238/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3093388502742613483&amp;postID=5544684264230908238' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3093388502742613483/posts/default/5544684264230908238'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3093388502742613483/posts/default/5544684264230908238'/><link rel='alternate' type='text/html' href='http://tompurcellstechblog.blogspot.com/2007/04/code-display-apologies.html' title='Code Display Apologies'/><author><name>Tom Purcell</name><uri>http://www.blogger.com/profile/08510857197497824041</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp1.blogger.com/_DBCG_WlTapw/ReW9YUZ9EEI/AAAAAAAAAAs/CsqmyFiELc4/s320/tpurcell.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3093388502742613483.post-2020154385725026925</id><published>2007-04-09T15:22:00.000-04:00</published><updated>2007-04-10T12:57:54.608-04:00</updated><title type='text'>LogicBlaze Fuse (ServiceMix): Tutorial 1</title><content type='html'>When you launch the Fuse IDE (another Eclipse with plug-ins) for the first time you get an Eclipse "Welcome" window. One of the choices is "Tutorials". Seemed like a good choice.&lt;br /&gt;&lt;br /&gt;I decided to start with the "Create Contract First Web Services In Fuse". This launches a Macromedia Captivate presentation (pretty slick). So I made some popcorn, grabbed my dollar store headphones and followed along.&lt;br /&gt;&lt;br /&gt;It became apparent pretty quickly that things were a little out of sync. It appears the presentation was done using an older version (1.2?) than what I was running (1.3). Its okay. I got through it but there were some differences that needed some figuring out. The following list details what they were and how I got around them:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;When creating the first project you are instructed to select a "JSR-181 Service based on WSDL" project from the "New Project" wizard. That selection does not exist in the 1.3 version of the Fuse IDE. Choose "Contract First Service" instead.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;In creating the WSDL you are instructed to add a "getPrice" method. In the presentation the service Input changes to "getPriceRequest" and the Output changes to "getPriceResponse". In my IDE the Output changed to "getPriceResponse" but the Input changed to "getPrice". The difference had no long term effect on the assembly or running of the tutorial but it did cause me to stop and scratch my head for a bit. Clearly I did something wrong. I did not. Neither did you.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;The next thing really got me. When the WSDL is done and its time to generate source the presentation moves really quick and its difficult to see exactly what gets clicked.  The  presenter  right clicks on the PricingService project , goes down to the "Build Phase" menu item and selects "generate-sources". In Fuse IDE 1.3 "Build Phase", and therefore its sub-selections, do not exist. Instead of "Build Phase" select "Run As". Then select "Maven2 generate sources".&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Shortly after that you run into another menu issue. You're told you need to "Synchronize with Maven" after you create a folder named "java". There is no "Synchronize with Maven" in the menu. I could not figure out what to do so I went into the pom.xml for the project  and added the following to the resources element:&lt;/li&gt;&lt;/ul&gt;&lt;blockquote&gt;&amp;lt;resource&amp;gt;&lt;br /&gt;&amp;lt;directory&amp;gt;src/main/java&amp;lt;/directory&amp;gt;&lt;br /&gt;&amp;lt;/resource&amp;gt;&lt;/blockquote&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Things go pretty well up until you finish creating the  PricingHttp consumer. There you'll run into another descrepacncy in the Maven2 implementation. You are instructed to select a project, right click, go down the list of actions to "Build Phase" and select "install". Instead, select the project, go down the  list of actions to  "Run As" and select "Maven2 install". As instructed do this for both the PricingHttp and the PricingService projects.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;In running the install on the PricingService project I got some ugly build errors:&lt;pre&gt;Unable to locate the Javac Compiler in:&lt;br /&gt;C:\Program Files\Java\jre1.5.0_06\..\lib\tools.jar Please ensure you are using JDK 1.4 or above and...&lt;/pre&gt;Note the "jre". I'm running the standard Sun 1.5.0_6 JDK. There is no "tools.jar in the "jre" but there is one in the JDK. So, in Eclipse, I went to Windows, Preferences, Java, Installed JREs and added the "jdk1.5.0_6" by navigating to "C:\Program Files\Java\jdk1.5.0_06". I reran the "Run As",  "Maven2 install" and all was well.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;One last issue popped up: deployment failed. This is what I saw in the projectDeply console:&lt;div style="text-align: justify;"&gt;&lt;blockquote&gt;&lt;pre&gt;[INFO] PricingAssemply is not deployed&lt;br /&gt;[INFO] Deploying jbi-service-assembly from C:\Documents and Settings\tom\.m2\repository\com\mycompany\PricingAssemply\1.0-SNAPSHOT\PricingAssemply-1.0-SNAPSHOT.zip&lt;br /&gt;[ERROR] mojo-execute : jbi:projectDeploy&lt;br /&gt;Diagnosis: Unable to deploy project, Error accessing ServiceMix administration&lt;br /&gt;FATAL ERROR: Error executing Maven for a project&lt;br /&gt;[ERROR] project-execute : com.mycompany:PricingAssemply:jbi-service-assembly:1.0-SNAPSHOT (  task-segment: [jbi:projectDeploy] )&lt;br /&gt;Diagnosis: Unable to deploy project, Error accessing ServiceMix administration&lt;br /&gt;FATAL ERROR: Error executing Maven for a project&lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;/div&gt;I wasn't sure that was helpful so I went to the server console and found a pretty long stack trace with xml snippets and IllegalArgumaentExceptions and all kinds of other nastyness but I'll cut to the chase. Here was the important part:&lt;blockquote&gt;&lt;pre&gt;Caused by: java.net.URISyntaxException: Illegal character&lt;br /&gt;  in path at index 16: file:/C:/Program Files/FUSE-1.3.0/FUSE-1.3.0/data/s....&lt;/pre&gt;&lt;/blockquote&gt;We don't need the whole line because if we count to 16 we find out the "Illegal character" is the &amp;lt;space&amp;gt; in "Program&amp;lt;space&amp;gt;Files" of the windows directory where the Fuse install placed the server. I copied the entire "FUSE-1.3.0" directory structure up one level (so that "Program Files" was no longer part of the path) and from that point on it was smooth sailing.&lt;/li&gt;&lt;/ul&gt;Well, almost smooth. I did some dumb things along the way that caused some consternation. The dumb things I did and what I learned from them will be my next topic.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3093388502742613483-2020154385725026925?l=tompurcellstechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tompurcellstechblog.blogspot.com/feeds/2020154385725026925/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3093388502742613483&amp;postID=2020154385725026925' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3093388502742613483/posts/default/2020154385725026925'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3093388502742613483/posts/default/2020154385725026925'/><link rel='alternate' type='text/html' href='http://tompurcellstechblog.blogspot.com/2007/04/logicblaze-fuse-servicemix-tutorial-1.html' title='LogicBlaze Fuse (ServiceMix): Tutorial 1'/><author><name>Tom Purcell</name><uri>http://www.blogger.com/profile/08510857197497824041</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp1.blogger.com/_DBCG_WlTapw/ReW9YUZ9EEI/AAAAAAAAAAs/CsqmyFiELc4/s320/tpurcell.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3093388502742613483.post-1950756894240162028</id><published>2007-04-08T11:38:00.000-04:00</published><updated>2007-04-08T08:46:18.364-04:00</updated><title type='text'>LogicBlaze Fuse (ServiceMix): Get and Install</title><content type='html'>Fuse has been put together by our friends at &lt;a href="http://www.logicblaze.com/"&gt;LogicBlaze&lt;/a&gt;. It is a packaging of several open source initiatives (ServiceMix, ActiveMQ, etc) and is itself open source. It addresses an area that has been lagging up until now in the open source SOA offerings namely tooling. Before we get started let me point out that there is a very active ServiceMix community. It appears that their &lt;a href="http://www.nabble.com/ServiceMix---User-f12050.html"&gt;user forum&lt;/a&gt; is the appropriate place to seek help. Now lets take a look at Fuse.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;font-family:georgia;" &gt;Get It:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;First you need to know that you must download two pieces for Fuse:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The server:  &lt;a href="http://www.logicblaze.com/content/view/63/81/"&gt;http://www.logicblaze.com/content/view/63/81/&lt;/a&gt;&lt;/li&gt;&lt;li&gt;The IDE:      &lt;a href="http://www.logicblaze.com/content/view/88/151/"&gt;http://www.logicblaze.com/content/view/88/151/&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;Install the Server:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;My development platform is a Dell Inspiron 6000 running Suse Linux 10.1. So, naturally, I downloaded the Linux installs. First hurdle: the install bombed.  This is not an "untar and cd to bin" install but an actual install process. I tried all of the Linux installs and all resulted in something similar to the following:&lt;br /&gt;&lt;pre&gt;Preparing to install...&lt;br /&gt;Extracting the JRE from the installer archive...&lt;br /&gt;Unpacking the JRE...&lt;br /&gt;Extracting the installation resources from the installer archive...&lt;br /&gt;Configuring the installer for this system's environment...&lt;br /&gt;awk: error while loading shared libraries: libdl.so.2: cannot open shared object file: No such file or directory&lt;br /&gt;dirname: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory&lt;br /&gt;/bin/ls: error while loading shared libraries: librt.so.1: cannot open shared object file: No such file or directory&lt;br /&gt;basename: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory&lt;br /&gt;dirname: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory&lt;br /&gt;basename: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory&lt;br /&gt;hostname: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory&lt;br /&gt;&lt;br /&gt;Launching installer...&lt;br /&gt;&lt;br /&gt;grep: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory&lt;br /&gt;/tmp/install.dir.21727/Linux/resource/jre/bin/java: error while loading shared libraries: libpthread.so.0: cannot open shared object file: No such file or directory&lt;br /&gt;&lt;/pre&gt;Not what I was hoping for so I posted the problem on the forum and moved on. I have access to a Windows machine (ugh!) so I remote desk topped to it, downloaded the FUSE-1.3_win.exe and ran it. This worked flawlessly and installed the server.&lt;br /&gt;&lt;br /&gt;I guess I should say right now that it probably is not totally correct to call it "The Server". What you are really installing is a Jetty server configured to run Fuse. You can also get one that will run WASCE. Presumably it will run on tomcat or anything else but that's a challenge for some future date. At any rate the I now had a "server" to work with, on to the IDE.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;And Then the IDE:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;The IDE IS an "untar and cd" install. I was able to launch on Suse with no trouble but since I did not have a local server I decided to stick with Windows for the time being. It launched okay there too. Looks like its time to kick some tires.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3093388502742613483-1950756894240162028?l=tompurcellstechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tompurcellstechblog.blogspot.com/feeds/1950756894240162028/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3093388502742613483&amp;postID=1950756894240162028' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3093388502742613483/posts/default/1950756894240162028'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3093388502742613483/posts/default/1950756894240162028'/><link rel='alternate' type='text/html' href='http://tompurcellstechblog.blogspot.com/2007/04/logicblaze-fuse-servicemix-get-and.html' title='LogicBlaze Fuse (ServiceMix): Get and Install'/><author><name>Tom Purcell</name><uri>http://www.blogger.com/profile/08510857197497824041</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp1.blogger.com/_DBCG_WlTapw/ReW9YUZ9EEI/AAAAAAAAAAs/CsqmyFiELc4/s320/tpurcell.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3093388502742613483.post-4502615131045963675</id><published>2007-04-07T11:50:00.000-04:00</published><updated>2007-04-08T08:45:21.357-04:00</updated><title type='text'>Evaluate</title><content type='html'>Okay so lets get started. We all know how well the "Hello World" app works in most software products. Its easy, it scales, it performs and has there ever been an app that has enjoyed more reuse than "Hello World"?&lt;br /&gt;&lt;br /&gt;But what happened when you changed it to say "Goodbye World"? How easy was it to change? When you and your pair programing partner logged on at the same time did it scale? Did it continue to perform when you both hit enter at the same time?  Could you reuse the example to do anything at all in the real world?&lt;br /&gt;&lt;br /&gt;That's what this evaluation is going to be about.  Once through the "Hello World" is the thing usable? I will go through the examples shipped with a product for two reasons. The first is that it probably is the best place to kick the tires and find out what the product's approach is.&lt;br /&gt;&lt;br /&gt;The second is that experience indicates that examples are usually put together by some one who is intimately familiar with the product. They now you should NEVER hit the F8 key in the middle of step 13 in the process or you'll format your hard drive. So they don't. Me, on the other hand, well... you get the point.&lt;br /&gt;&lt;br /&gt;So we'll start with the examples and I'll let you know what did not go exactly according to the script. It may be that I'm an idiot and missed something. Actually I am an IDIOT and I WILL miss something. If that's the case please comment and together, hopefully, we'll save some of our friends and colleagues some time and effort.&lt;br /&gt;&lt;br /&gt;Once past "Hello World" we'll try some "Real World" and see how things work out when we actually use the software. This, off course, will all be subjective. As stated above I may be missing something. If I'm wrong let me know. Please don't let me go blindly along formatting hard drives. Thanks.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3093388502742613483-4502615131045963675?l=tompurcellstechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tompurcellstechblog.blogspot.com/feeds/4502615131045963675/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3093388502742613483&amp;postID=4502615131045963675' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3093388502742613483/posts/default/4502615131045963675'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3093388502742613483/posts/default/4502615131045963675'/><link rel='alternate' type='text/html' href='http://tompurcellstechblog.blogspot.com/2007/04/evaluate.html' title='Evaluate'/><author><name>Tom Purcell</name><uri>http://www.blogger.com/profile/08510857197497824041</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp1.blogger.com/_DBCG_WlTapw/ReW9YUZ9EEI/AAAAAAAAAAs/CsqmyFiELc4/s320/tpurcell.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3093388502742613483.post-625650110696193767</id><published>2007-04-06T12:41:00.000-04:00</published><updated>2007-04-08T08:44:39.673-04:00</updated><title type='text'>Day 1</title><content type='html'>Okay, my current focus is Service Oriented Architecture (&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;SOA&lt;/span&gt;). Of  course, given the nature of IT, that could change at any moment but that's what it is right now. I'm going through an evaluation of products in this space and I'll try to share my experience here. I'll start with what I think I know so far.&lt;br /&gt;&lt;br /&gt;First &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;SOA&lt;/span&gt; is a concept and not a product. There are products that will aid in the implementation but no product will deliver &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;SOA&lt;/span&gt;. I've written enough bad code in the past to know that any framework can be abused. You can construct poorly performing, smokestack applications that are brittle and inflexible in Ruby or Java or C or &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;Rexx&lt;/span&gt; or PL1 or COBOL or ... (don't make me date myself).&lt;br /&gt;&lt;br /&gt;So what is important about &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;SOA&lt;/span&gt; is not the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;SOA&lt;/span&gt; "product" you chose but the architectural approach. Essentially there is really only one commandment:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;Thou shalt not commit point to point.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Well, okay, its not that simple. But the point is that you need to start thinking of your applications in terms of reusable services and not as one-offs. This means establishing clean interfaces and using standard protocols. These techniques result in the elusive "loosely coupled" services that provide an IT infrastructure that is more responsive to business needs.&lt;br /&gt;&lt;br /&gt;This sounds simple but it meets with a great deal of resistance because old habits die hard. The imperative is usually to get it done yesterday. So instead of all this highfalutin &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;SOA&lt;/span&gt; stuff we wind up FTP'ing a file from IBM mainframe A to &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;WinTel&lt;/span&gt; box B, cook up a script to translate &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;EBCDIC&lt;/span&gt; to ASCII and then go to the bar, pat ourselves on the back and marvel at our innate abilities.&lt;br /&gt;&lt;br /&gt;The beer flows and were all happy till the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;CIO&lt;/span&gt; sends a text messages saying we need to do the &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_10"&gt;same thing&lt;/span&gt; again. But its UNIX box C that needs to talk to &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_11"&gt;WinTel&lt;/span&gt; B... and its a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;csv&lt;/span&gt; file... and some missing data has to be added to it... and that's in the DEC box we've been trying to retire. Ssh, what a buzz-kill!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;If we service enabled the apps on IBM mainframe A, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_13"&gt;WinTel&lt;/span&gt; box B, UNIX box C and the DEC older than dirt box we pay a price because it requires some real thought. It requires embracing some standards and technologies that have a &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_14"&gt;learning&lt;/span&gt; curve. It requires an investment in infrastructure. And it requires adding some cycles to the &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_15"&gt;development&lt;/span&gt; effort &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_16"&gt;initially&lt;/span&gt; to reap &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_17"&gt;efficiencies&lt;/span&gt; down the road.&lt;br /&gt;&lt;br /&gt;If we are willing to pay that price, however, IBM mainframe A, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_13"&gt;WinTel&lt;/span&gt; box B, UNIX box C and the DEC older than dirt box are then all exposed via standard protocols as services on a message bus. Then, when we swap out the DEC older than dirt box for an app on our slick new Linux machine, no one needs to know. As long as the interfaces are honored we're good. If the CTO and CFO dream up some new scheme we can just bang out some BPEL and go back to the bar.&lt;br /&gt;&lt;br /&gt;Well, that's the promise of SOA. Lets see how it works out.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3093388502742613483-625650110696193767?l=tompurcellstechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tompurcellstechblog.blogspot.com/feeds/625650110696193767/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3093388502742613483&amp;postID=625650110696193767' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3093388502742613483/posts/default/625650110696193767'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3093388502742613483/posts/default/625650110696193767'/><link rel='alternate' type='text/html' href='http://tompurcellstechblog.blogspot.com/2007/02/day-1.html' title='Day 1'/><author><name>Tom Purcell</name><uri>http://www.blogger.com/profile/08510857197497824041</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp1.blogger.com/_DBCG_WlTapw/ReW9YUZ9EEI/AAAAAAAAAAs/CsqmyFiELc4/s320/tpurcell.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3093388502742613483.post-8572649752701217130</id><published>2007-02-28T12:35:00.000-05:00</published><updated>2008-11-18T17:20:33.417-05:00</updated><title type='text'>My Picture (A Work In Progress)</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_DBCG_WlTapw/ReW9YUZ9EEI/AAAAAAAAAAs/CsqmyFiELc4/s1600-h/tpurcell.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://2.bp.blogspot.com/_DBCG_WlTapw/ReW9YUZ9EEI/AAAAAAAAAAs/CsqmyFiELc4/s320/tpurcell.jpg" alt="" id="BLOGGER_PHOTO_ID_5036639983775846466" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3093388502742613483-8572649752701217130?l=tompurcellstechblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tompurcellstechblog.blogspot.com/feeds/8572649752701217130/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3093388502742613483&amp;postID=8572649752701217130' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3093388502742613483/posts/default/8572649752701217130'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3093388502742613483/posts/default/8572649752701217130'/><link rel='alternate' type='text/html' href='http://tompurcellstechblog.blogspot.com/2007/02/my-picture-work-in-progress.html' title='My Picture (A Work In Progress)'/><author><name>Tom Purcell</name><uri>http://www.blogger.com/profile/08510857197497824041</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp1.blogger.com/_DBCG_WlTapw/ReW9YUZ9EEI/AAAAAAAAAAs/CsqmyFiELc4/s320/tpurcell.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_DBCG_WlTapw/ReW9YUZ9EEI/AAAAAAAAAAs/CsqmyFiELc4/s72-c/tpurcell.jpg' height='72' width='72'/><thr:total>0</thr:total></entry></feed>
