You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by James Carr <ja...@gmail.com> on 2010/02/11 03:42:49 UTC

camelProxy + seda question

Hi,

Exploring camel proxies a bit, and a little confused. I have two beans
defined in my spring context that I want to first make them work by
using direct, then switch to use seda. In the first case I have this:

<camel:camelContext id="context">
		<camel:proxy id="warehouseProxy" serviceUrl="direct:warehouse"
			serviceInterface="org.jamescarr.example.domain.Warehouse" />
		<camel:export id="warehouse"
serviceInterface="org.jamescarr.example.domain.Warehouse"
			serviceRef="warehouseImpl" uri="direct:warehouse" />
	</camel:camelContext>
	<bean id="warehouseImpl"
class="org.jamescarr.example.domain.SprocketWarehouse" />

	<bean id="orderSite" class="org.jamescarr.example.domain.OrderSite">
		<property name="warehouse" ref="warehouseProxy"></property>
	</bean>

I have a main class that simply gets orderSite and places five orders.
Using direct it works, however when I switch to direct to seda it gets
the first order then waits for awhile before throwing this exception:
org.apache.camel.ExchangeTimedOutException: The OUT message was not
received within: 30000 millis on the exchange: Exchange[Message:
BeanInvocation public abstract void
org.jamescarr.example.domain.Warehouse.shipProduct(org.jamescarr.example.domain.ShippingOrder)
with [org.jamescarr.example.domain.ShippingOrder@67fe80]]]

any idea what gives?

Thanks,
James

Re: camelProxy + seda question

Posted by James Carr <ja...@gmail.com>.
Hi Claus,

I'll admit I did ask too soon, only 5 minutes after I submitted the
question I figured it out.

As for the question on why I wanted to use proxy with seda, I'm
essentially working on some examples of having domain code remaining
unchanged while changing the transports between objects, starting with
direct, to seda using multi-threading, to JMS queues, to CXF, etc. It
seemed like proxying was the best way to do that, but if I'm doing it
wrong please let me know. :)

Thanks!
James

On Thu, Feb 11, 2010 at 1:32 AM, Claus Ibsen <cl...@gmail.com> wrote:
> Hi
>
> Please take a look at this wiki page before asking for help
> http://camel.apache.org/support.html
>
> What is the first highlighted bullet in that list?
>
> The timeout is apparently because the seda is request/reply and no
> reply have been received within the 30 seconds.
> See the timeout option
> http://camel.apache.org/seda.html
>
> Its a bit hard to help when you do not show sample code.
>
> And frankly why do you want to proxy using seda? Shouldn't the proxied
> client not wait for a reply? Hence direct should be used.
>
>
>
> On Thu, Feb 11, 2010 at 3:42 AM, James Carr <ja...@gmail.com> wrote:
>> Hi,
>>
>> Exploring camel proxies a bit, and a little confused. I have two beans
>> defined in my spring context that I want to first make them work by
>> using direct, then switch to use seda. In the first case I have this:
>>
>> <camel:camelContext id="context">
>>                <camel:proxy id="warehouseProxy" serviceUrl="direct:warehouse"
>>                        serviceInterface="org.jamescarr.example.domain.Warehouse" />
>>                <camel:export id="warehouse"
>> serviceInterface="org.jamescarr.example.domain.Warehouse"
>>                        serviceRef="warehouseImpl" uri="direct:warehouse" />
>>        </camel:camelContext>
>>        <bean id="warehouseImpl"
>> class="org.jamescarr.example.domain.SprocketWarehouse" />
>>
>>        <bean id="orderSite" class="org.jamescarr.example.domain.OrderSite">
>>                <property name="warehouse" ref="warehouseProxy"></property>
>>        </bean>
>>
>> I have a main class that simply gets orderSite and places five orders.
>> Using direct it works, however when I switch to direct to seda it gets
>> the first order then waits for awhile before throwing this exception:
>> org.apache.camel.ExchangeTimedOutException: The OUT message was not
>> received within: 30000 millis on the exchange: Exchange[Message:
>> BeanInvocation public abstract void
>> org.jamescarr.example.domain.Warehouse.shipProduct(org.jamescarr.example.domain.ShippingOrder)
>> with [org.jamescarr.example.domain.ShippingOrder@67fe80]]]
>>
>> any idea what gives?
>>
>> Thanks,
>> James
>>
>
>
>
> --
> Claus Ibsen
> Apache Camel Committer
>
> Author of Camel in Action: http://www.manning.com/ibsen/
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
>

Re: camelProxy + seda question

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Please take a look at this wiki page before asking for help
http://camel.apache.org/support.html

What is the first highlighted bullet in that list?

The timeout is apparently because the seda is request/reply and no
reply have been received within the 30 seconds.
See the timeout option
http://camel.apache.org/seda.html

Its a bit hard to help when you do not show sample code.

And frankly why do you want to proxy using seda? Shouldn't the proxied
client not wait for a reply? Hence direct should be used.



On Thu, Feb 11, 2010 at 3:42 AM, James Carr <ja...@gmail.com> wrote:
> Hi,
>
> Exploring camel proxies a bit, and a little confused. I have two beans
> defined in my spring context that I want to first make them work by
> using direct, then switch to use seda. In the first case I have this:
>
> <camel:camelContext id="context">
>                <camel:proxy id="warehouseProxy" serviceUrl="direct:warehouse"
>                        serviceInterface="org.jamescarr.example.domain.Warehouse" />
>                <camel:export id="warehouse"
> serviceInterface="org.jamescarr.example.domain.Warehouse"
>                        serviceRef="warehouseImpl" uri="direct:warehouse" />
>        </camel:camelContext>
>        <bean id="warehouseImpl"
> class="org.jamescarr.example.domain.SprocketWarehouse" />
>
>        <bean id="orderSite" class="org.jamescarr.example.domain.OrderSite">
>                <property name="warehouse" ref="warehouseProxy"></property>
>        </bean>
>
> I have a main class that simply gets orderSite and places five orders.
> Using direct it works, however when I switch to direct to seda it gets
> the first order then waits for awhile before throwing this exception:
> org.apache.camel.ExchangeTimedOutException: The OUT message was not
> received within: 30000 millis on the exchange: Exchange[Message:
> BeanInvocation public abstract void
> org.jamescarr.example.domain.Warehouse.shipProduct(org.jamescarr.example.domain.ShippingOrder)
> with [org.jamescarr.example.domain.ShippingOrder@67fe80]]]
>
> any idea what gives?
>
> Thanks,
> James
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus