Hi You can use some logic to determine if that JMS route should be started or not. You can then start / stop that route on demand.
Either manually from Java code or implementing your own RoutePolicy http://camel.apache.org/routepolicy.html On Wed, Dec 30, 2009 at 10:28 AM, rdomingo <[email protected]> wrote: > > Hello, > > I have a multibus scenario (POC) to learn about a number of features > related to using camel. > > In the current scenario I like a consumer to upload a file (over http) to my > first bus (my local camel instance), this bus proxies the request to a > second bus (my global routing bus). This second (global routing) bus knows > where the provider is located and sends it to the local bus of the provider > where the provider receives it. All this seems to work fine, see my config > snapshots below: > > My problem: > Currently when my provider is not running, the consumer request won't stay > queued. I guess because of [route 3] will keep reading the jms queue and > keeps bridging the messages to the provider which isn't there. > > I Guess it should only read from jms on request, but I don't know how to > read jms on http request. > > When I remove [route 3] from my global bus the request seems to stay queued. > And when I add [route 3] to my provider, all seems to work ok. But, I don't > want my provider to connect directly to the jms queue of the global routing > bus, all traffic should be routed through the local bus. > > Question: > How can I rewrite [route 3], [route 4] and [route 5] so: > - when I start my provider, it will ask it's local bus for requests [route > 5]; > - the local bus will (on request) ask the global bus for requests [route 4]; > - the global bus will read the jms queue when the request from local bus is > received [route 3]; > > Of course any other hints / solutions are appreciated ! > > > ## camel context 1 - local bus of consumer ## > <!-- [route 1] local bus of the consumer, this will proxy http request to > second (global) bus --> > <route> > <from > uri="jetty:http://0.0.0.0:8101/clipboard?matchOnUriPrefix=true" /> > <to > uri="http://0.0.0.0:8201?throwExceptionOnFailure=false&bridgeEndpoint=true" > /> > </route> > > ## camel context 2 - global routing bus## > <!-- [route 2] remote (global) bus config snapshot, this will publish the > http request to a jms queue --> > <route> > <from uri="jetty:http://0.0.0.0:8201/clipboard/upload"/> > <to uri="jms:queue:uploads?disableReplyTo=true" async="true"/> > </route> > > <!-- [route 3] remote (global) bus config snapshot, this will read the jms > queue and bridge it to the local bus of the provider --> > <route> > <from uri="jms:queue:uploads?transacted=true"/> > <to > uri="http://0.0.0.0:8102?throwExceptionOnFailure=false&bridgeEndpoint=true"/> > </route> > > ## camel context 4 - local bus of provider ## > <!-- [route 4] local bus of the provider, forwared the request to the > provider --> > <route> > <from > uri="jetty:http://0.0.0.0:8102/clipboard?matchOnUriPrefix=true" /> > <to > uri="http://0.0.0.0:9101?throwExceptionOnFailure=false&bridgeEndpoint=true" > /> > </route> > > ## camel context 5 - provider ## > <!-- [route 5] my provider --> > <route> > <from uri="jetty:http://0.0.0.0:9101/clipboard/upload"/> > <to uri="bean:clipboardBean?method=upload" /> > </route> > > Best regards, > Raymond Domingo > -- > View this message in context: > http://old.nabble.com/Newbie%3A-need-little-help-http-%3Ehttp-bridge-%3Ejms-%3Ehttp-bridge-%3Ehttp-tp26965511p26965511.html > Sent from the Camel - Users mailing list archive at Nabble.com. > > -- 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
