Dynamically changing SQL with INSERT

2016-07-07 Thread jamie3
I am trying to automatically create the SQL query for inserting data into
Oracle using SQL component. I have not found much documentation related to
this. Any ideas?


from("jms:queue:INPUT.Q")
.routeId("ens reports log route")
.convertBodyTo(String.class)
.process(new Processor() {
@Override
public void process(Exchange exchange) throws Exception 
{
exchange.getIn().setBody("INSERT INTO Test 
VALUES ('" +
exchange.getIn().getBody() + "')?dataSource=#dataSource");
}
})
.to("sql:?dataSource=#dataSource");



--
View this message in context: 
http://camel.465427.n5.nabble.com/Dynamically-changing-SQL-with-INSERT-tp5784938.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Apache Camel + Microsoft Azure Service Bus

2016-06-22 Thread jamie3
I am wondering if there is a component for Azure Service Bus. IIRC service
bus supports AMQP but I am wondering if there is a native component?





--
View this message in context: 
http://camel.465427.n5.nabble.com/Apache-Camel-Microsoft-Azure-Service-Bus-tp5784320.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Apache Camel RedHat Slidedeck?

2016-04-20 Thread jamie3
Thank you very much.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Apache-Camel-RedHat-Slidedeck-tp5781433p5781441.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Apache Camel RedHat Slidedeck?

2016-04-20 Thread jamie3
Hi everyone,

I am wondering if it is possible to get a copy of the slidedeck from this
presentation.

https://www.youtube.com/watch?v=91UiQgazt3g

Currently I work for a large company who uses expensive proprietary
integration solutions. My goal is to showcase open source alternatives to
the expensive vendors.

Kind regards.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Apache-Camel-RedHat-Slidedeck-tp5781433.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Shutting down route with jms

2016-02-01 Thread jamie3
A bit of an update. I changed the code to use control bus. The logs show that
control bus is signaling to the camel context to shut down, however when
inspecting the debug thread, the Camel JMSConsumer class is still running,
as shown below with 1 inflight and pending exchange. My processor logic will
not mark the JMS message as acknowledged. I haven't looked at whether camel
is rolling back the JMS transaction. It appears the JMSConsumer thread is
waiting for the transaction to be rolled back.

2016-02-01 12:53:21 ERROR DeliveryRouter:145 - Failed to send email.
Shutting down delivery engine
2016-02-01 12:53:21 INFO  DefaultCamelContext:1833 - Apache Camel 2.13.0
(CamelContext: camel-1) is shutting down
2016-02-01 12:53:21 INFO  DefaultShutdownStrategy:173 - Starting to graceful
shutdown 1 routes (timeout 10 seconds)
2016-02-01 12:53:21 INFO  DefaultShutdownStrategy:573 - Waiting as there are
still 1 inflight and pending exchanges to complete, timeout in 10 seconds.
2016-02-01 12:53:22 INFO  DefaultShutdownStrategy:573 - Waiting as there are
still 1 inflight and pending exchanges to complete, timeout in 9 seconds.
2016-02-01 12:53:23 INFO  DefaultShutdownStrategy:573 - Waiting as there are
still 1 inflight and pending exchanges to complete, timeout in 8 seconds.
2016-02-01 12:53:24 INFO  DefaultShutdownStrategy:573 - Waiting as there are
still 1 inflight and pending exchanges to complete, timeout in 7 seconds.
2016-02-01 12:53:25 INFO  DefaultShutdownStrategy:573 - Waiting as there are
still 1 inflight and pending exchanges to complete, timeout in 6 seconds.
2016-02-01 12:53:26 INFO  DefaultShutdownStrategy:573 - Waiting as there are
still 1 inflight and pending exchanges to complete, timeout in 5 seconds.
2016-02-01 12:53:27 INFO  DefaultShutdownStrategy:573 - Waiting as there are
still 1 inflight and pending exchanges to complete, timeout in 4 seconds.
2016-02-01 12:53:28 INFO  DefaultShutdownStrategy:573 - Waiting as there are
still 1 inflight and pending exchanges to complete, timeout in 3 seconds.
2016-02-01 12:53:29 INFO  DefaultShutdownStrategy:573 - Waiting as there are
still 1 inflight and pending exchanges to complete, timeout in 2 seconds.
2016-02-01 12:53:30 INFO  DefaultShutdownStrategy:573 - Waiting as there are
still 1 inflight and pending exchanges to complete, timeout in 1 seconds.
2016-02-01 12:53:31 WARN  DefaultShutdownStrategy:202 - Timeout occurred.
Forcing the routes to be shutdown now.
2016-02-01 12:53:31 WARN  DefaultShutdownStrategy:581 - Interrupted while
waiting during graceful shutdown, will force shutdown now.
2016-02-01 12:53:31 INFO  DefaultShutdownStrategy:610 - Route: route1
shutdown complete, was consuming from:
Endpoint[mq://queue:ENS.NOTIFICATION.Q?acknowledgementModeName=CLIENT_ACKNOWLEDGE&concurrentConsumers=10]


.

// 10 threads used to connect to IBM MQ
// If messages are successfully sent to email server we will 
commit the
transaction, otherwise rollback
// to MQ and shutdown the route if fails more than 3 times in a 
single
exchange
String props =
"?concurrentConsumers=10" +
"&acknowledgementModeName=CLIENT_ACKNOWLEDGE";

Endpoint mq = endpoint("mq:queue:ENS.NOTIFICATION.Q" + props);
Endpoint shutdownRoute =
endpoint("controlbus:language:simple?async=true");

// wait 30 seconds
getContext().getShutdownStrategy().setTimeout(10);

getContext().getShutdownStrategy().setSuppressLoggingOnTimeout(true);

onException(EmitException.class)
.maximumRedeliveries(2)
.handled(false)
.delay(3000)
.log(LoggingLevel.ERROR, "Failed to send email. 
Shutting down delivery
engine")
.setBody(simple("${camelContext.stop()}"))
.to(shutdownRoute)
.end();

// Routing logic for processing the message
from(mq)
.id("delivery")
.process(messageHandler);



--
View this message in context: 
http://camel.465427.n5.nabble.com/Shutting-down-route-with-jms-tp5777011p5777113.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Shutting down route with jms

2016-01-30 Thread jamie3
Thanks quinn! I'll try this out!

On Sat, Jan 30, 2016 at 10:30 AM, Quinn Stevenson [via Camel] <
ml-node+s465427n5777058...@n5.nabble.com> wrote:

> I normally use the ControlBus EIP (
> http://camel.apache.org/controlbus.html <
> http://camel.apache.org/controlbus.html> ) for this kind of thing - then
> I don’t have to write any custom processors or other supporting code.
>
>
> > On Jan 30, 2016, at 12:16 AM, Claus Ibsen <[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5777058&i=0>> wrote:
> >
> > See this FAQ
> > http://camel.apache.org/how-can-i-stop-a-route-from-a-route.html
> >
> > On Fri, Jan 29, 2016 at 8:24 PM, jamie3 <[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5777058&i=1>> wrote:
> >> I have a Camel route as follows:
> >>
> >> onException(EmitException.class)
> >>.maximumRedeliveries(3)
> >>.handled(true)
> >>.delay(3000)
> >>.process(new ShutdownRoute("Failed to send
> email"))
> >>.end();
> >>
> >> from("jms:queue:someQueue?acknowledgementModeName=CLIENT_ACKNOWLEDGE")
> >> to(myProcessor);
> >>
> >> class ShutdownRoute implements Processor {
> >>@Override
> >>public void process(Exchange exg) throws Exception {
> >>LOG.fatal("Shutting down service: " + message);
> >>exg.getContext().stop();
> >>}
> >> }
> >>
> >>
> >> myProcessor contains logic to send the message to another system. If
> that
> >> system becomes unavailable I want to shutdown the camel route and stop
> >> listening for JMS messages.
> >>
> >> The JMS connection factory fetched from JNDI using WebSphere
> Application
> >> Server and MQ.
> >>
> >> I do receive the call back for ShutdownRoute however when I stop the
> camel
> >> context, MQ shows that the JMS connections are still active. I've
> confirmed
> >> that I cannot send anymore messages to the queue, thus the connection
> >> factory is connected to MQ but not accepting messages.
> >>
> >> Even if I stop the EAR file in WAS (which contains my camel route) the
> jms
> >> connections are still active.
> >>
> >> Also since I have CLIENT_ACKNOWLEDGE mode enabled the messages are
> placed
> >> back onto the queue only when I restart WAS.
> >>
> >> What I am trying to do is completely shutdown Camel and the connections
> to
> >> MQ via JMS. Is this possible? Am I implementing this correctly, or is
> there
> >> a better way?
> >>
> >>
> >>
> >>
> >> --
> >> View this message in context:
> http://camel.465427.n5.nabble.com/Shutting-down-route-with-jms-tp5777011.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
>
>
>
> --
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/Shutting-down-route-with-jms-tp5777011p5777058.html
> To unsubscribe from Shutting down route with jms, click here
> <http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5777011&code=amFtaWUzQGdtYWlsLmNvbXw1Nzc3MDExfDE2Mjk2MjEyNTg=>
> .
> 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>
>



-- 
Jamie




--
View this message in context: 
http://camel.465427.n5.nabble.com/Shutting-down-route-with-jms-tp5777011p5777059.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Shutting down route with jms

2016-01-30 Thread jamie3
Thanks Claus, since my original post I tried shutting it down from another
thread. I can see 9 out of 10 JMSConsumer threads being shut down. It's only
until I shutdown WAS that the message is put back on the Queue.

Luckily I have the source code, so I'll do some more digging and report
back!



--
View this message in context: 
http://camel.465427.n5.nabble.com/Shutting-down-route-with-jms-tp5777011p5777057.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Shutting down route with jms

2016-01-29 Thread jamie3
I have a Camel route as follows:

onException(EmitException.class)
.maximumRedeliveries(3)
.handled(true)
.delay(3000)
.process(new ShutdownRoute("Failed to send email"))
.end();

from("jms:queue:someQueue?acknowledgementModeName=CLIENT_ACKNOWLEDGE")
to(myProcessor);

class ShutdownRoute implements Processor {
@Override
public void process(Exchange exg) throws Exception {
LOG.fatal("Shutting down service: " + message);
exg.getContext().stop();
}
}


myProcessor contains logic to send the message to another system. If that
system becomes unavailable I want to shutdown the camel route and stop
listening for JMS messages.

The JMS connection factory fetched from JNDI using WebSphere Application
Server and MQ.

I do receive the call back for ShutdownRoute however when I stop the camel
context, MQ shows that the JMS connections are still active. I've confirmed
that I cannot send anymore messages to the queue, thus the connection
factory is connected to MQ but not accepting messages.

Even if I stop the EAR file in WAS (which contains my camel route) the jms
connections are still active.

Also since I have CLIENT_ACKNOWLEDGE mode enabled the messages are placed
back onto the queue only when I restart WAS.

What I am trying to do is completely shutdown Camel and the connections to
MQ via JMS. Is this possible? Am I implementing this correctly, or is there
a better way?




--
View this message in context: 
http://camel.465427.n5.nabble.com/Shutting-down-route-with-jms-tp5777011.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Shutting down route with jms

2016-01-29 Thread jamie3
Further investigation it seems the JMS Consumer threads are not being
shutdown and the Camel logger is outputting the following:


[1/29/16 15:04:59:785 MST] 0039 SystemOut O 2016-01-29 15:04:59 WARN 
DefaultShutdownStrategy:202 - Timeout occurred. Forcing the routes to be
shutdown now.
[1/29/16 15:04:59:786 MST] 0044 SystemOut O 2016-01-29 15:04:59 WARN 
DefaultShutdownStrategy:581 - Interrupted while waiting during graceful
shutdown, will force shutdown now.
[1/29/16 15:05:24:041 MST] 0045 SystemOut O 2016-01-29 15:05:24
FATAL ShutdownRoute:21 - Shutting down delivery engine: Failed to send email
[1/29/16 15:07:20:269 MST] 003f SystemOut O 2016-01-29 15:07:20 WARN 
DefaultShutdownStrategy:202 - Timeout occurred. Forcing the routes to be
shutdown now.
[1/29/16 15:07:20:270 MST] 0046 SystemOut O 2016-01-29 15:07:20 WARN 
DefaultShutdownStrategy:581 - Interrupted while waiting during graceful
shutdown, will force shutdown now


Seems like the thread is blocked and likely causing camel to block as well.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Shutting-down-route-with-jms-tp5777011p5777018.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Comparison of Apache Camel and IBM Integration Bus v9.0

2015-05-15 Thread jamie3
http://beertechcode.blogspot.ca/2015/05/my-first-experiences-with-camel-and-iib9.html



--
View this message in context: 
http://camel.465427.n5.nabble.com/Comparison-of-Apache-Camel-and-IBM-Integration-Bus-v9-0-tp5766171p5767125.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Comparison of Apache Camel and IBM Integration Bus v9.0

2015-05-15 Thread jamie3
https://www.blogger.com/blogger.g?blogID=7490556759974154576#editor/target=post;postID=8340010403315101673;onPublishedMenu=allposts;onClosedMenu=allposts;postNum=0;src=postname



--
View this message in context: 
http://camel.465427.n5.nabble.com/Comparison-of-Apache-Camel-and-IBM-Integration-Bus-v9-0-tp5766171p5767124.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Comparison of Apache Camel and IBM Integration Bus v9.0

2015-05-01 Thread jamie3
I absolutely agree. I do mention this in my blog post. And if you read my
second post I mentioned I will be discussing things such as Camel + Apache
Service Mix and other technologies. 

Also the point of the blog is really to offer people a comparison between
both offerings, even though camel is not an ESB it shares many similar
things to IB9, e.g. Patterins/Components/etc... so I want to dive deep into
this.

Not everyone needs an ESB and Camel is a great alternative IMO.

I will make sure I update that statement to include Karaf/ServiceMix and
ActiveMQ as well, just to make sure people aren't confused.

Cheers



--
View this message in context: 
http://camel.465427.n5.nabble.com/Comparison-of-Apache-Camel-and-IBM-Integration-Bus-v9-0-tp5766171p5766578.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Comparison of Apache Camel and IBM Integration Bus v9.0

2015-04-30 Thread jamie3
Here is the second post in the series.

http://beertechcode.blogspot.ca/2015/05/the-3-foot-view-of-apache-camel-and.html




--
View this message in context: 
http://camel.465427.n5.nabble.com/Comparison-of-Apache-Camel-and-IBM-Integration-Bus-v9-0-tp5766171p5766563.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Comparison of Apache Camel and IBM Integration Bus v9.0

2015-04-27 Thread jamie3
Haha touche. I will make sure it is fixed. Thanks.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Comparison-of-Apache-Camel-and-IBM-Integration-Bus-v9-0-tp5766171p5766385.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Comparison of Apache Camel and IBM Integration Bus v9.0

2015-04-23 Thread jamie3
Sure thing. Once there is enough content we can make arrangements to put it
on the camel site.

It will take a few months of posts. So far I'm up to about 7000+ words. So I
need to spend some time organizing things and figuring out how to make it
readable, and not boring.

I'll be heading to Hursley IBM campus in June so will get a nice deep
discussion with the IBM development team and it will fill a lot of my
questions.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Comparison-of-Apache-Camel-and-IBM-Integration-Bus-v9-0-tp5766171p5766217.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Comparison of Apache Camel and IBM Integration Bus v9.0

2015-04-22 Thread jamie3
Hello everyone. I'm not sure if this is the right area but I will be
providing a deep comparison of Apache Camel and Integration Bus v9.0 in a
series of upcoming blog posts. Just wanted to share this with the community.

http://beertechcode.blogspot.ca/2015/04/a-detailed-and-hopefully-un-biased.html

  




--
View this message in context: 
http://camel.465427.n5.nabble.com/Comparison-of-Apache-Camel-and-IBM-Integration-Bus-v9-0-tp5766171.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Field support for OGNL/simple

2013-08-20 Thread jamie3
The camel documentation for the simple component shows that it doesn't
support fields except in 2.11 onwards for the .length in java arrays.

Are fields expected to be added in the future?

If not can you tell the simple component to provide a custom getter class
for the object? For example (psuedo code):

from("direct:somewhere")
.log("Value is ${customRenderer:body}")

where custom customRenderer points to a bean somewhere in the context that
can fetch the field value?



--
View this message in context: 
http://camel.465427.n5.nabble.com/Field-support-for-OGNL-simple-tp5737609.html
Sent from the Camel - Users mailing list archive at Nabble.com.