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 Green <ja...@gmail.com> on 2011/07/13 15:47:07 UTC

Lazily connecting to an endpoint

Hi,

I have a route to an xmpp:// endpoint. Trouble is, if that XMPP server is
not "up", I cannot start ActiveMQ. It throws a
FailedToCreateProducerException and promptly shuts itself down again.

Is there an option to the URL to only connect on demand? I have added some
code to handle errors which I wish to test.

James

Re: Lazily connecting to an endpoint

Posted by James Green <ja...@gmail.com>.
I have created an issue:

https://issues.apache.org/jira/browse/CAMEL-4224

Couldn't the lazySessionConnection be moved into a superclass for all
endpoints to use? Or was that already ruled out?

At least my error handler works when XMPP is shut down after Camel begins.
:-)

James

On 13 July 2011 15:00, Claus Ibsen <cl...@gmail.com> wrote:

> On Wed, Jul 13, 2011 at 3:47 PM, James Green <ja...@gmail.com>
> wrote:
> > Hi,
> >
> > I have a route to an xmpp:// endpoint. Trouble is, if that XMPP server is
> > not "up", I cannot start ActiveMQ. It throws a
> > FailedToCreateProducerException and promptly shuts itself down again.
> >
> > Is there an option to the URL to only connect on demand? I have added
> some
> > code to handle errors which I wish to test.
>
> Some components offer this option, like camel-mina. They have a
> lazySessionConnection option.
>
> The camel-xmpp component may need such an option as well. Fell free to
> create a JIRA.
>
> You can also configures routes to not auto start, but the routes will
> still be prepared, and thus the xmpp endpoint may still fail on
> startup
>
> http://camel.apache.org/configuring-route-startup-ordering-and-autostartup.html
>
>
> >
> > James
> >
>
>
>
> --
> Claus Ibsen
> -----------------
> FuseSource
> Email: cibsen@fusesource.com
> Web: http://fusesource.com
> Twitter: davsclaus, fusenews
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/
>

Re: Lazily connecting to an endpoint

Posted by Claus Ibsen <cl...@gmail.com>.
On Wed, Jul 13, 2011 at 3:47 PM, James Green <ja...@gmail.com> wrote:
> Hi,
>
> I have a route to an xmpp:// endpoint. Trouble is, if that XMPP server is
> not "up", I cannot start ActiveMQ. It throws a
> FailedToCreateProducerException and promptly shuts itself down again.
>
> Is there an option to the URL to only connect on demand? I have added some
> code to handle errors which I wish to test.

Some components offer this option, like camel-mina. They have a
lazySessionConnection option.

The camel-xmpp component may need such an option as well. Fell free to
create a JIRA.

You can also configures routes to not auto start, but the routes will
still be prepared, and thus the xmpp endpoint may still fail on
startup
http://camel.apache.org/configuring-route-startup-ordering-and-autostartup.html


>
> James
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/