camel-cxfrs with custom http headers...

2010-08-16 Thread boday

I have a route that defines a CXFRS endpoint.  I need to retrieve custom HTTP
header values from the inbound request...

from(CXF_RS_ENDPOINT_URI)
  .process(new Processor() {
public void process(Exchange exchange) throws Exception
{
Message inMessage = exchange.getIn();
System.out.println("headers->" +
inMessage.getHeaders());
...

here is my unit test code to simulate a client request...

HttpGet get = new
HttpGet("http://localhost:9000/rest/customerservice/customers/126";);
get.addHeader("myHeader", "1234");
HttpClient httpclient = new DefaultHttpClient();
HttpResponse response = httpclient.execute(get);

The problem is that the custom header "myHeader" is unavailable from my
route.  Is there another way to get to it?  

>From looking at the camel-cxf source code, I can see that the default header
strategy/binding logic only sets up predefined HTTP headers.  Is there a
reason why other headers aren't passed through as well?

Either way, what is the best approach to override this behavior?  

thanks

-
Ben O'Day

-- 
View this message in context: 
http://camel.465427.n5.nabble.com/camel-cxfrs-with-custom-http-headers-tp2636965p2636965.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: camel-cxfrs with custom http headers...

2010-08-17 Thread boday

Jiang, our client is sending some needed parameters in the HTTP header of
each request and I'm trying to figure out how to retrieve them in my Camel
processor.  Are they accessible from the camel exchange/message now?  If so,
how can I retrieve them?

thanks...

-
Ben O'Day

-- 
View this message in context: 
http://camel.465427.n5.nabble.com/camel-cxfrs-with-custom-http-headers-tp2636965p2638222.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: camel-cxfrs with custom http headers...

2010-08-19 Thread boday

It works great...thanks Willem.  Any idea when this can be rolled into a Fuse 
release?  My client (Alcatel-Lucent) will be eager to get this fix.

thanks again...

 __
Ben O'Day
Senior IT Consultant






From: Willem.Jiang [via Camel] 
To: boday 
Sent: Wed, August 18, 2010 8:40:04 PM
Subject: Re: camel-cxfrs with custom http headers...

 FYI, I committed the patch into Camel trunk, please check out the latest 
Camel 2.5-SNAPSHOT to verify it. 

Willem 

boday wrote: 

> Jiang, our client is sending some needed parameters in the HTTP header of 
> each request and I'm trying to figure out how to retrieve them in my Camel 
> processor.  Are they accessible from the camel exchange/message now?  If so, 
> how can I retrieve them? 
> 
> thanks... 
> 
> - 
> Ben O'Day 
> 



 
View message @ 
http://camel.465427.n5.nabble.com/camel-cxfrs-with-custom-http-headers-tp2636965p2640408.html
 
To unsubscribe from Re: camel-cxfrs with custom http headers..., click here. 


-
Ben O'Day
IT Consultant (subcontractor for Progress)

-- 
View this message in context: 
http://camel.465427.n5.nabble.com/camel-cxfrs-with-custom-http-headers-tp2636965p2641014.html
Sent from the Camel - Users mailing list archive at Nabble.com.


guaranteed message processing question...

2009-11-04 Thread boday

I'm using Camel2 in SMX 3.3.1.  I have a simple Camel route as follows...

from("activemq:inboundMessages?maxConcurrentConsumers=50")
.process(new Processor1())
.process(new Processor2())
.to("activemq:finishedQueue");

How do I guarentee that a message will not be removed from the
"inboundMessages" queue until it reaches the "finishedQueue"?  I need to
make sure that messages are not lost in the event of a server crash/restart,
etc.  Currently, this process is loosing messages if I restart the server
midway through a load test.

Do I have to use a transactional client approach (if so, how exactly)?  I
tried this briefly but haven't been able to get it to work.  Is there
another option like using the JMS acknowledgement mode or something?

thanks

-
Ben - Senior Consultant

-- 
View this message in context: 
http://old.nabble.com/guaranteed-message-processing-question...-tp26202573p26202573.html
Sent from the Camel - Users mailing list archive at Nabble.com.



Re: guaranteed message processing question...

2009-11-04 Thread boday

thanks guys.  I added some parameters to the queue to make the route
"transactional"...

from("activemq:inboundMessages?maxConcurrentConsumers=50&lazyCreateTransactionManager=true&transacted=true")
.process(new Processor1())
.process(new Processor2())
.to("activemq:finishedQueue"); 

Now I'm getting duplicates delivered.  My test pumped 10k messages into the
queue via an external client.  During the test, I restarted SMX 2 times. 
After the test concluded, I had 10,003 messages in the finishedQueue.  This
is better than losing messages, but still not the desired behavior...any
ideas?

One more question, what happens during exception handling?  Suppose I have
the following policy to retry 3 times, then go to an error queue...

onException(Exception.class).handled(true).maximumRedeliveries(3).to("activemq:errorQueue");

I assume the message is still in the inbound queue until either delivered to
the finished queue or error queue, correct?  So at any given time the sum of
the inbound, finished and error queues should equal to the number of
messages sent, correct?

I'm working on a unit test for this now, but wanted to make sure I
understood the intended behavior first...

thanks in advance


-
Ben - Senior Consultant

-- 
View this message in context: 
http://old.nabble.com/guaranteed-message-processing-question...-tp26202573p26206508.html
Sent from the Camel - Users mailing list archive at Nabble.com.



Re: guaranteed message processing question...

2009-11-09 Thread boday

Claus, my questions are really specific to how Camel wraps the underlying AMQ
technologies.  In particular, how Camel handles transactions and client
acknowledgements when exceptions are raised and redelivery policies applied
(using Camel's onException clause, etc).

Also, I'm not running in DUPS_OK mode explicitly (using AUTO_ACK mode).  But
this seems to be the behavior that I'm seeing...

On another note, I did purchase the "Camel In Action" pre-release (which I
see you are an author of) but haven't found much on this specific topic yet. 
Will subsequent chapters will cover this?

thanks again...


Claus Ibsen-2 wrote:
> 
> Hi
> 
> Could you ask / search at the AMQ forum. The questions is now more
> related to messaging in general how to do reliable bridges.
> I remember there is also a QoS term (Quality of Service) which specified
> such as
> - duplicates allowed
> - at most one
> - etc.
> 
> Try to see if that can help, looks as if duplicates allowed is the
> kind of mode you run with.
> 
> 


-
Ben - Senior Consultant

-- 
View this message in context: 
http://old.nabble.com/guaranteed-message-processing-question...-tp26202573p26270070.html
Sent from the Camel - Users mailing list archive at Nabble.com.



Re: guaranteed message processing question...

2009-11-16 Thread boday

I've been performance testing my newly transacted route, but have seen a
significant performance drop.  

I assumed there would be a bit of overhead with using transactions, but my
route goes from ~250 message/second to ~50 messages/second when I add the
"?transacted=true" to it (no other changes).

Has anyone else seen this type of drop in throughput?  I'm hoping it has
something to do with the Tx manager configuration or something.  I'm using
the default tx.xml file that shipped with Servicemix 3.3.1...

thanks...

-
Ben - Senior Consultant

-- 
View this message in context: 
http://old.nabble.com/guaranteed-message-processing-question...-tp26202573p26376095.html
Sent from the Camel - Users mailing list archive at Nabble.com.



Camel route with CLIENT_ACKNOWLEDGE?

2009-11-17 Thread boday

how do I explicitly acknowledge a message in a Camel route (using
CLIENT_ACKNOWLEGE)?

I'm using Camel2 in SMX 3.3.1.  I have a simple Camel route as follows...

from("activemq:start?maxConcurrentConsumers=10")
.process(new Processor1())
.process(new Processor2())
.to("activemq:finished");

I'd like to guarantee that a message isn't removed from the start queue
until it has been received by the finished queue (in case of server crash,
etc).  I have another 
http://old.nabble.com/guaranteed-message-processing-question...-td26202573.html
thread  going about this in regards to using transactions, but I'm having
some performance issues and would like to try this instead...

I know that I need to setup my "activemq" factory's ack mode to
"CLIENT_ACKNOWLEDGE", but then what?  Is there an API that I can call at the
end of route to do this...

from("activemq:start?maxConcurrentConsumers=10")
.process(new Processor1())
.process(new Processor2())
.to("activemq:finished")
.acknowledge();   <

thanks in advance...




-
Ben - Senior Consultant

-- 
View this message in context: 
http://old.nabble.com/Camel-route-with-CLIENT_ACKNOWLEDGE--tp26395347p26395347.html
Sent from the Camel - Users mailing list archive at Nabble.com.



performance issues with JMS transacted route...

2009-11-30 Thread boday

I have the following JMS transacted route...  

from("activemq:start?maxConcurrentConsumers=50&transacted=true")
.process(new ValidateMessage())
.process(new SaveToDatabase())
.to("activemq:finishedQueue"); 

I assumed there would be a bit of overhead with using transactions, but my
route goes from ~250 message/second to ~50 messages/second when I add the
"?transacted=true" to it (no other changes).  

I've seen similar performance hits when I added xpath (content based
routing, etc) to my route (so I worked around it).  My processor
"SaveToDatabase" does connect to a database (spring JDBC stored procedure
call), but is not transactional itself.  

Overall, my goal is to simply make my route guarantee messaging (server
crashes, restarts, etc) and maintain its high throughput.  Any other ideas?

Has anyone else seen this type of drop in throughput with transacted
messages?  I'm hoping it has something to do with the Tx manager
configuration or something.  I'm using the default tx.xml file that shipped
with Servicemix 3.3.1/Camel 2.0...

note: this is a followup to another thread
(http://old.nabble.com/guaranteed-message-processing-question...-to26202573.html#a26270332)

thanks...

-
Ben - Senior Consultant

-- 
View this message in context: 
http://old.nabble.com/performance-issues-with-JMS-transacted-route...-tp26579725p26579725.html
Sent from the Camel - Users mailing list archive at Nabble.com.



Re: performance issues with JMS transacted route...

2009-12-01 Thread boday

thanks Claus, that is exactly what I wanted to hear...

here is my setup...any advice would be appreciated...

JDK 1.6, ServiceMix 3.3.1, Camel 2.0 (patched the
/hotdeploy/servicemix-camel.zip)
AMQ 5.2 (persistent, small 1k messages, 250+ msg/second, no XA Tx)
Jenks AMQ pool 2.1, Spring 2.5.6

http://old.nabble.com/file/p26594255/tx.xml tx.xml 
http://old.nabble.com/file/p26594255/activemq.xml activemq.xml 
http://old.nabble.com/file/p26594255/servicemix.xml servicemix.xml 

// setup the ActiveMQ component
ActiveMQConnectionFactory queueConnectionFactory = new
ActiveMQConnectionFactory("tcp://localhost:61616");
PooledConnectionFactory pcf = new
PooledConnectionFactory(queueConnectionFactory);
pcf.setMaxConnections(50);

ActiveMQComponent amq =
ActiveMQComponent.activeMQComponent("tcp://localhost:61616");
amq.setConnectionFactory(pcf);
amq.setMaxMessagesPerTask(-1);
amq.setMaxConcurrentConsumers(50);
amq.setCacheLevelName("CACHE_CONSUMER");
amq.setAcknowledgementModeName("AUTO_ACKNOWLEDGE");
getContext().addComponent("activemq", amq);

My route does the following...

@Produce(uri = "activemq:inbound")
ProducerTemplate inboundProducer;

@Consume(uri = "jetty:http://0.0.0.0:9001/inboundMessage/";)
@InOnly
public void onMessage(String message)
{
String addressID = getAttributeValueFromXML(message,"addr");

//set the JMSXGroupID appropriately to enable AMQ MessageGroups
(guaranteed ordering)
inboundProducer.sendBodyAndHeader(message, "JMSXGroupID", addressID);
}

from("activemq:inbound?transacted=true&maxConcurrentConsumers=50")
.process(new ValidateMessage())
.process(new SaveToDatabase())
.to("activemq:topic:outbound"); 

Questions...

how do I set the prefetch buffer?
what Tx manager should I be using and how do I set it up?
should I be using newer versions of any components?

thanks again...




-
Ben - Senior Consultant

-- 
View this message in context: 
http://old.nabble.com/performance-issues-with-JMS-transacted-route...-tp26579725p26594255.html
Sent from the Camel - Users mailing list archive at Nabble.com.



Re: performance issues with JMS transacted route...

2009-12-02 Thread boday

Claus, I tried the following...

-disabled the message groups
-setup the Spring JmsTransactionManager as follows...

...
ActiveMQPrefetchPolicy prefetchPolicy = new ActiveMQPrefetchPolicy();
prefetchPolicy.setQueuePrefetch(50);   //tried 0, 10, 1000, 5000

ActiveMQConnectionFactory connFactory = new ActiveMQConnectionFactory();
connFactory.setBrokerURL(brokerURL);
connFactory.setPrefetchPolicy(prefetchPolicy);

PooledConnectionFactory pcf = new PooledConnectionFactory(connFactory);
pcf.setMaxConnections(50);

JmsTransactionManager jmsTransactionManager = new JmsTransactionManager();
jmsTransactionManager.setConnectionFactory(pcf);

JmsComponent component = ActiveMQComponent.jmsComponentTransacted(pcf,
jmsTransactionManager);
component.getConfiguration().setConcurrentConsumers(50);
this.getContext().addComponent("activemq", component);
...

But, I'm still see the same result.  It appears to be throttling down my
HTTP endpoint (maybe including it in the transaction scope??) as I'm only
able to receive ~10 msg/second now (vs. ~250 w/o a transacted route) into my
inbound queue.  They are being processed from the queue as fast as they are
coming in...just coming in too slow.  

Any other thoughts on this?

thanks again...

-
Ben - Senior Consultant

-- 
View this message in context: 
http://old.nabble.com/performance-issues-with-JMS-transacted-route...-tp26579725p26618905.html
Sent from the Camel - Users mailing list archive at Nabble.com.



start/stop routes programmatically

2009-12-14 Thread boday

I see that Camel 2.1 now support starting/stopping routes via JMX/APIs.  But,
how do I identify routes properly at runtime...

For example, assume I have the following route...

from("activemq:queue1").to("activemq:queue2");
from("activemq:queue2").to("activemq:queue3");

They show up in JMX as "route1" and "route2".  The description/endpointURI
fields definitely help, but might be problematic to use when there are a lot
of routes.  

The same applies to finding a routes with Camel APIs.  I can get a list of
routes using this...

getContext().getRouteCollection().getRoutes()

I see that I can then call the following on a RouteDefinition to get to the
first endpoint name

routeDefinition.getInputs().get(0).getLabel()

I guess I could use this name to identify a route and then call
stop()/start() on it...but this seems like a very indirect approach to
identify it?  Am I missing something?

What I'd like to do is give a route an explicit name that can be referenced
later (in JMX/programmatically)...maybe the DescriptionDefinition class
could help, but am not sure how to use it...

something along these lines is what I'm looking for...

setRouteName("InboundRoute").from("activemq:queue1").to("activemq:queue2");
setRouteName("ProcessingRoute").from("activemq:queue2").to("activemq:queue3");

thanks in advance...






-
Ben - Senior Consultant
using SMX 3.3.1/Camel 2.0
-- 
View this message in context: 
http://old.nabble.com/start-stop-routes-programmatically-tp26781725p26781725.html
Sent from the Camel - Users mailing list archive at Nabble.com.



Re: start/stop routes programmatically

2009-12-15 Thread boday

perfect, that is what I was looking for...thanks guys


willem.jiang wrote:
> 
> If you are using camel 2.0, you may need to use id() dsl,
> but for camel 2.1 you can use the routeId() dsl.
> 
> You can find more information here[1]
> 
> [1] https://issues.apache.org/activemq/browse/CAMEL-2109
> 
> Willem
> 
> 


-
Ben - Senior Consultant
using SMX 3.3.1/Camel 2.1
-- 
View this message in context: 
http://old.nabble.com/start-stop-routes-programmatically-tp26781725p26798471.html
Sent from the Camel - Users mailing list archive at Nabble.com.



DefaultManagementLifecycleStrategy - Could not register service

2009-12-24 Thread boday

I'm sending high volume/small messages to an AMQ topic using the following
API inside of a Camel (2.1) processor...

exchange.getContext().createProducerTemplate().sendBodyAndHeaders("activemq:topic:portal",
messageXML, headers);

I get this warning message every few minutes (stack trace below).  Am I now
using the ProducerTemplate incorrectly or something?  

I also tried the following to define the ProducerTemplate upfront and then
reuse it for each message...but I was getting NullPointerExceptions...why
doesn't this work?

@Produce(uri = "activemq:topic:portal")
ProducerTemplate portalTemplate;
...
portalTemplate.sendBodyAndHeaders(messageXML, headers);

Any other ideas?  

thanks in advance...

 WARN  - DefaultManagementLifecycleStrategy - Could not register service:
Producer[activemq://topic:portal] as Service MBean.
javax.management.InstanceAlreadyExistsException:
org.apache.camel:context=BensLaptop/camelContext,type=producers,name=JmsProducer(0xf8e153)
at com.sun.jmx.mbeanserver.Repository.addMBean(Repository.java:453)
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.internal_addObject(DefaultMBeanServerInterceptor.java:1484)
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:963)
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:917)
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:312)
at
com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:482)
at
org.apache.camel.management.DefaultManagementAgent.registerMBeanWithServer(DefaultManagementAgent.java:298)
at
org.apache.camel.management.DefaultManagementAgent.register(DefaultManagementAgent.java:210)
at
org.apache.camel.management.DefaultManagementAgent.register(DefaultManagementAgent.java:193)
at
org.apache.camel.management.ManagedManagementStrategy.manageNamedObject(ManagedManagementStrategy.java:69)
at
org.apache.camel.management.ManagedManagementStrategy.manageObject(ManagedManagementStrategy.java:62)
at
org.apache.camel.management.DefaultManagementLifecycleStrategy.onServiceAdd(DefaultManagementLifecycleStrategy.java:249)
at
org.apache.camel.impl.DefaultCamelContext.addService(DefaultCamelContext.java:631)
at
org.apache.camel.impl.ProducerCache.doGetProducer(ProducerCache.java:198)
at
org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:133)
at
org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:160)
at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:98)
at
org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:97)
at
org.apache.camel.impl.DefaultProducerTemplate.sendBodyAndHeaders(DefaultProducerTemplate.java:206)
at
org.apache.camel.impl.DefaultProducerTemplate.sendBodyAndHeaders(DefaultProducerTemplate.java:202)




-
Ben - Senior Consultant
using SMX 3.3.1/Camel 2.1
-- 
View this message in context: 
http://old.nabble.com/DefaultManagementLifecycleStrategy---Could-not-register-service-tp26915869p26915869.html
Sent from the Camel - Users mailing list archive at Nabble.com.



context.stopRoute() API hangs periodically

2010-01-06 Thread boday

I'm using Camel 2.1 on SMX 3.3.1.  I'm using a timer to periodically
reprocess messages that I've sent to an error queue.  While reprocessing I
want to stop the main message processing route as follows (for some specific
client requirements)...

from("direct:main").routeId("mainRoute").process(MessageProcessor());

from("timer://ErrorMessageProcessor?period=6")
.bean(blockedNodeManager, "processBlockedQueue");

then, in blockedNodeManager stops the route, acts as a polling consumer and
then restarts the route...

ServiceStatus routeStatus = context.getRouteStatus("mainRoute");
if(routeStatus.isStoppable())
{
logger.info("stopping route..." + routeId);
context.stopRoute(routeId);
logger.info("route stopped..." + routeId);
}

while (true) 
{
String msg = consumer.receiveBody("activemq:errorQueue", 100,
String.class);
if (msg == null)
{
break;
}
producer.sendBody("direct:main", msg);
}

routeStatus = context.getRouteStatus("mainRoute");
if(routeStatus.isStartable())
{
logger.info("starting route..." + routeId);
context.startRoute(routeId);
logger.info("route started..." + routeId);
}

This seems to work fine for a while (up to 12 hours sometimes), but will
periodically hang while trying to stop the main route.  The last message I
see in my log file is"stopping route mainRoute"...it never reaches the
"route stopped" debug statement.  At this point, I'm hosed...I can't even
use JMX to restart the route.  I restart the server and all works fine again
(for a while)...

Am I using these APIs incorrectly?  If there is a better way to accomplish
this, let me know...

thanks in advance...




-
Ben - Senior Consultant
using SMX 3.3.1/Camel 2.1
-- 
View this message in context: 
http://old.nabble.com/context.stopRoute%28%29-API-hangs-periodically-tp27026922p27026922.html
Sent from the Camel - Users mailing list archive at Nabble.com.



Re: Issue trying to browse a activemq queue

2010-01-06 Thread boday

I just use JMX to get these statistics...

here is some raw code to create a connection and iterate over the AMQ queues
to find a given queues size...

note: be careful to close/resuse JMX connections or they will cause
OutOfMemoryExceptions on the MBeanServer

...

JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://" +
machineName + ":" + port
+ "/jmxrmi");
JMXConnector jmxc = JMXConnectorFactory.connect(url, null);
conn = jmxc.getMBeanServerConnection();

ObjectName activeMQ = new
ObjectName("org.apache.activemq:BrokerName=localhost,Type=Broker");
BrokerViewMBean mbean = (BrokerViewMBean)
MBeanServerInvocationHandler.newProxyInstance(mbsc, activeMQ,
BrokerViewMBean.class, true);

//find the queue in question and return the size
for (ObjectName name : mbean.getQueues())
{
QueueViewMBean queueMbean = (QueueViewMBean)
MBeanServerInvocationHandler.newProxyInstance(mbsc,
name,QueueViewMBean.class, true);
   if (queueMbean.getName().equals(queueName))
{
  return queueMbean.getQueueSize();
}
}


-
Ben - Senior Consultant
using SMX 3.3.1/Camel 2.1
-- 
View this message in context: 
http://old.nabble.com/Issue-trying-to-browse-a-activemq-queue-tp27014479p27026944.html
Sent from the Camel - Users mailing list archive at Nabble.com.



Re: context.stopRoute() API hangs periodically

2010-01-08 Thread boday

thanks for the feedback guys...

I think I found the issue.  My ErrorMessageProcessor runs every 60 seconds
and was periodically taking longer than 60 seconds to run.  Then, I end up
with multiple threads trying to stop/start the same route (not a good thing
I imagine).

So, I increased the time between runs and synchronized the method to make
sure it is single threaded.  Since then, I haven't had any issues.  I'm
hoping this was it, if not...I'll try to get a thread dump, etc.

Also, Claus when will Camel 2.2 be available?

thanks again...


-
Ben - Senior Consultant
using SMX 3.3.1/Camel 2.1
-- 
View this message in context: 
http://old.nabble.com/context.stopRoute%28%29-API-hangs-periodically-tp27026922p27082410.html
Sent from the Camel - Users mailing list archive at Nabble.com.



clustering Camel with AMQ/ServiceMix

2010-02-04 Thread boday

I'm trying to determine my options for clustering my SMX 3.3.1/Camel 2.1/AMQ
5.3 application.  I'm performing high volume message processing and I need
to cluster for high availability and horizontal scalability.

Here is basically what my application
does...HTTP->QUEUE->PROCESS->DATABASE->TOPIC

from("jetty:http://0.0.0.0/inbound";)
.to("activemq:inboundQueue");

from("activemq:inboundQueue?maxConcurrentConsumers=50")
.process(decode())
.process(transform())
.process(validate())
.process(saveToDatabase())
.to("activemq:topic:ouboundTopic");

So, I've read all the ServiceMix and AcitveMQ clustering pages, but am still
not sure which way to go.  

I know I can use a Master/Slave setup for HA, but that doesn't help with
scalability.

I've read about network of brokers, but am not sure how this applies.  For
example, if I deploy identical Camel routes on multiple nodes in a cluster,
how will they "interact" exactly?  If I point my HTTP producer at one node
(NodeA), which messages will get sent to NodeB?  Will the queues/topics be
shared between Node A/B...if so how, are messages split or duplicated? 
Also, how would an external client subscribe to my "outboundTopic" exactly
(and get all messages, etc)?

Alternatively, I've been thinking that I should just share a broker between
multiple ServiceMix instances.  That would be cleaner in that there would
only be one set of queues/topics to manage and I could scale by adding more
instances.  But, now I'm limited to the scalability of a single broker and
I'm back to a single point of failure...

If anyone can clarify the trade-offs for me...I'd appreciate it.







-
Ben - Senior Consultant
using SMX 3.3.1/Camel 2.1
-- 
View this message in context: 
http://old.nabble.com/clustering-Camel-with-AMQ-ServiceMix-tp27462441p27462441.html
Sent from the Camel - Users mailing list archive at Nabble.com.



Re: OnException and log level

2010-02-26 Thread boday

Julien, I added the following to suppress these messages...

DefaultErrorHandlerBuilder errHandler = defaultErrorHandler();
errHandler.loggingLevel(LoggingLevel.DEBUG);
errHandler.getRedeliveryPolicy().setRetriesExhaustedLogLevel(LoggingLevel.DEBUG);
errHandler.getRedeliveryPolicy().setRetryAttemptedLogLevel(LoggingLevel.DEBUG);
errorHandler(errHandler);


-
Ben - Senior Consultant
using SMX 3.3.1/Camel 2.1
-- 
View this message in context: 
http://old.nabble.com/OnException-and-log-level-tp27714424p27721142.html
Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.



DirectProducer - no consumers available on endpoint...message is lost

2010-03-08 Thread boday

I have a polling consumer setup to periodically (using camel-timer) retry
messages from an error queue. 

like this...

//initialized in constructor of polling consumer
private static ProducerTemplate producer = context.createProducerTemplate();
...
Exchange exchange = consumer.receive("activemq:errorQueue", 100);
String msgBody = exchange.getIn().getBody(String.class);
producer.sendBody("direct::Decoder", msgBody);

Every now and then, I get the following warning in my logs...

WARN  - DirectProducer - No consumers available on endpoint:
Endpoint[direct://Decoder]

Whenever this happens, the message being sent to this endpoint is lost!!!  I
know the endpoint is active and started, so what would cause it to have "no
consumers available"?  

Also, is there a way for my polling consumer to detect/handle this case so
that the message isn't lost and simply waits for an unavailable consumer to
become available?

thanks

-
Ben - Senior Consultant
using SMX 3.3.1/Camel 2.1
-- 
View this message in context: 
http://old.nabble.com/DirectProducer---no-consumers-available-on-endpoint...message-is-lost-tp27828628p27828628.html
Sent from the Camel - Users mailing list archive at Nabble.com.



Re: DirectProducer - no consumers available on endpoint...message is lost

2010-03-08 Thread boday

sorry, the '::' was a typo in my post only...

the route works fine during normal execution...basically the following

from('activemq:inbound')
.to('direct:decode');

from('direct:decode')
.convertBodyTo(DOMSource.class)
.process(new DecodeProcessor())
.process(new ValidateProcessor())
.process(new PersistProcessor());

I'm using a single Camel context and have 50 MaxConcurrentConsumers set on
the AMQ component.  I'm doing high volume (~200 msg/s) message processing.

My polling consumer routes traffic to the 'direct:decode' endpoint so it
will get processed immediately (rather than going to the 'inbound' queue). 
It seems like this might be the issue in that both the inbound queue route
and my polling consumer are competing for the same 'direct:decode'
consumers??



-
Ben - Senior Consultant
using SMX 3.3.1/Camel 2.1
-- 
View this message in context: 
http://old.nabble.com/DirectProducer---no-consumers-available-on-endpoint...message-is-lost-tp27828628p27829374.html
Sent from the Camel - Users mailing list archive at Nabble.com.



Re: DirectProducer - no consumers available on endpoint...message is lost

2010-03-08 Thread boday

yes, the retry does work fine 99% of the time...randomly we see this error
after many successful retries of of other messages, etc...

-
Ben - Senior Consultant
using SMX 3.3.1/Camel 2.1
-- 
View this message in context: 
http://old.nabble.com/DirectProducer---no-consumers-available-on-endpoint...message-is-lost-tp27828628p27830046.html
Sent from the Camel - Users mailing list archive at Nabble.com.



Re: DirectProducer - no consumers available on endpoint...message is lost

2010-03-09 Thread boday

Sorry, please ignore my typos in the route (I use constants for all
endpoints, but tried to simplify it for the post).

Does "no consumers available" mean the route isn't active or that there
aren't any available threads?  Also, where does the message go exactly?  Is
there a way to handle this case in my route and send it to an error queue?

As for the ordering, I don't explicitly define this now.  But, I don't think
its an issue because everything works fine on startup...the issue only shows
up after hours of normal operation.

I do stop/start this first route on certain errors (database down, etc)...

from(INBOUND_QUEUE).routeId(INBOUND_QUEUE)
.to(DECODE_DIRECT);

with this code...

ServiceStatus routeStatus = 
context.getRouteStatus(INBOUND_QUEUE);
if(routeStatus.isStoppable())
{
context.stopRoute(INBOUND_QUEUE);
}

...//retry database connection, if successful, restart

if(routeStatus.isStartable())
{
context.startRoute(INBOUND_QUEUE);
}

But, I don't ever stop the DECODE_DIRECT route itself.  If I were stopping
that route, then I'd expect to see an error saying that the route hasn't
been started or is unavailable.

thanks again...



-
Ben - Senior Consultant
using SMX 3.3.1/Camel 2.1
-- 
View this message in context: 
http://old.nabble.com/DirectProducer---no-consumers-available-on-endpoint...message-is-lost-tp27828628p27838518.html
Sent from the Camel - Users mailing list archive at Nabble.com.



Re: Super basic questions

2014-01-20 Thread boday
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 to your HDFS server/directory.

Also, for remote apps...Camel allow you to interface as a consumer ('from'
clause) or a producer ('to' clause) with other applications over various
remote protocols (file, http, SOAP, REST, JMS, etc) without any changes
necessary on the remote app side.

Otherwise, if you want any app to use Camel directly, then you generally
just need camel-core and optionally any camel- jars on the
classpath and to bootstrap the context (spring or programmatically, etc)...

see these links for more info:

http://camel.apache.org/what-are-the-dependencies.html
http://camel.apache.org/running-camel-standalone-and-have-it-keep-running.html

good luck...


mister blinky wrote
> Sorry for the probably very fundamental nature of these questions, but i
> have been reading stuff online all day and still am not sure.
> 
> I am messing with Camel with HDFS, but my questions generally relate to
> using Camel to integrate any two (or more) systems that are remote (not on
> same machine, not running in same JVM). Assume that I am not using an ESB,
> because for my larger goal, an ESB is not an option. I need to get
> disparate systems to work with one another with no ESB.
> 
> Here's a simplified scenario.  I have a hadoop cluster and I have a server
> with a directory of files (dir name is "in"). As a PoC, I want to transfer
> those files to HDFS on my cluster and back to my server.
> 
> To transfer the file to HDFS on the cluster, I assume I would use the
> Camel-hdfs component like this:
> 
> from("file://in").to("hdfs://
> 
> :9000/tmp/test"); 
> 
> First question: I was confused initially (maybe i still am!) about how
> Camel would know *where* to transfer the file. My assumption is that I
> identify this by putting the IP addr of the remote system into the URL. Is
> this the general pattern?
> 
> Second question: What is that URL in the to() supposed to be? Is it the
> URL of a web service -- in this case  of HDFS's HTTP API? Or does Camel
> provide some web-addressable wrapper around services that are local to a
> machine?
> 
> Third question: To get remote systems working together using Camel,
> generally do i have to install something Camel-related on each
> participating machine? If so, what? For example (a wild stab) would I have
> to put the Camel-hdfs compontent jar in the classpath? Or??
> 
> Thanks for wading into my confusion.





-
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Super-basic-questions-tp5746261p5746263.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Super basic questions

2014-01-21 Thread boday
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 handling to deal with errors, etc.


mister blinky wrote
> Thanks for your response. I think i got it. Let me state it to confirm,
> then I have a follow up question. 
> 
> So the 
/
> .to(
> 
> :
> 
> )
/
>  establishes a contract with Camel that a) the 
/
> endpoint-type
/
>  defines the message format among other things required by the endpoint;
> and b) the 
/
> URL-of-endpoint-API
/
>  establishes where the service is located and any other arguments that the
> service generally requires.
> 
> As such, in this one-way case, there is no need for Camel on the HDFS
> side, since, from HDFS's point of view, it's just getting a normal web API
> call. Correct?
*
> Here's my follow up.
*
>  What if I want the HDFS server to reply back to the calling server to say
> "ok i'm done and i failed/succeeded"? Assuming for the moment that there
> is no such thing on the remote side, how would one use Camel to facilitate
> not just the sending of the message to the API, but a response from the
> API saying it's done? Is that a case, what role would Camel play on the
> remote server? Is this a typical scenario?  
> 
> thank you.





-
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Super-basic-questions-tp5746261p5746288.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Apache camel guaranteed delivery - multiple endpoints

2014-01-29 Thread boday
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 guaranteed delivery with
> routes that containing multiple endpoints. Our system writes to a ehCache
> with persistence on the producer, then routes to all endpoints. Once all
> endpoints receive the message and the route completes, the message is
> removed from the producer ehCache queue. In case of producer failure, like
> JVM crash, the in-process messages are restored from ehCache upon restart.
> 
> One concern is that this can result in duplicates being sent to certain
> endpoints. For example, route contains endpoints a,b,c. A message is sent
> to a and b, and then the producer jvm crashes. The message remains in the
> producer guaranteed delivery queue and will be resubmitted once the
> producer JVM restarts and sent to a,b,c. This results in duplicates to a
> and b. 
> 
> Our Camel routes support duplicate message detection in the consumer. We
> encourage consumers to implement this pattern in case duplicates are not
> acceptable, yet it is a performance hit.
> 
> Any best practices on this? 
> Any examples or techniques on suppressing the resend from routes to
> endpoints a and b on the producer-side?
> 
> Thanks,
> Michael





-
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Apache-camel-guaranteed-delivery-multiple-endpoints-tp5746503p5746607.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Apollo support in Camel

2014-05-10 Thread boday
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 <

> mebevilacqua@

> > wrote:
>> I saw the recent release of Apollo 1.0 and wanted to understand if this
>> can
>> be used as a component in Camel.
>>
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/Apollo-support-in-Camel-tp5461514p5461514.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
> 
> 
> 
> -- 
> Claus Ibsen
> -
> FuseSource
> Email: 

> cibsen@

> Web: http://fusesource.com
> Twitter: davsclaus, fusenews
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/





-
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Apollo-support-in-Camel-tp5461514p5750965.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Apollo support in Camel

2014-05-19 Thread boday
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 -http://consulting-notes.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Apollo-support-in-Camel-tp5461514p5751296.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Avoiding Serialization in DefaultProducerTemplate

2014-05-31 Thread boday
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");
factory.setObjectMessageSerializationDefered(true);


Klaus777 wrote
> Hi,
> 
> It seems DefaultProducerTemplate serializes my exchange body even if I
> want
> to simply send a message within the same VM.
> 
> Is there a way to avoid this serialization?
> 
> Thanks,
> Max.





-
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Avoiding-Serialization-in-DefaultProducerTemplate-tp5751784p5751785.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Broker definition - activemq.xml - Fuse 6

2014-05-31 Thread boday
sounds like you need to either disable security in the activemq.xml or setup
your Camel AMQ factory with the user/pw provided...



  



  




Happy User wrote
> I am wondering if anyone can help me with this.
> 
> I am accessing a topic using activeme:topic:TopicName in the
> blueprint.xml(camel) and I have defined the broker for activemq(bean) in
> activemq.xml in FUSE 6. But I am getting exception as username null or
> password is invalid.
> 
> So, when I defined the activemq bean in my blueprint itself, everything
> worked fine. Since I have around 40 blueprints in my projects which access
> the same broker, it doesnt sound good to repeat the activemq bean
> definition in all the bluprints. It would be ideal to define broker bean
> in
> activemq.xml for once and just access the topci in all the blueprints I
> need.
> 
> So what am I missing here?





-
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Broker-definition-activemq-xml-Fuse-6-tp5751782p5751786.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Hawtio - ActiveMQ Issue

2014-06-03 Thread boday
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 on the Send button in the top menu.
> The
> message was sent successful and I was able to even see my message when I
> clicked on Browse.
> 4. But weird stuff is, I clicked on the Operations menu and selected the
> 'Send text message(java.lang.string)' and gave the body as 'Hi' and
> clicked
> on Execute. But unfortunately, I got javax.jms.JMSSecurityException: User
> name [null] or password is invalid. For topic also, when I select send
> menu, message was sent successful. But getting same JMS exception when
> trying to send message through Operations menu.
> 
> -Thanks





-
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Hawtio-ActiveMQ-Issue-tp5751790p5751862.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Green test, but my RouteBuilder dosent run...

2014-06-19 Thread boday
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 dont get into my AddIpBean with this
> signature.
> 
> package dk.bankconnect.hub.unittest;
> 
> import org.apache.camel.ProducerTemplate;
> import org.apache.camel.builder.RouteBuilder;
> import org.apache.camel.component.mock.MockEndpoint;
> import org.apache.camel.test.CamelTestSupport;
> import org.junit.Test;
> 
> import dk.bankconnect.hub.processor.AddIpBean;
> 
> public class FilterTest extends CamelTestSupport {
> 
> String header = "
> 
> 
> abc
> 
> 
> 20
> 
> 
> 
> 
> ";
> 
> protected MockEndpoint resultEndpoint;
> 
> protected ProducerTemplate template;
> 
> @Test
> public void testSendMatchingMessage() throws Exception {
> context.addRoutes(createRouteBuilder());
> context.start();
> resultEndpoint = context.getEndpoint("mock:result",
> MockEndpoint.class);
> template = context.createProducerTemplate();
> String expectedBody = "
> 
> ";
> resultEndpoint.expectedBodiesReceived(expectedBody);
> template.setDefaultEndpoint(resultEndpoint);
> template.sendBodyAndHeader(expectedBody, header, header);
> resultEndpoint.assertIsSatisfied();
> context.stop();
> }
> 
> @Override
> protected RouteBuilder createRouteBuilder() {
> return new RouteBuilder() {
> public void configure() {
>
> from("direct:start").bean(AddIpBean.class).to("mock:result");
> }
> };
> }
> 
> }
> 
> I get this exception:
> 
> org.apache.camel.FailedToStartRouteException: Failed to start route route2
> because of Multiple consumers for the same endpoint is not allowed:
> Endpoint[direct://start]
>   at
> org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRouteConsumers(DefaultCamelContext.java:2161)
>   at
> org.apache.camel.impl.DefaultCamelContext.doStartRouteConsumers(DefaultCamelContext.java:2118)
> 
> 
> Frank 





-
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Green-test-but-my-RouteBuilder-dosent-run-tp5752583p5752587.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Green test, but my RouteBuilder dosent run...

2014-06-19 Thread boday
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");

template.sendBodyAndHeader("direct:start",
"message","headerName","headerValue");

assertMockEndpointsSatisfied();


Frankiboy wrote
> I have allerady tried this, i got green ligth but newer go into my
> AddIpBean.
> 
> Its like the Route newer startsup , thats why i tried.
> 
> context.addRoutes(createRouteBuilder()); 
> context.start();





-
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Green-test-but-my-RouteBuilder-dosent-run-tp5752583p5752605.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: question about seda component

2014-06-23 Thread boday
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 have one question about the seda component. there is a parameter
> concurrentConsumers. I am confused about it. Sample code as below
> 
> 
> 
>  uri="seda:trades?size=100&concurrentConsumers=100
*
> "/>
> 
> 
> 
> 
> 
> 
> concurrentConsumers=100, does it means it the route publishData will use
> 100 threads to receive data from the seda?





-
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/question-about-seda-component-tp5752720p5752721.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel hang on graceful shutdown - NOT trying to stop a route from a route

you might try adding a "depends-on" attribute to the 
definition to tell Spring the order to start/stop things...

http://camel.apache.org/schema/spring"; depends-on="activemq,
remote.activemq">


Paul Gale wrote
> Hi,
> 
> ActiveMQ 5.9.1
> Camel 2.13.1
> Spring 3.2.5
> OS: RHEL 6.3
> Tanuki Java Service Wrapper 3.5.24
> 
> When I shutdown my broker inside which a Camel context is containing just
> one route (shown below) it hangs. The route connects to a topic on a
> remote
> broker and writes out the messages to a queue on the local broker. The
> route is about as simple as it gets.
> 
> At the time of the hang I get that good old chestnut of a message:
> 
> "Still waiting for shutdown of 1 message listener invokers"
> 
> After a timeout the Java Service Wrapper kills the broker process - not
> good. After some Googling I've seen where others have reported this error
> before.
> 
> However, the difference here is that I am NOT trying to stop a route from
> another route (at least it doesn't look like I am) and yet I still get the
> same hang. I am simply trying to stop the broker which should gracefully
> shutdown the one route in the Camel context when the broker shuts down.
> 
> Clearly I am missing something. Thoughts?
> 
> Thanks,
> Paul
> 
> Here is my camel.xml:
> 
> 
> http://www.springframework.org/schema/beans";
>xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>xsi:schemaLocation="http://www.springframework.org/schema/beans
> 
> http://www.springframework.org/schema/beans/spring-beans.xsd
>http://camel.apache.org/schema/spring
> 
> http://camel.apache.org/schema/spring/camel-spring.xsd";>
>   
>  class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
> 
> 
> 
> 
>   
> 
> 
> 
> file:${activemq.conf}/credentials.properties
> 
> 
> 
> file:${activemq.conf}/developer.testing.properties
> 
>   
> 
> 
> 
>   
> 
>   

>   
>  class="org.apache.activemq.camel.component.ActiveMQComponent">
> 
>  value="failover:(tcp://queue01.inf.man-${source.environment}.ove.local:61616,tcp://queue02.inf.man-${source.environment}.ove.local:61616)?randomize=false"/>
> 
> 
> 
> 
>   
> 
>   

>   
>  class="org.apache.activemq.camel.component.ActiveMQComponent">
> 
>  value="vm://localhost?create=false&waitForStart=1"/>
> 
> 
> 
> 
>   
> 
>   
> 
> 
> 
> 
> 
>   
> 
>   
>  xmlns="http://camel.apache.org/schema/spring";>
> 
>  location="developer.testing.properties"/>
> 
> 
>   
>  uri="remote.activemq:topic:{{source.topic}}?clientId={{client.id.prefix}}_camel_client"/>
>   
> 
> 
> 
>   
> 
> 





-
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-hang-on-graceful-shutdown-NOT-trying-to-stop-a-route-from-a-route-tp5752711p5752722.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Aggregate up to N "ASAP"

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 guarantee completion periodically instead of the
completionTimeout which requires idle time in between messages to complete,
etc...


bacar wrote
> Hi,
> 
> Is there a way to aggregate the first 100 messages from a seda if >=100
> are
> available, but just take however many are available if there are fewer?
> 
> I think I want aggregate(...).completionSize(100).completionTimeout(0), ie
> complete on 100 items or 0, whichever condition is met "first", but I'm
> not
> convinced that this will actually do the right thing.
> 
> Is there a known correct solution for this?
> 
> Thanks
> Baris.





-
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Aggregate-up-to-N-ASAP-tp5758134p5758147.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: can camel throttle messages based a dynamic message key?

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 your "id"  value and AMQ handles the rest...you can also use a
throttler to manage throughput per unit of time if needed...

see these pages for details:

http://activemq.apache.org/message-groups.html

http://camel.apache.org/parallel-processing-and-ordering.html


nbertram wrote
> I have a route that is invoked to get a status of an object "foo". The
> instance of foo is identified by a key. 
> 
> Concurrently at any given time I may receive following requests on the
> camel route:
> 
> GET status of foo/@id=A12
> GET status of foo/@id=A12
> GET status of foo/@id=A12
> GET status of foo/@id=A30
> GET status of foo/@id=A30
> GET status of foo/@id=A10
> 
> The id of foo is an infinite collection (could be anything).
> 
> I would like to throttle all queries for foo/@id=A12, foo/@id=30 and
> foo/@id=A10 separately. So that in the example above, 1 route for foo A12,
> A30 and A10 is executed but all other requests for A12 and A30 are
> throttled.
> 
> The Camel Throttle does not seem to support something like this and the
> only other thought I had is to use JMS topic. Anyone ever came across a
> use case like this before and if so how did you solve it in Camel?
> 
> Many thanks,
> Niels





-
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/can-camel-throttle-messages-based-a-dynamic-message-key-tp5757611p5758148.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: question about database querying design pattern

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 using a filter...

from("direct:getDataFromRedisOrMongoDB")
.to("spring-redis...")
.filter()
 .to("mongodb...")
 .to("spring-redis...")
.end()
.to();



gmh wrote
> Hi all,
> I have a requirement where we would leverage redis as cache and Mongodb as
> our backend.
> So we would first do a query against redis cache, if no result can be
> found we would then query against Mongodb for data. Assuming redis and
> Mongodb components are working, what type of integration pattern can I use
> for this? And how would I implement it?
> Thanks, Gordon





-
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/question-about-database-querying-design-pattern-tp5759159p5759172.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: general approach to streaming

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


Tim Dudgeon wrote
> I've got various cases where I have large number of results (POJOs) and 
> want to stream them so that:
> 1. initial results are returned immediately
> 2. memory utilisation is kept under control
> 
> I was expecting to use something like using a BlockingQueue [1] but 
> according to the Javadocs:
> 
>  > A BlockingQueue does not intrinsically support any kind of "close" or 
> "shutdown" operation to indicate that no more items will be added.
> 
> which seems to be essential and I can't find any obvious way to handle
> this.
> Am I missing something obvious here?
> 
> [1] 
> https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/BlockingQueue.html
> 
> 
> Tim





-
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/general-approach-to-streaming-tp5759483p5759732.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel production use

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

otherwise, here are some other simple deployment examples:
http://java.dzone.com/articles/apache-camel-deployment-modes



vsk wrote
> Hi
> We are currently considering camel for production use in our application 
> Do anybody have any experience in creating few hundreds of routes for some
> asynchronous data collection and processing??
> Appreciate if some example be shared on live deployments





-
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-production-use-tp576p5764459.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Transactional batching

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...

I'd think it would be faster/cleaner to just be able to read multiple from
the queue in a transaction, aggregate together, process, then end the
transaction...

any ideas?


David J. M. Karlsen wrote
> Looking at this thread I wonder the same.
> 
> During a resource local jmstransaction you are able to fetch several
> messages - but there is no way in camel to control the commit size.
> You can do the same during a XA tx.
> 
> I see no support for batching here:
> http://camel.apache.org/batch-consumer.html.
> 
> Either transaction mode would benefit a lot if you could process several
> messages in one go.
> 
> Typical usecase would be tx( N messages, process them in paralell,
> aggregate and send out )





-
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Transactional-batching-tp474002p5730245.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Transactional batching

thanks Scott, I noticed that SJMS supports batched Tx, but given that it
hasn't been released yet, I assume others have had to work around this issue
using camle-jms in the past...sounds like I'll need to roll my own or rely
on aggregator/hawtdb EIP until 2.11 can be used...


sully6768 wrote
> Hi Ben,
> 
> Currently only SJMS (2.11.0) has support for batching of JMS transactions
> (local only, no XA).  The consumer has natural batch support meaning that
> you set the number of messages you would like read before issuing a
> commit.
>  You can also specify a timeout, default is 5000ms, to keep the consumer
> from holding the transaction open if you have a bursty message flow.
> 
> On the producer side SJMS is able to support using a List of Objects or
> SJMS BatchMessage objects where the producer will iterate through the list
> and if configured for transactions, commit or rollback the transaction.
>  This is necessary at this time since using a batch on the producer would
> potentially cause the initial consumer to loose visibility of what
> messages
> have been lost in the event of a rollback.  This would work well when
> using
> a ProducerTemplate in an application that collects a given number 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 <

> ben.oday@

> >wrote:
> 
>> 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...
>>
>> I'd think it would be faster/cleaner to just be able to read multiple
>> from
>> the queue in a transaction, aggregate together, process, then end the
>> transaction...
>>
>> any ideas?
>>
>>
>> David J. M. Karlsen wrote
>> > Looking at this thread I wonder the same.
>> >
>> > During a resource local jmstransaction you are able to fetch several
>> > messages - but there is no way in camel to control the commit size.
>> > You can do the same during a XA tx.
>> >
>> > I see no support for batching here:
>> > http://camel.apache.org/batch-consumer.html.
>> >
>> > Either transaction mode would benefit a lot if you could process
>> several
>> > messages in one go.
>> >
>> > Typical usecase would be tx( N messages, process them in paralell,
>> > aggregate and send out )
>>
>>
>>
>>
>>
>> -
>> Ben O'Day
>> IT Consultant -http://consulting-notes.com
>>
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/Transactional-batching-tp474002p5730245.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
> 
> 
> 
> -- 
> -- 
> Scott England-Sullivan
> Apache Camel Committer
> Principal Consultant / Sr. Architect | Red Hat, Inc.
> FuseSource is now part of Red Hat
> Web: fusesource.com <http://www.fusesource.com>; |
> redhat.com<http://www.redhat.com>;
> Blog: sully6768.blogspot.com
> Twitter: sully6768





-
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Transactional-batching-tp474002p5730351.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Making a route depend on multiple criteria

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 start processing that file until some other things are complete. 
> So here's a simplified scenario just to provide an example:
> 
> A camel route extracts data from a database and writes the records to a
> file on the file system.
> 
> A second camel route has a file endpoint watching for the extract file. 
> When it is available it will transform the records in that file and write
> out a new file.  The original file will be moved to a "hold" folder.
> 
> A third route watches for the transformed file to do something with it,
> maybe send it off the system somewhere.  When this one is done it will
> move the file to a "done" folder.
> 
> A fourth route needs to process the "hold" file from the second route, but
> it cannot process this file until the transformed file has moved to the
> "done" folder.  So is there a way to make this fourth route dependent on
> both the "hold" and the "done" files?  It does not have to process the
> "done" file, it just can't do anything with the "hold" file until the
> third route is done.





-
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Making-a-route-depend-on-multiple-criteria-tp5732515p5732566.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How do I determine which endpoint validation exception came from?

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 the exception was thrown... 


toomanyedwards wrote
> Hi all,
>   I'm relatively new to camel.  I have a route where I need to do
> validation twice (once on the initial input and the then after
> processing).  I have a SchemaValidationException handler defined which
> catches validation errors.  My question is what is the best practice to
> determine which end point (that is which of my validation steps) actually
> caused the validation exception? I want to handle it differently if there
> were errors on the initial input to my route vs a schema validation after
> processing. 
> 
> -edward





-
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/How-do-I-determine-which-endpoint-validation-exception-came-from-tp5732536p5732567.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Using ActiveMQ with Camel

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:
http://servicemix.apache.org/docs/4.4.x/camel/index.html


VineetKK wrote
> Thanks Claus Ibsen.
> I got that working.
> 
> However, later our design got changed and now I am trying to achieve the
> same but with ServiceMix.
> 
> Regards,
> Vineet





-
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Using-ActiveMQ-with-Camel-tp5733407p5733728.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel Jetty - Performance Issue

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 implements Processor {
>  
> private static GlobalLogger log =
> GlobalLogger.getLogger(ScanningServicesProcessor.class.getName());
> private LoadServicesHandler loadServicesHandler ;
>   
> @Autowired
> public ScanningServicesProcessor (LoadServicesHandler loadHandler)
> {
> this.loadServicesHandler = loadHandler;
> }
> /**
> * 
> * This method overrides the org.apache.camel.Processor.process
> method.
> * Consumes the HTTP based requests coming from the Captiva Service
> and
> * start processing in the method.
> * 
> * @param loadExchange
> *- The Exchange object. Returns 200 - OK - When the
> processing
> *is completed with no errors. Returns 444 - No Content
> - When
> *the Freight Management - Load Details returns 404.
> Returns 500
> *- Internal Server Error - When any internal exception
> is
> *encountered. Returns 400 - Bad Request if the input
> loadId is
> *bad (Null, Empty or non-integer value).
> */
> @Override
> public void process(Exchange loadExchange) {
>  
> final CamelContext context = loadExchange.getContext();
> final ProducerTemplate template =
> context.createProducerTemplate();
> int freightResponseCode = 0;
> Message loadMsgOut = null;
> final String loadId = (String)
> loadExchange.getIn().getHeader("loadId");
> Map headersMap = new
> HashMap();
>  
> /** Start processing for a valid loadId **/
> if (null != loadId && !"".equals(loadId) &&
> loadId.matches("[0-9]+")) {
> FetchLoadStopResponse fetchLoadStopResponse =
> null;
>  
> log.debug("Started invoking the Load Details
> Service in the Freight Management Module for the Load Id: "
> + loadId);
> Map loadHeader = new
> HashMap();
> loadHeader.put(Exchange.HTTP_PATH, loadId);
> Exchange exchange = ScanningServicesUtils
> .invokeCamelHTTPService(
> template,
>
> ScanningServicesCommonConstants.FREIGHT_LOAD_SVCS_URL_PROPERTY,
> loadHeader, null);
> loadMsgOut = (null != exchange) ?
> exchange.getOut() : null;
> InputSource loadMsgSource = null != loadMsgOut ?
> loadMsgOut
> .getBody(InputSource.class) :
> null;
> freightResponseCode = (null != loadMsgOut && null
> != loadMsgSource) ? (loadMsgOut
>
> .getHeader(Exchange.HTTP_RESPONSE_CODE, Integer.class)) : 0;
> log.debug("Load Details Service in the Freight
> Management Module for the Load Id: "
> + loadId
> + " returned a response code "
> + freightResponseCode);
>  
> /** Process the Load Details if the response code
> is 200 **/
> try {
> if (freightResponseCode ==
> ScanningServicesCommonConstants.HTTP_STATUS_SUCCESS) {
> log.debug("Load Details Service in
> the Freight Management Module for the Load Id: "
> + loadId + "
> returned" + loadMsgSource.toString());
> fetchLoadStopResponse =
> loadServicesHandler
>
> .processPickUpStops(context, loadMsgSource);
>  
> }
> /**
> * Set the Message Out Body from the
> Scanning Services Web
> * Service
> **/
> if (null != fetchLoadStopResponse
> &&
> fetchLoadStopResponse.getLoadStops().size() > 0) {
> headersMap
>
> .put(Exchange.HTTP_RESPONSE_CODE,
>

Re: Quick question on Exchange

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 exchanges coming from a CxfEndpoint.
> 
> Until now I had only InOut exchanges, of which I process the input and set
> the getOut().setBody(...) to the new value (which goes back to the
> client).
> 
> Now I have also a InOnly exchange, of which I process the input only but I
> leave untouched.
> 
> As I'm at the end of the route, should I do something to notify the
> processing of the exchange is completed?
> 
> I've remember vaguely of a "complete flag" somewhere in the documentation
> of Camel I've studied, but I've not found anything on the Exchange
> interface...
> 
> Thank you!
> 
> Cristiano





-
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Quick-question-on-Exchange-tp5733817p5733818.html
Sent from the Camel - Users mailing list archive at Nabble.com.


camel deployment options...

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 way to scale horizontally and adds flexibility/reliability to the
architecture...

Assuming this, the question becomes what container to use for the Camel
apps.  I've used both Karaf and Tomcat in the past, but am curious what
others are doing these days in this regard.  Karaf is undoubtedly the better
choice in terms of flexibility, but I tend to fallback to Tomcat because its
a simpler migration path/learning curve for my client (which is a factor).  

Any thoughts on this architecture/deployment model?



-
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-deployment-options-tp5734266.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Activemq consumer is closing

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 understood that these are just warnings ,
> but what could be the reason behind getting consumer closed and session
> closed warnings.
> if you check the scenario that i have mentioned , then in that case , 2
> web applications are communicating with each other via camel routes which
> consist of servlet and actimq endpoints, 
> now in this case , neither of the web application is down, but still after
> first 2 request-reply , i am getting consumer closed exception for one of
> the activemq and session closed exception for the other activemq.
> 
> I am just curious, why am i not getting the exceptions in the first 2
> communictions and why for 3rd ?
> 
> it would be really helpful if you elaborate more on this.





-
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Activemq-consumer-is-closing-tp5731140p5734449.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Accessing a local declared hashmap variable in a route

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 want to use a hashmap inside a
> when condition. 
> To be more precise I would like to know if there is a way to use the
> "containsKey" function inside when.
> Is there a way to handle this. I can actually create a processor and
> define the behaviour but I would like to do it in the route itself.





-
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Accessing-a-local-declared-hashmap-variable-in-a-route-tp5735553p5735646.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: pass input from queue to web service

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

http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerMessageTest.java?view=markup

also, see this question/responses:
http://stackoverflow.com/questions/12944515/how-to-connect-activemq-to-cxf-with-apache-camel


Rajalakshmi Raman wrote
> I created a web service. I want to pass input from queue to web service .
> I dont know how to invoke web service using camel.





-
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/pass-input-from-queue-to-web-service-tp5736844p5736848.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Router with DSL

#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. Have 
> Question 1: Reg DSL(java, Spring). Can we combine both DSL in same
> application. if yes how can we link if we want to connect these routers?
> Question 2: Can we configure two camel context in same mc and one a router
> from each context? 
> 
> Much appriciated your response and the time you spend for this!!!
> 
> -Panneer





-
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Router-with-DSL-tp5736817p5736858.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Router with DSL

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 context exists in same single container?





-
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Router-with-DSL-tp5736817p5736867.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Router with DSL

sure, there are various options for this often referred to as inter-bundle
communication because many face this issue when using OSGi bundles to deploy
multiple Camel apps to a single JVM (Karaf, etc)

the VM transport (http://camel.apache.org/vm.html) can be used to
communicate between contexts in the same VM, also JMS and HTTP can be used
across any container boundaries...it really comes down to your applications
specific requirements

also here is an old blog entry about this topic in the context of OSGI:
http://www.consulting-notes.com/2010/08/osgi-bundle-communication-options.html



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
IT Consultant -http://consulting-notes.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Router-with-DSL-tp5736817p5736988.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: aggregatorstrategy on specified jms replyto question

not sure I follow exactly, but here is an example of aggregating based on the
JMSCorrelationID in SpringDSL...



  header.JMSCorrelationID








-
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/aggregatorstrategy-on-specified-jms-replyto-question-tp5719419p5719421.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: how to retrieve the consumer and/or producer created in an endpoint

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 points now associated with this camel context
> by using 
> camel.getEndpoints().
> 
> Is there a way to access the producer and/or consumer started in these
> endpoints?
> 
> /Sura
> 




-
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/how-to-retrieve-the-consumer-and-or-producer-created-in-an-endpoint-tp5719332p5719422.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Cannot figure out routing to a remote web service

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")
>   .to("cxf:remote-web-service")   // or .to("cxf:bean:remote-web-service")
>   .to("another")
>   ...
> 
> I see plenty of examples like this:
> 
> from("cxf:local-web-service")
>   .to("another")
>   ...
> 
> But have yet to see an example for what I need to do.  Your help will be
> greatly appreciated.
> 
> Thanks,
> Mike Krumlauf
> 




-
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Cannot-figure-out-routing-to-a-remote-web-service-tp5719276p5719423.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Content based Routing

I suggest you start with some simple  examples
   or  books
   to get your head around how to use
Camel.

To your specific flow, see the following links...

1. see  camel-file    to process a file
2. for XML parsing, see  camel-xpath  
...
for CSV parsing, see  camel-csv   
3. see  camel-jdbc    for populating a
database table

Also, you can run Camel applications any number of ways (don't need to use
ServiceMix)...there is is a great overview of the options here:
http://download.progress.com/5331/open/adobe/prc/psc/091610_apache_camel_deployment/index.htm
 





Padmalaya wrote
> I need help in implementing content based routing in Camel. Basically I
> need to use unstructured data do some processing and then send it to the
> required DB Tables. I have however Identified the following sequences:
> 
> 1. Collect Data from Client (can be a csv or an xml) using Camel Route
> 2. Process Data Received (How Can Camel Help me Identify the relevant
> content???)
> 3. Run Camel Service mix and populate data into the Database
> 
> If there is any similar implementation as of this please give me the link.
> 
> Regards,
> 
> Padmalaya





-
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Content-based-Routing-tp5724829p5724864.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Splitter and Aggregator Query

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
> Hi
> 
> If I am using the aggregator EIP in conjunction with the Splitter EIP do I
> have to specify a completion condition. 
> 
> In my case, when I split I don't know how many messages I am splitting.
> After splitting I need to aggregate all the messages again. Hence, unclear
> which completion condition I can use
> 
> Thanks
> Joe





-
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Splitter-and-Aggregator-Query-tp5727361p5727375.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Dynamic route : multiple From point

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()

for more details, see
http://stackoverflow.com/questions/10451444/add-camel-route-at-runtime-in-java


ODarwish wrote
> How can I create dynamic route to  read messages from multiple sources 
> e.g. multiple  ActiveMQ  queues , the number of queues depends on customer
> registered in database each have own dedicated queue
> 
> As I know recipient list handle dynamic  (calculated ) multiple
> destination end point ,but what if I need to do the same for starting
> “From” point 
> My initial implementation for such requirement is  
> 
> route 1 From Direct 
> Call a processor which: 
> -list all sources queues 
> -create consumer template “From” for  each queue  and send it “To” seda
> end point 
> end  route1 
> 
> route2
> from seda 
> to..
> to..
> to ..
> end  route2





-
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Dynamic-route-multiple-From-point-tp5727387p5727437.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: default maximum redelivery policy when overridding default error handler not right

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 MaximumRedeliveries for the route-scoped policy should default to 0
> regardless of whether or not your context-scoped error handling policy had
> overwitten it. 
> This does not appear to be correct, as I have found in this scenario, the
> MaximumRedeliveries default on my route-scoped onException policy was
> picking up the value which I had defined in the context-scoped error
> handling policy which was 3, instead of what I expected it to be (0). 
> So I had to explicitly set the MaximumRedeliveries on the route-scoped
> policy to be 0.
> The version of camel for this project is 2.10.2.
> 
> Has anyone noticed this? has it been raised with camel?





-
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/default-maximum-redelivery-policy-when-overridding-default-error-handler-not-right-tp5727230p5727441.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: default maximum redelivery policy when overridding default error handler not right

adding logStrackTrace(false) had no effect on my unit test...still works as
expected (tried against 2.10 and against the latest trunk)...

public class RedeliverTest extends ContextTestSupport
{

public void testRedeliver() throws Exception {
template.sendBody("direct:start", "Hello World");
getMockEndpoint("mock:b").setExpectedMessageCount(0);
assertMockEndpointsSatisfied();
}

@Override
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
@Override
public void configure() throws Exception {

onException(IOException.class)
.handled(true)
.logStackTrace(false)
.maximumRedeliveries(3)
.to("log:CONTEXT-ERROR");

from("direct:start")
.onException(IOException.class)
//.maximumRedeliveries(3)
.logStackTrace(false)
.handled(true)
.to("log:ROUTE-ERROR")
.end()
.to("log:TRYING")
.process(new MyProcessor())
.to("mock:b");
}
};
}

public static class MyProcessor implements Processor {

private int counter;

@Override
public void process(Exchange exchange) throws Exception {
System.out.println("trying->" + exchange.getExchangeId());
if (counter++ < 2) {
throw new IOException("Forced");
}
exchange.getIn().setBody("Bye World");
}
}
}


joe82 wrote
> Thanks for reply -
> Ok, so on trying to replicate this myself in a unit test, I discovered the
> exact scenario that causes this...
> If you add the .logStackTrace(true/false) to your onException(...) policy,
> then you will see the context scoped maxRedeliveryAttempts value applied.
> So the below route-scoped exception policy is picking up the
> context-scoped error policy redelivery value (defined as 3):
> 
> from("direct:testscope")
> .onException(Exception.class)
> .handled(true)
> .logStackTrace(false)
> .to("mock:exception")
> .end()
> 
> But omitting the .logStackTrace(..) like below, picks up the expected
> default 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] [mailto:

> ml-node+s465427n5727441h63@.nabble

> ]
> Sent: 12 February 2013 16:51
> To: Gilmore, Joanne
> Subject: Re: default maximum redelivery policy when overridding default
> error handler not right
> 
> 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 MaximumRedeliveries for the route-scoped policy should default to 0
> regardless of whether or not your context-scoped error handling policy had
> overwitten it.
> This does not appear to be correct, as I have found in this scenario, the
> MaximumRedeliveries default on my route-scoped onException policy was
> picking up the value which I had defined in the context-scoped error
> handling policy which was 3, instead of what I expected it to be (0).
> So I had to explicitly set the MaximumRedeliveries on the route-scoped
> policy to be 0.
> The version of camel for this project is 2.10.2.
> 
> Has anyone noticed this? has it been raised with camel?
> Ben O'Day
> IT Consultant -http://consulting-notes.com
> 
> 
> If you reply to this email, your message will be added to the discussion
> below:
> http://camel.465427.n5.nabble.com/default-maximum-redelivery-policy-when-overridding-default-error-handler-not-right-tp5727230p5727441.html
> To unsubscribe from default maximum redelivery policy when overridding
> default error handler not right, click
> here<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5727230&code=am9hbm5lLmdpbG1vcmVAZm1yLmNvbXw1NzI3MjMwfDEwOTU3ODMyMzY=>;.
> NAML<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id

Re: Handle exception

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 a main from route I do :
> 
> from ...
> [...]
> .doTry()
> .to("direct:validationAED")
> .doCatch(PredicateValidationException.class)
> .to("direct:erreurFormatAEDFonctionnelZone")
> .doFinally()
> [...]
> With an :
> 
> *from("direct:validationAED")*
> * .validate(zonePredicate)*
> * .end();*
> *
> *
> *And  :*
> *
> *
> from("direct:erreurFormatAEDFonctionnelZone")*
> *
> .log("Error on   :  '${body}'  ")
> .end();
> 
> It works but I have polution :
> 
> org.apache.camel.processor.validation.PredicateValidationException:
> Validation failed for
> Predicate[com.mycomp.mediation.aed.ZonePredicate@c21990a]. Exchange[null]
> 
> In my log
> 
> I have play with :
> 
> onException(PredicateValidationException.class).handled(true / false)
> .to("mock:err") .end();
> 
> If I put false I continue to have log error and if I put true my
> direct:erreurFormatAEDFonctionnelZone is not called ...
> 
> 
> 
> Any idea of how solve this ?
> 
> Thanks !





-
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Handle-exception-tp5728590p5728592.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Redundant Camel Applications

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: 

http://www.liquid-reality.de/display/liquid/2011/1/11/Hot+Standby+failover+for+Apache+Camel+routes


Gershaw, Geoffrey wrote
> Hello All,
> 
>  
> 
> I am using  Camel primarily for distributing Market Data from the
> quickfixj component. If the instance of camel goes down, I would like a
> second instance of Camel on another box/datacenter to take over. 
> 
>  
> 
> I have seen a solution that centered around acquiring a lock on table in
> a DB, just wanted to see if there was anything baked into camel or other
> solutions
> 
>  
> 
> Thanks for your time
> 
>  
> 
> Geoffrey A Gershaw
> 
>  
> 
> 
> ===
>  
> Please access the attached hyperlink for an important electronic
> communications disclaimer: 
> http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html 
> ===





-
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Redundant-Camel-Applications-tp5728575p5728594.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Custom Message Filter

make sure you put your  ref inside the  tag...

see 
http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringCustomPredicateTest.xml?view=markup
this example ...


jguion wrote:
> 
> Hi,
> 
> I am trying to build a custom filter using the Spring DSL. I am able to
> successfully  create it using the Java DSL using the .filter(new
> CustomPredicate())  method where CustomPredicate is a class extending the
> Predicate interface. However, I am not able to do this using the Spring
> DSL. I have tried several things but I cannot get anything to filter my
> messages.
> 
> The path right now looks something like this:
>  
> 
> 
>   
> 
> 
> 
> 
> Any suggestions on how to implement this?
> 
> Thanks
> 


-
Ben O'Day
IT Consultant -http://benoday.blogspot.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Custom-Message-Filter-tp4346578p4346891.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Context Monitoring

also, here are 2 blog posts about remote Camel/AMQ monitoring with JMX...I
used this approach to build a JSP/JQuery based monitoring console for a
client.

http://benoday.blogspot.com/2010/08/managing-camel-routes-with-jmx-apis.html
http://benoday.blogspot.com/2010/08/monitoring-and-managing-activemq-with.html


Xavier Coulon wrote:
> 
> 
> Until now, I tried to programmatically retrieve the route counters that
> are
> exposed by JMX, but with no success. Is it possible ? The
> exchange.getContext().getRoute("route.monitoring.metrics.phase1").getRouteContext().getManagedInterceptStrategy()
> is of type org.apache.camel.management.InstrumentationInterceptStrategy
> but
> does not provide a getter on the inner registeredCounters variable
> 
> Or should I just use JMX to connect to the local JVM ? Could this be an
> extension to the JMX Component ?
> 


-
Ben O'Day
IT Consultant -http://benoday.blogspot.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Context-Monitoring-tp4346067p4346985.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: InOut pattern

at a glance, it's not clear what you are trying to do...

if you haven't already, take a look at these patterns and their associated
test cases for examples

http://camel.apache.org/request-reply.html
http://camel.apache.org/return-address.html
-Ben O'Day
IT Consultant -http://benoday.blogspot.com
--
View this message in context: 
http://camel.465427.n5.nabble.com/InOut-pattern-tp4328660p4357877.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: tcp monitor?

http://www.wireshark.org/ wireshark 
-Ben O'Day
IT Consultant -http://benoday.blogspot.com
--
View this message in context: 
http://camel.465427.n5.nabble.com/tcp-monitor-tp4359515p4359644.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: One exchange at a time

Linus, you might also take a look at the camel-ftp unit tests...in particular 
http://svn.apache.org/viewvc/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpConsumerMaxMessagesPerPollTest.java?view=markup
FtpConsumerMaxMessagesPerPollTest , which uses the "maxMessagesPerPoll"
attribute to limit the polling. 


-
Ben O'Day
IT Consultant -http://benoday.blogspot.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/One-exchange-at-a-time-tp4363389p4365681.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel with activemq

a couple of quick thoughts...

-if you want load balancing with AMQ, you need a 
http://activemq.apache.org/networks-of-brokers.html network of brokers 
setup (as opposed to just failover)
-then you can have camel consume from a "distributed" queue (for example)
and let AMQ handle the abstraction/balancing of consumers, etc.
-Camel does have a  http://camel.apache.org/load-balancer.html load balancer 
component if you want to manage this explicitly


anurag_gujral wrote:
> 
> I have a following activemq setup ,I am using failover transport in
> activemq to connect to two brokers A and B ,the issue is that when
> producer starts it selects one of the broker to write data thereby there
> is no load balancing across the two brokers,after selection is made it
> only writes to the broker selected.
> 
> Is there  a way I can use camel so that half of writes go to broker A and
> half to broker B
> Thanks
> Anurag
> 


-
Ben O'Day
IT Consultant -http://benoday.blogspot.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-with-activemq-tp4368682p4368727.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Round Robin with Camel

see the  http://camel.apache.org/load-balancer.html load balancer  page for
details...basically, "The round robin load balancer is not meant to work
with failover, for that you should use the dedicated failover load balancer"

so, see this unit test for an example 
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/FailoverRoundRobinTest.java?view=markup
FailoverRoundRobinTest 


anurag_gujral wrote:
> 
> Hi All,
> I am planning to use camel in such a way that it send messages to three
> destinations A,B,C in a round robin manner,what happens if one of the 
> destinations is not available will camel round robin the message between
> the remaining two destinations please suggest.
> Thanks
> Anurag
> 


-
Ben O'Day
IT Consultant -http://benoday.blogspot.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Round-Robin-with-Camel-tp4368723p4368747.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Load testing

here are a few links that might help...

http://camel.apache.org/dataset.html

http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tuning/PerformanceRouteTest.java?view=markup

http://benoday.blogspot.com/2011/04/camel-activemq-performance-test.html


Muhammad Ichsan wrote:
> 
> Dear All
> 
> I want to load testing my camel so that I know if my configuration -
> e.g. concurrentConsumers=10 - can process a 10 messages at one time
> concurrently. How to do this? Is there any real example? Thanks
> 
> -- 
> ~The best men are men who benefit to others
> http://michsan.web.id 一緒に勉強しましょう!
> 
> Yang berkualitas memang beda rasanya!
> http://rizqi-cookies.com
> 


-
Ben O'Day
IT Consultant -http://benoday.blogspot.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Load-testing-tp4369026p4369030.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Load testing

just use a mock result endpoint and assert that the total processing time was
within an acceptable range...

resultEndpoint.expectedMessageCount(100);

long start = System.currentTimeMillis();

//send messages

resultEndpoint.assertIsSatisfied();

assertTrue("took too long", (System.currentTimeMillis() - start) < 
acceptableTime);


Muhammad Ichsan wrote:
> 
> But, how about time limitation? I need to make sure that when sending
> 100 messages in concurrency 20 into a 5s processor, camel can process
> 20 messages in 5s.
> 


-
Ben O'Day
IT Consultant -http://benoday.blogspot.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Load-testing-tp4369026p4369074.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Error recovery

It won't resume where it left off by default.  Camel will only delete the
file if it was successfully processed and when it fails, the portion already
send to AMQ will not be rolled back.  When the process resumes, it will
process the entire file again.  One option is to use the file's moveFailed
option to move the file if it failed for special processing (if already
queued, ignore, etc)...


shailesh wrote:
> 
> Hi,
>I have camel in the web container. And I am processing the xml file and
> spliting it and posting the split message to JMS queue. 
>The question I have that if the server was the crash in the middle of
> the processing of the file. 
>I would like the recovery from the failure to begin the processing from
> where the file was left off.
>  
>   
>  
>  
> /foo/bar
> 
>   
>   
> 
>Thanks for suggestion.
> 


-
Ben O'Day
IT Consultant -http://benoday.blogspot.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Error-recovery-tp4370197p4370930.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Problem designing a camel route for an OSGi system.

I researched this a while back and it I think the Camel approach to
communicating between bundles was to use JMS, NMR or WebServices (instead of
sharing the camel context).  The pure OSGi way is to use the service
registry or manifest import/export package statements.

Anyways, I wrote this 
http://benoday.blogspot.com/2010/08/osgi-bundle-communication-options.html
blog post  when evaluating options are a client.  If you land on an
alternate solution, let me know...



-
Ben O'Day
IT Consultant -http://benoday.blogspot.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Problem-designing-a-camel-route-for-an-OSGi-system-tp4363426p4371567.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Synchronization based on correlation identifier

if you can incorporate AMQ, then you can use 
http://activemq.apache.org/message-groups.html message groups  to do
exclusive threading/ordering of groups of messages...

-
Ben O'Day
IT Consultant -http://benoday.blogspot.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Synchronization-based-on-correlation-identifier-tp4375638p4377451.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: route shutdown

see this example of 
http://camel.apache.org/how-can-i-stop-a-route-from-a-route.html stopping a
route from a route  and do it in the onException() clause after the
retry/logging configuration, etc...


BERTRAND Antoine AWL-IT wrote:
> 
> I'm wondering if it is possible to shutdown a route or at least stop the
> consumer (jms mainly) if all redelivery have failed.
> 


-
Ben O'Day
IT Consultant -http://benoday.blogspot.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/route-shutdown-tp4375945p4377461.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Append endpoint to route at test-time.

yep, just use  http://camel.apache.org/advicewith.html
http://camel.apache.org/advicewith.html  and interceptor to decorate with a
mock endpoint that you can assert against...


tarjei wrote:
> 
> Hi,
> 
> I got a route like this:
> from(bookKeeperQueue).routeId("BookKeeperRoute")
> .process(new BookKeeperProcessor(bookKeeper));
>
> That I would like to test by appending a mock endpoint to the route and
> avaiting for it to receive the message.
> 
> I could add a .to(log:something) at the end of the route, but I would
> find it more pleasing if I could just append an endpoint to the route
> using the new adviceWith() functionality.
> 
> Is this possible?
> 
> -- 
> Regards / Med vennlig hilsen
> Tarjei Huse
> Mobil: 920 63 413
> 

-
Ben O'Day
IT Consultant -http://benoday.blogspot.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Append-endpoint-to-route-at-test-time-tp4379843p4381052.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Does onException not support multiple statements?

hmmm, this should work fine unless "proc3" is short circuiting the route. 
Here is a basic example of this that simply appends "-P3" and "-P4" to any
message passed in...

from("direct:start")
.onException(Exception.class)
.handled(true)
.process(new Processor() {
public void process(Exchange exch) throws Exception {

exch.getIn().setBody(exch.getIn().getBody(String.class) + "-P3");
}
})
.process(new Processor() {
public void process(Exchange exch) throws Exception {

exch.getIn().setBody(exch.getIn().getBody(String.class) + "-P4");
}
})
.end()
.process(new Processor() {
public void process(Exchange exch) throws Exception {
throw new Exception("error");
}
});


Jens wrote:
> 
> Hi,
> 
> I have a route that looks something like this:
> 
> route
>   from ref="requestEp"
>   process ref="proc1"
>   process ref="proc2"
>   onException
> exception java.lang.Exception
> handled true
> process ref="proc3"
> process ref="proc4"
>   /onException
> /route
> 
> The exchange is using an InOut MEP, so I'm expecting a reply.
> 
> When there is an exception it looks like only proc3 is ever called, proc4
> isn't. I tried switching the order of elements around some but it always
> came down to this: only the first step of the onException block gets
> called, and the result of this call is returned as my reply. Everything
> thereafter in the onException block is effectively ignored.
> 
> This is using Camel 2.6.0.
> 
> Am I doing something wrong?
> 
> Thanks,
> Jens
> 


-
Ben O'Day
IT Consultant -http://benoday.blogspot.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Does-onException-not-support-multiple-statements-tp4381958p4382450.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Aggregator with shutdownRunningTask

for the aggregator...use both completionSize and completionTimeout to make
sure exchanges aren't left hanging (forever theoretically).  In general, if
you use a shutdown strategy timeout greater than your completionTimeout and
you should be covered (assuming the rest of your route if relatively quick). 

Also, can you can "shutdownRoute(ShutdownRoute.Defer)" on the route to make
sure it doesn't shutdown before exchanges have completed (beware of using
this with external endpoint though or it may never shutdown)...

"shutdownRunningTask(ShutdownRunningTask.CompleteAllTasks)" applies to batch
consumers (file, etc) and will defer shutdown until all pending exchanges
have complete


cmveal wrote:
> 
> I've been trying to figure out how graceful shutdown works with aggregator
> and shutdownRunningTask="CompleteAllTasks".
> 
> If I use a completionInterval="5000", would that mean that my messages
> successfully get processed given that shutdown takes longer than 5
> seconds? Would shutdownRoute="Defer" help in this case?
> 
> What would happen if I use completionSize=5 and I only have 4 messages?
> Would these messages get processed properly prior to shutdown?
> 


-
Ben O'Day
IT Consultant -http://benoday.blogspot.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Aggregator-with-shutdownRunningTask-tp4385211p4385583.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: CamelSpringTestSupport and support for @Autowired/@Inject

one quick way around this is to do the following...

@ContextConfiguration
public class MyActivityMonitorTestCase extends
AbstractJUnit38SpringContextTests { 
...

see 
http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/component/bean/BeanRouteUsingSpringEndpointTest.java?view=markup
this unit test 

that being said, I'm not sure whether CamelSprintTestSupport should/could
support these annotations...


Xavier Coulon wrote:
> 
> Hello,
> 
> I'm running into a NullPointerException in my test case below:
> 
> public class MyActivityMonitorTestCase
> extends CamelSpringTestSupport {
> 
> @Autowired
> private MyActivityMonitor activityMonitor;
> 
> @EndpointInject(uri = "mock:mock")
> private MockEndpoint mockEndpoint;
> 
> @Override
> protected AbstractApplicationContext createApplicationContext() {
> return new ClassPathXmlApplicationContext(new String[] {
> "classpath*:/META-INF/spring/applicationContext-xyz1.xml",
> "classpath:/META-INF/spring/applicationContext-xyz2.xml" });
> }
> 
> }
> 
> The bean named 'activityMonitor' is created within the Spring Application
> context, but it is not injected in the test case, because I'm extending
> the
> CamelSpringTestSupport class, not the AbstractJUnit4SupportTestCase.
> I did not find any documentation about such a feature (injecting beans),
> but
> would it be something doable or is there a mistake/somthing missing in my
> code ?
> In the mean time, I can manually retrieve the bean from the
> applicationContext, but using annotation would be nicer ;-)
> 
> Thank you in advance
> Regards,
> -- 
> Xavier
> 


-
Ben O'Day
IT Consultant -http://benoday.blogspot.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/CamelSpringTestSupport-and-support-for-Autowired-Inject-tp4383959p4385989.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Does onException not support multiple statements?

Jens, I do see that the exchange.getOut() message has a fault instead of just
an exception (in my example, etc).  This is causing the pipeline to
short-circuit.  Not sure if this is by design or not at the moment...I'll
poke around a bit.

To verify this, just add this line to your TestProcessor (though this is not
a solution by any means)...

exchange.getOut().setFault(false);


Jens wrote:
> 
> I cannot really see a difference when looking at the exchange. However,
> I've been able to create a test case that produces this problem. When I
> simply add a throwException in the route, everything works as expected.
> If, like in my real-world case, the exception is thrown by a CxfEndpoint
> in the route, however, it doesn't.
> 
> Please have a look at the attached test. Any feedback appricated.
> 
> Thanks,
> Jens
> 


-
Ben O'Day
IT Consultant -http://benoday.blogspot.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Does-onException-not-support-multiple-statements-tp4381958p4387637.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Does onException not support multiple statements?

Jens, I think you can use this interceptor to convert faults to
exceptions...see 
https://svn.apache.org/repos/asf/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/FaultRouteTest.java
this unit test 

basically, just add this to your context...

getContext().addInterceptStrategy(new HandleFault());


-
Ben O'Day
IT Consultant -http://benoday.blogspot.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Does-onException-not-support-multiple-statements-tp4381958p4387905.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Does onException not support multiple statements?

#1-3 are correct, for #4, with the fault removed (or converted to an
exception), the exception pipeline will not be short-circuited...

that being said, I'm not sure why the HandleFault interceptor isn't being
called or converting this..I'll look into it

On Thu, May 12, 2011 at 8:49 AM, Jens [via Camel] <
ml-node+4390611-1845085697-45...@n5.nabble.com> wrote:

> >> Doesn't from("").handleFault() work either?
> >
> > Building on my previous example I'm assuming it should look like this?
> > ...
> > If so then no, that doesn't work, either.
>
> I think I should clarify. I'm not quite sure but I believe that what's
> happening might be this:
>
> 1. The CXF endpoint gets called and causes a fault.
> 2. The HandleFault interceptor (assuming it gets called; haven't been able
> to verify that yet) turns the fault into an exception
> 3. The first processor in the onException route gets called; after this
> 4. The route is still short-circuited because getException is non-null
>
> Does that sound plausible?
>
> What does work is inserting a processor first thing in the onException
> route that removes the fault and instead of calling setException puts the
> fault into the exchange under the EXCEPTION_CAUGHT property. It would be
> nice if that effect was possible with "handled" without lots of manual
> intervention.
>
> --
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/Does-onException-not-support-multiple-statements-tp4381958p4390611.html
>  To unsubscribe from Does onException not support multiple statements?, click
> here.
>
>


-
Ben O'Day
IT Consultant -http://benoday.blogspot.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Does-onException-not-support-multiple-statements-tp4381958p4390637.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: xpath 2.0 function bean binding camel xpath annotation

l_tsall, haven't had a chance to look at this yet, but I'll see what I can do
(in the next week hopefully)...


l_tsall wrote:
> 
> Hi again, 
> 
> Thanks for resolving this issue.
> 
> But which is the proper resultType for the very useful xpath function
> distinct-values which returns a sequence of atomic values?
> 
> template.sendBody(" customerId=\"123\">101012");
> 
> I can bind this with 
> @XQuery("distinct-values(/order/credit/value)") String distinctValues  
> and get distinctValues: 1012 
> 
> but  @XPath(distinct-values(/order/credit/value") NodeList nodes
> generates as expected  
> Extension function required class org.w3c.dom.NodeList; supplied value of
> class net.sf.saxon.value.UntypedAtomicValue could not be converted
> 
> Would it be possible bind the result in a List 
> something like 
> @XPath(value="distinct-values(/order/credit/value)",resultType=List.class
> ) List distinctValues  ?
> 


-
Ben O'Day
IT Consultant -http://benoday.blogspot.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/xpath-2-0-function-bean-binding-camel-xpath-annotation-tp4344611p4407263.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: lost header (ActiveMQ)

You said that one of the headers is missing, so I assume others made it
through fine.  If so, try switching from List to a List
and see if you have the same issue (might be bumping up against an
unsupported type or something).  Also, if can you narrow this down to a unit
test, post it so we can take a look...


heatlamp wrote:
> 
> I'm a novice camel developer.
> 
> I've developed an application using seda queues, but when swapping to
> activemq one of my camel headers has disappeared (retrieving the contents
> of this header returns null).  
> 
> The info saved is a list, as follows
> 
> List keyList = blah blah
> 
> exch.getIn().setHeader("ImageKeys", keyList);
> 
> The flow then goes through a few queues, and then is retrieved via
> something like this:
> 
> List keys = (List)exch.getIn().getHeader("ImageKeys",
> List.class);
> 
> This is the step that return the proper object with seda, but a null with
> activemq.
> 
> When I first tried this I received a serialization exception on he
> ImageKey object, which I fixed to get to this next error.
> 
> I'm running camel 2.6.0, activemq 5.4.2.
> 
> Anyone see a problem with this?  Is this the right way to save this state?
> 
> Thanks, Jim
> 


-
Ben O'Day
IT Consultant -http://benoday.blogspot.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/lost-header-ActiveMQ-tp4410496p4410777.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Problem writing message to file

as Ashwin said, there are a few issues with your approach...notably, you
shouldn't define your route in a loop...

Also, if you need to poll from a queue every 300ms...then you can use 
http://camel.apache.org/content-enricher.html poll enrich , like this...

from("timer://myTimer?fixedRate=true&period=300")
   .pollEnrich("activemq:queue:queue.Q")
   .to("file:c:/inbox/test");


rumpa wrote:
> 
> Hi Aswin,
> 
> The requirement is to have a standalone consumer that keeps polling every
> 300 ms. The message arrives the endpoint properly as i am able to print it
> in text. but its weird why am i not able to write it to a file. That too
> only the first message that arrives does not get written to the file. 
> The second message onwards it writes to file perfectly.
> 


-
Ben O'Day
IT Consultant -http://benoday.blogspot.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Problem-writing-message-to-file-tp4407362p4410859.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Using dynamic parameter values in XML DSL Route

you can use header properties for this...here is an example in Java DSL using
a producerTemplate...but it can be done in your route by setting the header
properties as well...

Map map = new HashMap();
map.put("To", "davscl...@apache.org");
map.put("From", "jstrac...@apache.org");
map.put("Subject", "Camel rocks");

String body = "Hello Claus.\nYes it does.\n\nRegards James.";
template.sendBodyAndHeaders("smtp://davscl...@apache.org", body, map);

see http://camel.apache.org/mail.html for more details on this...


srimin wrote:
> 
> Hi
> 
> I have an XML DSL route defined as below
> 
> 
> 
> ${in.header.title}  contains 'EMAIL'
> 
> 
> 
> JMS Message header contains the mail recepient address.
> 
> How can a pass that to smtp as an option?
> 
> rgds
> srimin
> 


-
Ben O'Day
IT Consultant -http://benoday.blogspot.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Using-dynamic-parameter-values-in-XML-DSL-Route-tp4414073p4415090.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: @XPath for an Integer

Stu, to your first question, I did this in 2.8 recently...see this JIRA
https://issues.apache.org/jira/browse/CAMEL-3911.  To your second question,
I see your point...I'll look into it


Stu.C wrote:
> 
> Two questions really; 
> a) should I have to explicitly set the resultType, rather than it be
> inferred from the data type on the method parameter?
> b) is it possible to return a null instead when the element doesn't exist,
> as zero could be a valid value?
> 
> Cheers, Stu
> 


-
Ben O'Day
IT Consultant -http://benoday.blogspot.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/XPath-for-an-Integer-tp4422095p4422502.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: @XPath for an Integer

Stu, I see the issue, the value is evaluated to Double.NaN and then the type
converter further converts it to a primitive int (which defaults to 0,
instead of null).

I logged this JIRA to check for Double.NaN and return null instead of
0...https://issues.apache.org/jira/browse/CAMEL-4011


Stu.C wrote:
> 
> b) is it possible to return a null instead when the element doesn't exist,
> as zero could be a valid value?
> 


-
Ben O'Day
IT Consultant -http://benoday.blogspot.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/XPath-for-an-Integer-tp4422095p4422851.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel Web Console Questions

There has been a lot of discussion about reworking camel-web with regards to
OSGI and multiple contexts.  Overall, I agree that this app should be much
more comprehensive, extensible and easy to integrate with existing apps.  If
camel-web can evolve into this...great.  But currently, for specific
requirements, camel-web is difficult to integrate and customize.  I ended up
having to build a custom monitoring app for a client recently using HTML,
CSS, jQuery, JMX, JSP/Servlets, Google Charts, etc.

Maybe someone from the Fuse team can comment on whether the roadmap for Fuse
IDE (or camel-web) overlaps with this effort or not.  But I think a new
Camel subproject would be a good place to experiment with some alternate
approaches for this.


Tarun Ramakrishna-2 wrote:
> 
> Hi,
> 
> At a first glance (please correct me if I am wrong), the camel web
> console implementation appears to be very heavy - depending on Scala,
> scala template engines and several Jersey libraries which have a
> non-Apache licenses. It also appears to be unsuited to running on an
> OSGi environment where different bundles can contribute camel
> contexts.
> 
> Would the committers be interested if someone re-wrote this web-app to
> be more simpler (use HTML 5 techniques and move UI logic to client
> instead of heavy template engines), remove the Jersey dependencies
> (simply use servlets and a plain JSON library or if JAX/WS is really
> wanted use CXF for this) and abstract the lookup of Camel Contexts
> through some interface? Or is the community more than happy with what
> is there now and wouldn't like  anything changed ?
> 
> Best Regards,
> Tarun
> 


-
Ben O'Day
IT Consultant -http://benoday.blogspot.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-Web-Console-Questions-tp4425291p4425611.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel CXF RS Consumer. Why serviceClass is required?

Sergey, I've wondered this myself.  The serviceClass appears to just be used
to configure the endpoint based on class/method level annotations...nothing
more.  I'll look into it...or perhaps one of the more CXF savvy users can
comment of this...


Sergey_Zhemzhitsky wrote:
> 
> I'm wondering why we have to specify the serviceClass attribute and why
> this attribute should point at the real class. I'm asking because the
> response of such a service will always be "Hello World!!!" and
> implementation of MyService.add method does not matter in that case.
> 
> Best Regards,
> Sergey Zhemzhitsky
> 


-
Ben O'Day
IT Consultant -http://benoday.blogspot.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-CXF-RS-Consumer-Why-serviceClass-is-required-tp4424498p4425664.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Problem using dead message channel

hey Greg, given that you configured your error handler to do 3 redelivery
attempts (before moving to mock:dead), I think the 2nd retry (or 3rd
message, with MyService.count=3) will succeed and skip the mock:dead
endpoint...only when all attempts of redelivery have failed, will the
Exchange be moved to a dead letter endpoint...


gmcfall wrote:
> 
> Hi,
> 
> I'm a camel newbie and I'm having trouble with the dead message channel.
> 
> In the JUnit test below, I am trying to route dead messages to a mock
> endpoint, but the assertion for the expected message count on this
> endpoint
> is failing.
> For some reason, messages are not being delivered to the "mock:dead"
> endpoint.
> 
> I see the following result for this test:
> 
> *java.lang.AssertionError: *mock://dead Received message count. Expected:
> <2> but was: <0>
> 
> 
> Can someone explain what I am doing wrong?
> 
> 
> public class DeadLetterTest extends CamelTestSupport {
> 
> @EndpointInject(uri = "mock:sink")
> protected MockEndpoint sink;
> 
> @EndpointInject(uri = "mock:dead")
> protected MockEndpoint deadEndpoint;
>  @Produce(uri = "direct:inbox")
> protected ProducerTemplate template;
>  @Test
> public void testDeadLetter() throws Exception {
>  sink.expectedMessageCount(1);
> deadEndpoint.expectedMessageCount(2);
>  template.sendBody("Hello World");
>  sink.assertIsSatisfied();
> deadEndpoint.assertIsSatisfied();
> }
> 
> static public class MyService {
> int count = 0;
>  public String enrich(String body) throws Exception {
> count++;
> if (count < 3) {
> throw new Exception("The Service is unavailable");
> }
> return body + "." + count;
> }
> }
> 
>  @Override
> protected RouteBuilder createRouteBuilder() {
> return new RouteBuilder() {
> 
> @Override
> public void configure() throws Exception {
>  errorHandler(
> deadLetterChannel("mock:dead")
> .maximumRedeliveries(3)
> .redeliveryDelay(500)
> );
>  MyService bean = new MyService();
>  from("direct:inbox")
> .bean(bean, "enrich")
> .to("mock:sink");
> }
> };
> }
> }
> 
> Thanks,
> ~ Greg McFall
> 


-
Ben O'Day
IT Consultant -http://benoday.blogspot.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Problem-using-dead-message-channel-tp4425741p4425825.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: @XPath for an Integer

agreed...I'll update the patch.  While we are at it, are there any other
cases that should be addressed?


bvahdat wrote:
> 
> I think that not only Double.NaN should be catched but also Float.NaN.
> 


-
Ben O'Day
IT Consultant -http://benoday.blogspot.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/XPath-for-an-Integer-tp4422095p4429030.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Unit test camel with activeMQ

take a look at the camel-jms unit tests.  they should get you started with
setting up AMQ and asserting message flow, etc...

here is a good one to start with...

https://svn.apache.org/repos/asf/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteTest.java


hbellat wrote:
> 
> Hello,
> 
> I used Junit for java program but I need some examples to understand how
> it works in camel with activeMQ
> 
> I wrote a simple camel.xml as follow :
> 
> http://camel.apache.org/schema/spring";>
> 
>   
>   
>   
>   
> 
> 
> and MyBean.java is :
> 
>   public class MyBean {
> 
>   
>   public void route(Exchange message){
> 
>String name = message.getIn().getBody(String.class);
>
>name="test";
>
>message.getOut().setBody(name);
> }
> }
> 
> In my route I send any string like "my unit Test", this string received by
> the bean and affecte "test" in my String and route it to activemq:finish.
> 
> How can I write a unit test for that simple code ?
> 
> In my test I was wondring if my activemq must be started ?
> 
> I will appreciate your help.
> 


-
Ben O'Day
IT Consultant -http://benoday.blogspot.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Unit-test-camel-with-activeMQ-tp4438580p4440861.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Custom error handler around one endpoint

just use route scoped exception handling...see
http://camel.apache.org/exception-clause.html

-
Ben O'Day
IT Consultant -http://benoday.blogspot.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/Custom-error-handler-around-one-endpoint-tp4449301p4449367.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: pass file name of generated file to next endpoint

you can access the "CamelFileNameProduced" header and set that as the body
after the file is written...something like this

.setBody(header(Exchange.FILE_NAME_PRODUCED))


Bharat Goyal wrote:
> 
> Hi, 
> We have a route that is configured to get XML content from a http
> endpoint, log it to a file using the file component (as shown below).
> However, what we want is to pass only the path of the file and not input
> stream to the next component in the route. Is there a way to extract the
> file name and only pass that to the next uri/component in the route? 
> 
> Thanks 
> 
>  
>  uri="quartz://hotTransfer-uop-quartz?trigger.repeatInterval=2&trigger.repeatCount=0&fireNow=true"/>
>  
>  
>  
>  
>  
>  
> 
> 


-
Ben O'Day
IT Consultant -http://benoday.blogspot.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/pass-file-name-of-generated-file-to-next-endpoint-tp4449588p4449648.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: active mq message lost

consumer.receive() will only receive a single message per call...try
something like this

while (true)
{
// receive the message from the queue, wait at most 3 sec
Exchange exchange = consumer.receive(3000);
if (exchange == null)
{
// no more messages in queue
break;
}

String body = exchange.getIn().getBody(String.class);
logger.debug("body->" + body);
}


guddu wrote:
> 
> Hi all,
> 
>  I am new to camel and trying out camel with active mq.
> 
> Have notice some of the messages posted to the  queue is not received by
> the  polling consumer and gets lost ( have set the persistence as true on
> producer ?deliveryPersistent=true ). How can i ensure all the messages are
> received? 
> 
> 
> Consumer sample Code
> 
> PollingConsumer consumer = endpoint.createPollingConsumer();
>   consumer.start();
> Exchange exchange = consumer.receive(1);
> 
> System.out.println(exchange.getIn().getBody());
> 


-
Ben O'Day
IT Consultant -http://benoday.blogspot.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/active-mq-message-lost-tp4449530p4449664.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: pass file name of generated file to next endpoint

hmmm, this worked for me...

http://camel.apache.org/schema/spring";>


  
  
  
  




Bharat Goyal wrote:
> 
> Thanks that works.
> 
> However, how do I pass the relative folder to generate the file in from my
> property file?
> 
> e.g. camel doesnt allow "datafolder.inbound.path" to be inside the file
> component string.
> 
> 
>uri="quartz://hotTransfer-uop-quartz?trigger.repeatInterval=2&trigger.repeatCount=0&fireNow=true"/>
>   
>   
>   
>uri="file:${datafolder.inbound.path}/?fileName=uop-hottransfer-${date:now:MMdd}.xml"
> />
>   
> ${header.CamelFileNameProduced}
> 
>   
>   
> 
> 
> 
> 
> **
>  
> “CONFIDENTIALITY NOTICE: The information transmitted in this message and
> its attachments (if any) is intended only for the person or entity to whom
> or which it is addressed and may contain confidential and/or privileged
> material. Any review, retransmission, dissemination or other use of, or
> taking of any action in reliance upon this information, by persons or
> entities other than the intended recipient is prohibited. If you have
> received this in error, please contact the sender and delete this e-mail
> and associated material from any computer. The intended recipient of this
> e-mail may only use, reproduce, disclose, or distribute the information
> contained in this e-mail and any attached files with the permission of the
> sender.” 
> 
> - Original Message -
> From: "Bharat Goyal" 
> To: "users" 
> Sent: Thursday, June 2, 2011 3:39:44 PM GMT -08:00 US/Canada Pacific
> Subject: pass file name of generated file to next endpoint
> 
> Hi, 
> We have a route that is configured to get XML content from a http
> endpoint, log it to a file using the file component (as shown below).
> However, what we want is to pass only the path of the file and not input
> stream to the next component in the route. Is there a way to extract the
> file name and only pass that to the next uri/component in the route? 
> 
> Thanks 
> 
>  
>  uri="quartz://hotTransfer-uop-quartz?trigger.repeatInterval=2&trigger.repeatCount=0&fireNow=true"/>
>  
>  
>  
>  
>  
>  
> 
> 


-
Ben O'Day
IT Consultant -http://benoday.blogspot.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/pass-file-name-of-generated-file-to-next-endpoint-tp4449588p4449737.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: active mq message lost

are you doing this in a unit test?  If so, you might need to add a delay
(Thread.sleep(1000), etc) to make sure the queue is processed before the
unit test ends.

otherwise, post your entire example so we can help you further...


guddu wrote:
> 
> Hi, thanks for the reply.
> 
> Have tried in while loop aswell. If i send ( for example) 10 messages, may
> be only 6 or 8 of them are received . 
> 
> I was thinking is there anything to do with Active Mq broker setting on my
> computer?
> 
> Will appreciate any input on this.
> 


-
Ben O'Day
IT Consultant -http://consulting-notes.com

--
View this message in context: 
http://camel.465427.n5.nabble.com/active-mq-message-lost-tp4449530p4451713.html
Sent from the Camel - Users mailing list archive at Nabble.com.


  1   2   >