You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by sa_james <sa...@hotmail.com> on 2016/12/01 15:07:06 UTC

stand-alone problem

Here I am again with a simple test:

/from("jms:queue").to("log:test")/

/  <bean id="wsMQConnectionFactorySpCached"  
class="org.springframework.jms.connection.CachingConnectionFactory">
    <property name="targetConnectionFactory"
ref="webSphereConnectionFactory" />
    <property name="reconnectOnException" value="true" />
  </bean>/

After I have started the app:

 INFO  Route: route1 started and consuming from: jms://queue
 INFO  Total 1 routes, of which 1 are started.
 INFO  Apache Camel 2.18.0 (CamelContext: camel-1) started in 0.481 seconds

Application has now been started. You can press ctrl + c to stop.

Then here the app exits.

Main function as usual:

/        Main main = new Main();
        main.setApplicationContextUri("META-INF/spring/camel-context.xml");
        main.start();
        System.out.println("\n\nApplication has now been started. You can
press ctrl + c to stop.\n\n");/


What is happening? Any idea?
I could not find anything in the mailing list.






--
View this message in context: http://camel.465427.n5.nabble.com/stand-alone-problem-tp5790885.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: stand-alone problem

Posted by souciance <so...@gmail.com>.
Did you look here for an example for how to keep it running forever as a
standalone app?
http://camel.apache.org/running-camel-standalone-and-have-it-keep-running.html

On Thu, Dec 1, 2016 at 4:29 PM, sa_james [via Camel] <
ml-node+s465427n5790889h22@n5.nabble.com> wrote:

> So If I ditch spring and go back to using setters, everything will be
> fine?
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://camel.465427.n5.nabble.com/stand-alone-problem-
> tp5790885p5790889.html
> To start a new topic under Camel - Users, email
> ml-node+s465427n465428h31@n5.nabble.com
> To unsubscribe from Camel - Users, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=465428&code=c291Y2lhbmNlLmVxZGFtLnJhc2h0aUBnbWFpbC5jb218NDY1NDI4fDE1MzI5MTE2NTY=>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://camel.465427.n5.nabble.com/stand-alone-problem-tp5790885p5790891.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: stand-alone problem

Posted by sa_james <sa...@hotmail.com>.
So If I ditch spring and go back to using setters, everything will be fine?



--
View this message in context: http://camel.465427.n5.nabble.com/stand-alone-problem-tp5790885p5790889.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: stand-alone problem

Posted by souciance <so...@gmail.com>.
I am not experienced with spring but it seems your context is started and
then there is nothing to keeps it going to so it dies straight away.
Normally with a Main() you need to add code to keep it running forever. Via
blueprint or spring the context is injected..

On Thu, Dec 1, 2016 at 4:23 PM, sa_james [via Camel] <
ml-node+s465427n5790887h60@n5.nabble.com> wrote:

> If I set a breakpoint at the last statement, it will consumes messages
> from the queue.
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://camel.465427.n5.nabble.com/stand-alone-problem-
> tp5790885p5790887.html
> To start a new topic under Camel - Users, email
> ml-node+s465427n465428h31@n5.nabble.com
> To unsubscribe from Camel - Users, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=465428&code=c291Y2lhbmNlLmVxZGFtLnJhc2h0aUBnbWFpbC5jb218NDY1NDI4fDE1MzI5MTE2NTY=>
> .
> NAML
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://camel.465427.n5.nabble.com/stand-alone-problem-tp5790885p5790888.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: stand-alone problem

Posted by sa_james <sa...@hotmail.com>.
If I set a breakpoint at the last statement, it will consumes messages from
the queue.




--
View this message in context: http://camel.465427.n5.nabble.com/stand-alone-problem-tp5790885p5790887.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: stand-alone problem

Posted by sa_james <sa...@hotmail.com>.
Wow, 
it works. I have been struggling for two days as to why it would all of a
sudden stop working. And to make matter worse, the connect/reconnect from
spring that I reported in  this post
<http://camel.465427.n5.nabble.com/camel-jms-tp5790832.html>   also started
working.
Thanks a log Claus.
Camel rocks.



--
View this message in context: http://camel.465427.n5.nabble.com/stand-alone-problem-tp5790885p5790897.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: stand-alone problem

Posted by Claus Ibsen <cl...@gmail.com>.
Use the run method instead of start.

On Thu, Dec 1, 2016 at 4:07 PM, sa_james <sa...@hotmail.com> wrote:
> Here I am again with a simple test:
>
> /from("jms:queue").to("log:test")/
>
> /  <bean id="wsMQConnectionFactorySpCached"
> class="org.springframework.jms.connection.CachingConnectionFactory">
>     <property name="targetConnectionFactory"
> ref="webSphereConnectionFactory" />
>     <property name="reconnectOnException" value="true" />
>   </bean>/
>
> After I have started the app:
>
>  INFO  Route: route1 started and consuming from: jms://queue
>  INFO  Total 1 routes, of which 1 are started.
>  INFO  Apache Camel 2.18.0 (CamelContext: camel-1) started in 0.481 seconds
>
> Application has now been started. You can press ctrl + c to stop.
>
> Then here the app exits.
>
> Main function as usual:
>
> /        Main main = new Main();
>         main.setApplicationContextUri("META-INF/spring/camel-context.xml");
>         main.start();
>         System.out.println("\n\nApplication has now been started. You can
> press ctrl + c to stop.\n\n");/
>
>
> What is happening? Any idea?
> I could not find anything in the mailing list.
>
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/stand-alone-problem-tp5790885.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2