You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by rick51 <ri...@g3ti.net> on 2013/03/12 16:24:30 UTC

Restlet component and misordered inbound messages

I have an Apache Tomcat/Camel/ActiveMQ architecture, and for the most part,
things are working pretty well.  I do have a problem with keeping inbound
HTTP posts in order, though.

I'm using the Restlet: URI to invoke a processor.  The processor takes a
look at the inbound HTTP message and decides what to do with it, and will
frequently post it to an activeMQ queue.   The nature of the HTTP client is
bursty, and in fact will send multiple requests back-to-back, using
different TCP connections.   Unfortunately, the messages frequently get
posted to activeMQ out of order.

The restlet defaults indicate that there are 10 threads serving the HTTP
endpoint.  I see in the restlet documentation that the maxThreads is
configurable.  I believe that if I set this to 1, that would solve my
ordering problem.

I am a latecomer to the design, and an new at Camel.  I see in the "Camel in
Action" book that it may be better to use a filter than write my own queue
pre-processor, but that change is beyond the scope of fixing this ordering
bug.  I'm just tasked with getting the inbound messages to the queue in
order.  I'd like to configure the solution rather than rework the
implementation.

I have two questions.  First, am I on the right track in setting the restlet
max threads?  Second, what is the syntax for doing this in the XML file? 
I've tried a few different ways, but with no luck.  I can't seem to find an
example either.

I tried setting maxThreads in the URI in the <route>, but that didn't work
(the maxThreads is a component property, so it makes sense this would fail). 
I also tried setting the property in the restlet component bean two
different ways:

   <bean id="RestletComponent" class="org.restlet.Component">
		<property name="maxThreads" value="1" />
   </bean>

and

   <bean id="RestletComponent" class="org.restlet.Component">
		<init-param>
			<param-name>maxThreads</param-name>
 			<param-value>1</param-value>
		</init-param>
   </bean>
		
In all these failure cases, Apache Tomcat failed to load up my .war file.

Thanks for any advice you can offer.

-Rick




--
View this message in context: http://camel.465427.n5.nabble.com/Restlet-component-and-misordered-inbound-messages-tp5729001.html
Sent from the Camel - Users mailing list archive at Nabble.com.