You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by nikagra <ni...@gmail.com> on 2013/05/10 12:34:50 UTC
Synchronous InOnly with new message
Hello
I'm looking for a way to implement synchronous InOnly with new message body
(wich is empty in my case)
My route makes some processing of some task and I want in some moments
update status of this processing. Number of statuses is quite large. So I've
decided to make updating synchronous to get rid of possible problems. Body
of the message could be also quite big (greater then 1 mb of xml). Since
message body is not used for updating status I'd like to set it to null to
not to overload activemq
First attempt:
// Task processing route
.setHeader(CamelConstants.TASK_STATUS, constant("NEW"))
.inOnly("direct:updateStatus")
// Status updating route
from("direct:updateStatus").routeId("direct:updateStatus")
.setBody(constant(null))
.inOnly("activemq:queue:updateStatus");
Problem is that this changes initial exchange message
Next attempt is to use WireTap. Problem is that it is asynchronous. Also
wireTap could not be last expression in route (i.e. to set status "DONE")
I think I'm missing something. What are other options?
--
View this message in context: http://camel.465427.n5.nabble.com/Synchronous-InOnly-with-new-message-tp5732258.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Synchronous InOnly with new message
Posted by nikagra <ni...@gmail.com>.
Thanks for the reply
I need the body.
Message processing requires some steps (i.e. XSL transformation or some XML
related processing with custom processors). I want on each of this step
update processing status (i.e. QUEUED, STARTED, IN_PROGRESS, DONE). Task
processing is performed asynchronously regarding to processing request, but
I want it to be stright forward to avoid problems with concurrent status
updates. So, I classifies my requirement as "Synchronous Request Only" in
terms of this <http://camel.apache.org/async.html> article
Sorry if I'm not expressing myself clearly
Thanks in advance
--
View this message in context: http://camel.465427.n5.nabble.com/Synchronous-InOnly-with-new-message-tp5732258p5732393.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Synchronous InOnly with new message
Posted by Willem jiang <wi...@gmail.com>.
What you want to do with the initial message body?
If you don't need that body object anymore , you can set it to be null.
--
Willem Jiang
Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang
Weibo: 姜宁willem
On Friday, May 10, 2013 at 6:34 PM, nikagra wrote:
> Hello
>
> I'm looking for a way to implement synchronous InOnly with new message body
> (wich is empty in my case)
>
> My route makes some processing of some task and I want in some moments
> update status of this processing. Number of statuses is quite large. So I've
> decided to make updating synchronous to get rid of possible problems. Body
> of the message could be also quite big (greater then 1 mb of xml). Since
> message body is not used for updating status I'd like to set it to null to
> not to overload activemq
>
> First attempt:
> // Task processing route
> .setHeader(CamelConstants.TASK_STATUS, constant("NEW"))
> .inOnly("direct:updateStatus")
>
> // Status updating route
> from("direct:updateStatus").routeId("direct:updateStatus")
> .setBody(constant(null))
> .inOnly("activemq:queue:updateStatus");
>
> Problem is that this changes initial exchange message
>
> Next attempt is to use WireTap. Problem is that it is asynchronous. Also
> wireTap could not be last expression in route (i.e. to set status "DONE")
>
> I think I'm missing something. What are other options?
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Synchronous-InOnly-with-new-message-tp5732258.html
> Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).