You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by dcparga <dc...@gmail.com> on 2016/08/17 14:45:52 UTC

Camel SEDA timeout: Update it at runtime

Hi all,

I'm trying to implement a seda route to handle rest calls asynchronously.
The point is, that I would like to handle different timeouts per call, which
leads the problem to be able to change the timeout of the seda route using a
parameter on the HTTP header. As far as I know, the timeout it's only set
when the route is created, and the purpose of these APIs are for a high
performance service, it's not a solution to stop and start the route for
every single call, so, my ideal approach would be to be able to change the
timeout dynamically accessing to the endpoint through the context.

If I'm missing something, or there is an existing solution for this problem,
please let me know and excuse me.

Thank you



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-SEDA-timeout-Update-it-at-runtime-tp5786538.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel SEDA timeout: Update it at runtime

Posted by Vitalii Tymchyshyn <vi...@tym.im>.
You can try using dynamic to (
http://camel.apache.org/how-to-use-a-dynamic-uri-in-to.html) to set timeout
option from header.

Best regards, Vitalii Tymchyshyn

Ср, 17 серп. 2016 10:45 користувач dcparga <dc...@gmail.com> пише:

> Hi all,
>
> I'm trying to implement a seda route to handle rest calls asynchronously.
> The point is, that I would like to handle different timeouts per call,
> which
> leads the problem to be able to change the timeout of the seda route using
> a
> parameter on the HTTP header. As far as I know, the timeout it's only set
> when the route is created, and the purpose of these APIs are for a high
> performance service, it's not a solution to stop and start the route for
> every single call, so, my ideal approach would be to be able to change the
> timeout dynamically accessing to the endpoint through the context.
>
> If I'm missing something, or there is an existing solution for this
> problem,
> please let me know and excuse me.
>
> Thank you
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-SEDA-timeout-Update-it-at-runtime-tp5786538.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: Camel SEDA timeout: Update it at runtime

Posted by dcparga <dc...@gmail.com>.
Ranx, the timeouts can change even for the same resource. The main idea
behind this approach is to be able to use a Resource in different workflows,
so, the available time allowed per operation can change in function of the
process that is being performed.

I'm setting up the routes using REST DSL and redirecting them to seda and
creating a new route from seda (using the generated id) to a Bean with the
implented class.

I understand that you're solution is to use a dynamic route using the
recipientList, something like:

from the actual approach
.to("seda:"+id+"?timeout=1000");

to something like
.recipientList(simple("seda:"+id+"?timeout=${header.timeout}")) ? 



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-SEDA-timeout-Update-it-at-runtime-tp5786538p5786564.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel SEDA timeout: Update it at runtime

Posted by Brad Johnson <br...@mediadriver.com>.
Are the REST timeouts the same for a given resource or would it change even
for the resource?  The reason I ask is that you could have a seda queue per
method/resource and use a recipientList to route to the correct queue
associated with that request.

Obviously this also depends some on how you do your REST.  If you have an
API interface and expose it via CXF it is easy to use the opertionName to
route.  I'm using direct-vm in this case as I usually have the actual
implemention in a different bundle with a different camel context and if I
want to switch to SEDA I do it internally in the implementing bundle.


<recipientList>
<simple>direct-vm:${header.operationName}</simple>
</recipientList>


On Wed, Aug 17, 2016 at 9:52 AM, José Luis Pedrosa <jl...@gmail.com>
wrote:

> I think this may require a small change on seda component to accept values
> in a haeader for example. I think maybe a Jira ticket should be better?
>
> Claus?
>
> Rgds
>
> On Aug 17, 2016 16:46, "dcparga" <dc...@gmail.com> wrote:
>
> > Hi all,
> >
> > I'm trying to implement a seda route to handle rest calls asynchronously.
> > The point is, that I would like to handle different timeouts per call,
> > which
> > leads the problem to be able to change the timeout of the seda route
> using
> > a
> > parameter on the HTTP header. As far as I know, the timeout it's only set
> > when the route is created, and the purpose of these APIs are for a high
> > performance service, it's not a solution to stop and start the route for
> > every single call, so, my ideal approach would be to be able to change
> the
> > timeout dynamically accessing to the endpoint through the context.
> >
> > If I'm missing something, or there is an existing solution for this
> > problem,
> > please let me know and excuse me.
> >
> > Thank you
> >
> >
> >
> > --
> > View this message in context: http://camel.465427.n5.nabble.
> > com/Camel-SEDA-timeout-Update-it-at-runtime-tp5786538.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
> >
>

Re: Camel SEDA timeout: Update it at runtime

Posted by chandler <pe...@sandia.gov>.
It would be nice if ALL the JMS/Exchange system headers/properties were
persevered in the SEDA Queue. Example: /replyto correlationID, .../



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-SEDA-timeout-Update-it-at-runtime-tp5786538p5786544.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel SEDA timeout: Update it at runtime

Posted by José Luis Pedrosa <jl...@gmail.com>.
I think this may require a small change on seda component to accept values
in a haeader for example. I think maybe a Jira ticket should be better?

Claus?

Rgds

On Aug 17, 2016 16:46, "dcparga" <dc...@gmail.com> wrote:

> Hi all,
>
> I'm trying to implement a seda route to handle rest calls asynchronously.
> The point is, that I would like to handle different timeouts per call,
> which
> leads the problem to be able to change the timeout of the seda route using
> a
> parameter on the HTTP header. As far as I know, the timeout it's only set
> when the route is created, and the purpose of these APIs are for a high
> performance service, it's not a solution to stop and start the route for
> every single call, so, my ideal approach would be to be able to change the
> timeout dynamically accessing to the endpoint through the context.
>
> If I'm missing something, or there is an existing solution for this
> problem,
> please let me know and excuse me.
>
> Thank you
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.
> com/Camel-SEDA-timeout-Update-it-at-runtime-tp5786538.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>