You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Al Ferguson <al...@hotmail.com> on 2013/05/13 20:13:01 UTC

Steps to replace a direct call by a JMS proxy?

Hi,

I currently have a Java application that sends directly messages to a queue
using a Spring JmsTemplate:

I would like to take advantage of the facilities of Camel Throttling but I
do not see how to define my route. Could someone help me and tell me what I
have to do?

Regards,
Al. F



--
View this message in context: http://camel.465427.n5.nabble.com/Steps-to-replace-a-direct-call-by-a-JMS-proxy-tp5732430.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Steps to replace a direct call by a JMS proxy?

Posted by Al Ferguson <al...@hotmail.com>.
Got it, thanks



--
View this message in context: http://camel.465427.n5.nabble.com/Steps-to-replace-a-direct-call-by-a-JMS-proxy-tp5732430p5732516.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Steps to replace a direct call by a JMS proxy?

Posted by Christian Schneider <ch...@die-schneider.net>.
You just send to "direct:endpoint". This will trigger the route 
Christian Posta described and the throttling should work.

You can of course not directly define the throttling in the 
producerTemplate as you only can define an endpoint uri. For this case 
we have the direct endpoint that can then nicely bridge to an existing 
route without any further indirection.

Christian

On 14.05.2013 14:15, Al Ferguson wrote:
> Thank you.
>
> As a first step, I would like to get it working using a template. When done,
> Maybe I'll separate the logic in a separate bean.
>
> But... How to make throttling with using a producertemplate? Is is possible?
>
> Thanks,
> Al. F
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Steps-to-replace-a-direct-call-by-a-JMS-proxy-tp5732430p5732488.html
> Sent from the Camel - Users mailing list archive at Nabble.com.


-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com


Re: Steps to replace a direct call by a JMS proxy?

Posted by Al Ferguson <al...@hotmail.com>.
Thank you.

As a first step, I would like to get it working using a template. When done,
Maybe I'll separate the logic in a separate bean.

But... How to make throttling with using a producertemplate? Is is possible?

Thanks,
Al. F



--
View this message in context: http://camel.465427.n5.nabble.com/Steps-to-replace-a-direct-call-by-a-JMS-proxy-tp5732430p5732488.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Steps to replace a direct call by a JMS proxy?

Posted by Christian Schneider <ch...@die-schneider.net>.
There is one additional thing you need. You have to call your route in 
some way.

There are two methods:
1. camelContext.createProducerTemplate().sendBody or similar
2. pojo messaging: http://camel.apache.org/pojo-messaging-example.html

Depending on your application it may make sense to use pojo messaging to 
separate your business code from the camel framework.

Christian


Am 14.05.2013 04:30, schrieb Christian Posta:
> May want to take a look at some of the intro material:
> http://camel.apache.org/getting-started.html
>
> Essentially, you'll need to define a route builder that a builds a route
> like:
>
> from("direct:endpoint").throttle().to("jms:queueName")
>
> http://camel.apache.org/cookbook.html
> http://camel.apache.org/jms.html
>
>
>
> On Mon, May 13, 2013 at 11:13 AM, Al Ferguson <al...@hotmail.com> wrote:
>
>> Hi,
>>
>> I currently have a Java application that sends directly messages to a queue
>> using a Spring JmsTemplate:
>>
>> I would like to take advantage of the facilities of Camel Throttling but I
>> do not see how to define my route. Could someone help me and tell me what I
>> have to do?
>>
>> Regards,
>> Al. F
>>
>>
>>
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/Steps-to-replace-a-direct-call-by-a-JMS-proxy-tp5732430.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>
>


-- 
  
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
Talend Application Integration Division http://www.talend.com


Re: Steps to replace a direct call by a JMS proxy?

Posted by Christian Posta <ch...@gmail.com>.
May want to take a look at some of the intro material:
http://camel.apache.org/getting-started.html

Essentially, you'll need to define a route builder that a builds a route
like:

from("direct:endpoint").throttle().to("jms:queueName")

http://camel.apache.org/cookbook.html
http://camel.apache.org/jms.html



On Mon, May 13, 2013 at 11:13 AM, Al Ferguson <al...@hotmail.com> wrote:

> Hi,
>
> I currently have a Java application that sends directly messages to a queue
> using a Spring JmsTemplate:
>
> I would like to take advantage of the facilities of Camel Throttling but I
> do not see how to define my route. Could someone help me and tell me what I
> have to do?
>
> Regards,
> Al. F
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Steps-to-replace-a-direct-call-by-a-JMS-proxy-tp5732430.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta