we set the idleTimeout to 0 in the PooledConnectionFactory config like
this...
**
-
Ben O'Day
IT Consultant -http://consulting-notes.com
--
View this message in context:
yes. do you have any specific questions about creating routes?
on the deployment side, Camel can be embedded in any existing Java app, run
in Tomcat, in OSGi or standalone mode...
I generally use Tomcat and Spring to bootstrap the context:
http://camel.apache.org/servlet-tomcat-example.html
Tim, the SEDA component is designed to produce/consume messages quickly and
provides a queue (BlockingQueue) in between resources to buffer the flow and
provides options such as max size and blockWhenFull to limit memory usage
and slow a producer as needed, etc...
http://camel.apache.org/seda.htm
there isn't a reach through cache design pattern implementation...that
said, given that both redis/mongdb components support producing/consuming,
this shouldn't be difficult to use along with some simple conditional logic
implemented via a filter or content based router...
here is a pseudo route
bacar, as suggested...use a completionTimeout value greater than 0...this
will complete when a max size of 100 is reached OR after no new messages are
received for that amount of time...whichever is FIRST...
also, if you have a max delay requirement, then use the completionInterval()
instead to
Niels, I think what you are looking for is not throttling, but single
threading groups of related messages, correct? If so, then ActiveMQ message
groups is designed for exactly that and is trivial to implement...
Just route your messages through a JMS queue and set the JMSXGroupId header
set to
yep, SEDA uses a BlockingQueue and is asynchronous from the producer (the
process that sends to your seda:trades endpoint)...so if you specify
concurrentConsumers=100 then it will use 100 threads to pull messages off
the queue and execute your route in parallel...
simafengyun wrote
Hi All,
I
you might try adding a depends-on attribute to the camelContext
definition to tell Spring the order to start/stop things...
camelContext id=camel.dev autoStartup=${camel.auto.startup}
xmlns=http://camel.apache.org/schema/spring; depends-on=activemq,
remote.activemq
Paul Gale wrote
Hi,
remove these lines from testSendMatchingMessage(), this is handled by
CamelTestSupport automatically and causing duplicate direct:start routes
context.addRoutes(createRouteBuilder());
context.start();
Frankiboy wrote
What is wrong here
Green test, but notning happens i
the issue is also with your template/mock setup...you are mixing concepts a
bit...
remove the declarations outside of the method and just do something like
this...
MockEndpoint mock = getMockEndpoint(mock:result);
mock.expectedBodiesReceived(expected result);
you should direct this to the hawtio forum instead: http://hawt.io/community/
Happy User wrote
Could someone help me with the below issue?
1. I gave credentials in preferences for ActiveMQ.
2. I created Queue in the default broker and it was successful.
3. I selected the queue and clicked
what endpoint are you producing to? if you are using ActiveMQ with the VM
transport, then you can disable serialization by setting this property on
the connection factory...
ActiveMQConnectionFactory factory = new
ActiveMQConnectionFactory(vm://localhost);
sounds like you need to either disable security in the activemq.xml or setup
your Camel AMQ factory with the user/pw provided...
bean id=activemq
class=org.apache.activemq.camel.component.ActiveMQComponent
property name=connectionFactory
bean
thanks Christian...I'm looking into migrating a Camel 2.13 app from using an
external AMQ 5.9 broker to Apollo...just curious what (if any) client
code/config changes are required
I've played with it just to see if it works.. anything specific?
-
Ben O'Day
IT Consultant
now that openwire supported has been added to Apollo...anyone using it with
Camel JMS yet?
if so, any advice/lessons learned?
Claus Ibsen-2 wrote
A future release of Apollo will support JMS, and thus you can then use
the camel-jms component.
On Mon, Feb 6, 2012 at 11:23 PM, MichaelAtSAG
might take a look at the idempotent consumer pattern to filter
duplicates...it can be used with a repository (hazelcast, file, etc) to
survive servers restarts, etc
http://camel.apache.org/idempotent-consumer.html
MichaelAtSAG wrote
All,
Please provide best practices on supporting
the camel-hdfs producer will throw an error if the send operation
fails...internally it just uses a standard HdfsOutputStream...so any step in
the route following this send would only be triggered upon successful send
operation, and you can use standard Camel onException/doCatch routing
exception
in short, Camel parses the from/to URIs to call a Java API that knows how to
speak that specific component's language (File I/O, HDFS, etc).
So, yes...formatting an appropriate (see camel-hdfs examples) URI to your
HDFS server will tell Camel to poll for files from ://in directory and
send them
pannereselvam wrote
Great boday!
Is it possible to communicate between two contexts.
I m from J2EE background, in tomcat container, each web application has
unique context. So we can deploy many application in the same container.
Is it same in Camel ?
Thanks again..
-
Ben O'Day
start with reading about CXF to wrap the web service interaction:
http://camel.apache.org/cxf-example.html
otherwise, checkout some CXF unit tests to see how to setup the necessary
message information to invoke a web service
#1 - yes, you can use both Spring XML to define routes and also include
RouteBuilders that define JavaDSL routes via bean refs or packageScan (see
http://camel.apache.org/spring.html)
#2 - yes, you can use multiple Camel Contexts in any container
pannereselvam wrote
Hi, we are new to camel.
sure, assuming you are bootstrapping the contexts with Spring, just include
multiple camel-context.xml files (or add multiple contexts to a single file)
and make sure you give the contexts explicit bean IDs so they can be
referenced later...
pannereselvam wrote
Thanks boday...
can multiple
you can use camel-simple to do this...
from(direct:start)
.choice()
.when().simple(${body.keySet} contains 'foo')
.to(mock:king)
.otherwise()
.to(mock:other);
clipod wrote
Hi,
I have a camel route with a choice block. I
we were seeing similar issues and tracked it back to and
ActiveMQConnectionPool idleTimeout issue:
https://issues.apache.org/jira/browse/AMQ-4366
the solution for us was to explicitly set the idleTimeout to 0 to disable
this ActiveMQMessageConsumer.checkClosed() logic...
indrayani wrote
Hi ,
I have a complex/high volume (1k msgs/s) Camel application running in
ActiveMQ that I need to scale up (2-5x traffic). To date, we scaled by
adding more AMQ/Camel VMs and partitioned traffic to each broker. My
thought is that decoupling Camel from AMQ and adding nodes independently is
a better
the end of the route will handle that for you...if you need to explicitly
stop the Exchange processing before the end of the route, you can do this by
setting exchange.setProperty(Exchange.ROUTE_STOP, Boolean.TRUE)...
Cristiano Costantini wrote
Hi All,
at the end of a route I process
likewise, you can use Camle/AMQ with Servicemix as well and it can provide
greater flexibility in terms of deployments (bundles with separate
lifecycles, etc)
see this guide for setting up AMQ:
http://servicemix.apache.org/docs/4.4.x/activemq/index.html
see this guide for setting up Camel:
on a side note, you should reuse the ProducerTemplate in your processors
across subsequent requests...
minimize calls to context.createProducerTemplate() by using a static/class
level variable to hold this reference, should help performance...
WPk wrote
public class ScanningServicesProcessor
sounds like you could just explicitly invoke the 4th route (direct:route4) at
the end of the 3rd route and enrich the 4th route with the hold file...see
http://camel.apache.org/content-enricher.html
cwhistler wrote
I need a way to create a Camel route that uses a file from endpoint but
cannot
you generally can isolate individual exceptions by either throwing/catching
more explicit exceptions or by using granular doTry/doCatch clauses within
routes...
another option is to use the Exchange property
Exchange.TO_ENDPOINT/FAILURE_ENDPOINT to indicate the last endpoint that was
tried before
of
messages and then publishes the collection.
There currently isn't support for XA but that can be mitigated by having
applications monitor for the JMSRedelivery=true header.
Let me know if this answers your question.
Best Regards,
Scott ES
On Tue, Apr 2, 2013 at 11:02 PM, boday
this is a really old thread, but I'm wondering if anyone has any updated
ideas on this...I have a similar requirement to read from an AMQ queue,
batch X messages together and then process. I'm currently doing this with
the aggregator/hawtdb repo combination but performance is proving too
slow...
if you don't want the error to propagate back up, then set handled(true) in
your doCatch() block...
also, don't try to mix try/catch with onException handling of the same error
class...just pick one or the other
jeff wrote
Hey !
I am trying to catch exception from validation properly.
In
couple of options...if you want to use ActiveMQ as your deployment container,
then you can use its master/slave HA setup
(http://activemq.apache.org/shared-file-system-master-slave.html)
otherwise, see this article for a camel specific implementation:
redelivery attempts of 0.
from(direct:testscope)
.onException(Exception.class)
.handled(true)
.to(mock:exception)
.end()
Do you find same if you add this to your route policy?
Regards,
joanne
From: boday [via Camel
if you want these to be separate routes altogether, then you can also add
routes at runtime by periodically checking for new customer registrations
and calling context.addRoutes(new MyRouteBuilder(params))
for more details, see
I just created a basic test and it seemed to work fine for my scenario. Can
you attach a unit test that replicates this?
joe82 wrote
According the the camel documentation, if you provide a context-scoped
error handling policy, and then a route-scoped onException policy also -
the
the splitter sets the CamelSplitSize header that you should be able to use as
your aggregator completion predicate...
something like this...
from(direct:start)
.split(body())
.aggregate(constant(true), new
BodyInAggregatingStrategy()).completionSize(header(CamelSplitSize))
gilboy wrote
I suggest you start with some simple examples
http://camel.apache.org/examples.htmlor books
http://camel.apache.org/books.html to get your head around how to use
Camel.
To your specific flow, see the following links...
1. see camel-file http://camel.apache.org/xpath.html to process a
not sure I follow exactly, but here is an example of aggregating based on the
JMSCorrelationID in SpringDSL...
aggregate strategyRef=aggregatorStrategy completionSize=5
correlationExpression
simpleheader.JMSCorrelationID/simple
/correlationExpression
to uri=mock:aggregated/
I don't see any APIs in the DefaultContext/DefaultEndpoint for this...you can
get Consumer information in JMX however
suralk wrote
Hi All,
Suppose I have defined my camel context:
CamelContext camel = new DefaultCamelContext();
after defining routes,
I can access the set of end
see http://camel.apache.org/cxf-proxy-example.html
mjkrumlauf wrote
I am having difficulty figuring out how to using any combination of Camel
and the CXF or CXF Bean components to route to a remote web service. I
would like to do something like this:
from(someplace)
you shouldn't need to set/get the extra header value, you can also just do
this...
route
from uri=activemq:IN.QUEUE?preserveMessageQos=true /
recipientList
simpleactivemq:queue:HLQ.${in.header.Q_NAME}/simple
/recipientList
/route
dube wrote
Hello
I need to dynamically
its based on the Exchange Pattern being used...internally the SEDA producer
is calling ExchangeHelper.isOutCapable(exchange) which returns TRUE if the
pattern is NOT InOnly/RobustInOnly
Edwin wrote
Hi Folks,
With reference to /http://camel.apache.org/seda.html/ section /Use of
Request
don't use the m2-amq plugin, instead just configure your test AMQ broker URL
to be vm://localhost (generally configured with a test context file,
/src/test/resources/camel-context.xml, etc.) and an embedded broker will be
started automatically.
Mark Webb wrote
I usually use the command mvn
your CustomComponent class should only be instantiated once per CamelContext,
but there can be multiple Consumer Producer instances in a given context
(one per route reference)
Edwin wrote
Hi Folks
I am referencing the same camel endpoint from 2 different routes.
E.g.
yes, there are multiple Endpoint instances as well (one per route
reference)...
If you need to share state between instances, then you can define it in the
Component class and pass into into endpoint/producer/consumer instances via
constructors. for an example of doing this, see camel-hazelcast,
why not just lookup/use the in.headers.POLICYID_X property? otherwise, you
can manually set another header property prior to calling the
bean:kpiWriterBean or even call a different method on the bean based on
the policy property (see recipient list pattern, etc)
sambardar wrote
I am trying
see http://camel.apache.org/wire-tap.html
Ittay Dror wrote
Hi,
I have the need to create a route so that the processor that the
consumer holds runs 2 steps and then returns while the rest of the route
continues.
So, if the route is s1, s2, s3, s4, then:
what kind of endpoint is recorder? your setup will work fine as long as
your to uri=.../ statement points to a valid endpoint try adding to
uri=log:+++request received+++/ before (or in place of) your recorder
endpoint step.
Gnarf wrote
I'm trying to do something like this : The Producer is
sure, take a look at this EIP...http://camel.apache.org/scatter-gather.html
fachhoch wrote
I call a webservice for my application for a user action, I have
spring,cxf client , I use this client to call the webservice, now our
requirement added new webservice call , so I have to call two
by default, JMS is InOnly mode and will only return an ACK that the message
was received. You need to explicitly set it to InOut to enable
request/reply behavior...
see this test...
take a look at the http://camel.apache.org/cxf.html camel-cxf docs and see
http://camel.apache.org/cxf-proxy-example.html this example of proxying a
request...should get you most of the way there
zerdo wrote:
I'm already broken.
I can not cope with the addition to the design of Camel 2.6
you should just be able to throw any exception that is not explicitly handled
otherwise (with onException(), etc)...see
https://svn.apache.org/repos/asf/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerMoveAndMoveFailureTest.java
this unit test ...
oritush wrote:
Ebe, what does your bean return? If its just a String, then just use the
completionSize() like this...
from(direct:start)
.to(bean:myBean)
.aggregate(constant(true), new MyAggregationStrategy()).completionSize(2000)
.to(file:myFile);
If the bean returns a List of Strings, then you can split
Diwakar, here is some more info on running Camel in Karaf or in a web
application container...
http://camel.apache.org/karaf.html
http://camel.apache.org/tutorial-on-using-camel-in-a-web-application.html
diwakar wrote:
Hi,
Thanks for the comment. I have 2 more queries.
try the http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html karaf
forum
-
Ben O'Day
IT Consultant -http://consulting-notes.com
--
View this message in context:
http://camel.465427.n5.nabble.com/Seamlessly-switching-from-Felix-and-Equinox-data-folder-tp4956033p4956422.html
Sent from
my take is that unless you explicitly need any Servicemix features, then just
use Karaf because its lighter weight, etc...
diwakar wrote:
Hi,
Thanks for the replies.
http://stackoverflow.com/questions/6930236/apache-karaf-vs-servicemix has
the two primary
what is your question/issue exactly?
H Paul wrote:
A vitamine is a medicine for one man and poison for another.
I am not sure if Load Balancer is a vitamine or a poison for a basic use
case:
Distribute files from 1 folder among 3 folders.
What is your thought? Remember, I'm still
not sure what you are asking exactly, but if you are worried about the
scalability of topics, then just use a single topic and either a
http://camel.apache.org/content-based-router.html content based router or
http://activemq.apache.org/selectors.html AMQ message selectors ...
otherwise,
Trop, your example does this already...its just asynchronous because you are
using JMS. If you want synchronous behavior, then use direct...
Trop wrote:
Hello,
I have route:
route autoStartup=false
from uri=ftp://anonymous@localhost/; /
to uri=bean:foo /
to uri=jms:...
to run a Camel app in dev mode, just use the
http://camel.apache.org/camel-maven-plugin.html camel maven plugin .
Otherwise, you can package your app as a
http://camel.apache.org/tutorial-on-using-camel-in-a-web-application.html
WAR and run it with either
same as your other post...
to run a Camel app in dev mode, just use the
http://camel.apache.org/camel-maven-plugin.html camel maven plugin .
Otherwise, you can package your app as a
http://camel.apache.org/tutorial-on-using-camel-in-a-web-application.html
WAR and run it with either
see the http://camel.apache.org/xslt.html camel-xslt component and this
https://svn.apache.org/repos/asf/camel/trunk/camel-core/src/test/java/org/apache/camel/component/xslt/XsltRouteTest.java
unit test for an example of doing the XSLT...
not sure what you what you are trying to do with the
try setting both the concurrentConsumers and maxConcurrentConsumers = 1...
from
uri=weblogic:queue:jms/xxincqueue?concurrentConsumers=1maxConcurrentConsumers=1/
...
sunderb wrote:
Hi
We are connecting to weblogic JMS queue - through a standalone camel
application - Using the below
I ran into similar requirements and needed route level locking to
single-thread execution across routes that act on the same data. These
could be identical routes deployed in a cluster or different routes
altogether that act on the same data.
I was planning on adding this to Hazelcast (see
you can embed the camel-web console in your app for some basic stats or roll
your own route monitoring with JMX. To monitor messages traffic, try adding
explicit logging or a wiretap to JMS/file/stream, etc.
here are my (slightly dated) notes on this...
one way to do this is to use the http://camel.apache.org/aggregator2.html
aggregator 's completionFromBatchConsumer mode. This will allow you to
group exchanges together based on the size of the file batch, etc...
from(file:inbound?maxMessagesPerPoll=20)
.process(...)
try specifying an explicit
http://camel.apache.org/configuring-route-startup-ordering-and-autostartup.html
startup order to your routes to make sure the direct consumer route is
started prior to the route that reads from the queue...
bbuzzard wrote:
I'm receiving files from an ActiveMQ
yep, you should be able to call a shell script directly like this...
jeevan.koteshwara wrote:
Hi,
I have a requirement, where I need to call a shell script (for zipping
and unzipping files with associated passwords if any) from the route.
I have chosen exec component to do so. I have
just set the route to use a single consumer thread...like this
from(activemq:queue:inbound?concurrentConsumers=1maxConcurrentConsumers=1).process(...);
Alberto-2 wrote:
Hi,
I have a route that consumes messages from a queue. This route is
transacted because write to a database calling a
Martin, this should work...just make sure you are setting the OUT message on
the exchange (exchange.getOut().setBody(RESPONSE), etc)...
heinrichheine wrote:
Hi,
to make my route nicer i created a splitter in my incoming http route.
Depending of the content i route the request to different
hmmm...I'd think those paths would be relative to the web app context...not
sure why you'd need to add the context in explicity...
wilsonsjc wrote:
Thanks for your reply,
I downloaded camel-web-2.8.0-sources.jar and modified java files under
org.apache.camel.web.resources package from new
In theory, you can register/reuse a spring context within a container
(service registry, etc). But, I don't recommend it given the complexity
involved and the best practice of decoupling application lifecycles from
each other...
Instead, I'd recommend each deployed application having its own
If you have an InOut route, then all you need to do is to assert that the
result from the producer template call is as expected. Also, mock is used
to validate exchanges are received (generally at the end of a route). Just
add .to(mock:output) to the end of your dummy route, then call...
//set
I see the issue, in
camel-web\src\main\java\org\apache\camel\web\resources\RouteStatusResource.java,
the setStatus() method returns return Response.seeOther(new
URI(/routes)).build() after it starts/stops the route...this was to
refresh the route list display, but it doesn't play nice with an
the best way that I've found to do this is to use a default file for common
props and just override the differences in an environment specific file.
Spring has support for this...
bean id=propertyPlaceholderConfigurer
when you setup your activemq component (generally in spring xml), you have
to specify the broker to connect to. this is generally localhost, but can
be an external broker, etc. So, just setup multiple activemq components
(and give them an appropriate ID)...like this
bean
it should behave as you described...at first glance, not sure why you are
seeing otherwise...
here is a unit test that I created a while back to validate this...
public class UseOriginalMessageRouteTest extends CamelTestSupport {
private static final Logger logger =
I haven't tried your approach myself, but I agree that being able to see the
output in the IDE console is ideal. I just modify the log4j.properties file
locally (and ignore it from SVN) to do this...but would be nice to avoid
doing this if possible...
bvahdat wrote:
Hi,
while running the
Blair, see this JIRA for a similar discussion on this...
https://issues.apache.org/jira/browse/CAMEL-4226
Blair wrote:
Hi all, I'd like to add expressions to .to in the DSL... this is why
My code is littered with
.recipientList(constant(activemq:receiving:).append(header(app))
not sure what you are asking...must there is a
http://camel.apache.org/selective-consumer.html selective consumer pattern
and also http://activemq.apache.org/selectors.html activemq selectors that
might be what your are looking for
zerdo wrote:
Does can be taken from the jms queue only
choice and predicate are used to do conditional routing based on attributes
of an exchange/message, not static attibutes resolved on route startup...
I'm not following what you are trying to do...why would a Processor be NULL
exactly? If a code change is required to add/remove/implement a
you can also look at Camel http://camel.apache.org/quartz.html Quartz for
scheduling and the http://camel.apache.org/content-enricher.html pollEnrich
pattern for retrieving message and passing them along to your queue...
srimin wrote:
Hi
I have a queue on which i'd like to receive JMS
see the camel http://camel.apache.org/jms.html jms page for details or this
example
https://svn.apache.org/repos/asf/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteTest.java
unit test
zerdo wrote:
Can someone hint me how to Calem with the following
#1 is correct, you should explicitly call end() after each choice() block...
enalposi wrote:
[Camel 2.7.2]
Sorry, but I am not quite clear about the syntax of inserting Predicates,
esp to dynamically wire in processors... I am also not sure about the
significance of end() and the newer
If you want to apply common decoration to all messages/routes, then use an
http://camel.apache.org/intercept.html interceptor strategy
Otherwise, using a Bean or Processor is fine and can be reused across routes
easily as well, etc.
Jeff Segal wrote:
I'd like to know the best way to add
here is my take...you generally want a distinct endpoint/route for each
technology you are interfacing with, but can encapsulate common
functionality in direct routes, beans, processors, etc.
for example, if you want to expose a given route via soap, ftp and socket
connections...you could do so
you can use the autoStartup attribute along with properties to do this...like
this
route id=foo autoStartup={{cool.foo.startup}}
xiangqiuzhao wrote:
if my application use route config like :
routes
route1 enable=yes/route1
route2 enable=yes/route2
route3
James, direct is synchronous and can return a response...just use a
ProducerTemplate in your processor to call the route like this...you also
should reuse the producer template if there is a high volume of calls
Object result =
hmmm...anyone try to package camel-web within an existing app (lately)? I
tried adding the dependency (below) in my web app and deployed to
Tomcat...but, I can't seem to get to the console (tried
http://localhost:8080/ and http://localhost:8080/my app context, etc).
What is the URL/context to
you can always use AMQ virtual topics instead, then you can do concurrent
consumption because they are queues...see the camel durable subscriber EIP
for an example...
___
Ben O'Day
On Jul 7, 2011, at 6:18 AM, enalposi [via Camel]
ml-node+4561025-2099553868-45...@n5.nabble.com wrote:
https://svn.apache.org/repos/asf/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerTest.java
here is an example of creating/processing a basic web service in Camel
see the http://camel.apache.org/cxf.html camel-cxf page for more info...
zerdo wrote:
yep, you need to make the downstream route do configure multi-threading,
otherwise you will get duplicate messages
instead of this...
from(jms:topic:super_topic?concurrentConsumers=10)...
do this...
from(jms:topic:super_topic?concurrentConsumers=1maxConcurrentConsumers=1).threads(10)...
you need to clarify what you want to do a bit...how about some pseudo code?
zerdo wrote:
How i make save to file when endpoint is disposed and return exceptions?
-
Ben O'Day
IT Consultant -http://consulting-notes.com
--
View this message in context:
As Ashwin said, you are mixing things a bit
when using a topic, you only want a single concurrent consumer or you will
get duplicates. you can either change the overall JMS Config (used by all
routes) or explicitly set these on any routes in question...
I can't find a DSL API to do this either. And yes, the value in the
HTTP_QUERY header is assumed to be encoded by design (so it doesn't double
encode, etc).
Log a JIRA (and submit a patch if you'd like)...and I'll take a look.
For now, just throw in a simple processor and be done with it...
same question...same answer
http://stackoverflow.com/questions/6336900/design-question-on-dynamic-apache-camel-routes-context/6347445#6347445
krishy wrote:
This might be question that falls in the premature optimization category.
I am working on a project where users create watch lists
for #1, did you follow this guide
(http://camel.apache.org/cxf-tomcat-example.html) ??
plowry wrote:
Just to put this in context, there is a bigger problem I'm trying to
solve...
I have two requirements:
1) deploy my Camel-CXF web service using Tomcat
2) accept calls from a JAX-RPC
you are getting duplicates because the topic has up to 10 concurrent
consumers based on your jmsConfig...
so should either change the jmsConfig (used by all routes) or explicitly set
these on any routes in question...
from(activemq:topic:xmlOrders?maxConcurrentConsumers=1concurrentConsumers=1)
1 - 100 of 183 matches
Mail list logo