Re: Quartz job data deletion in clustered quartz2

2014-10-29 Thread lakshmi.prashant
Hi Claus,

  Thanks a lot. Adding *managementNamePattern="#name#"* to  in
blueprint  XML seems to click.

  This resolved the 2 issues  with both re-deployment of the same bundle &
also the load-balancing issue when the other VM's acquire the trigger & look
up the camel context.

  We still have 1 pending issue that I reported: Sharing scheduler across
camelcontexts with clustered quartz..

 a) If we expose the SchedulerFactory as a OSGI service and refer to the
same Scheduler Instance across the blueprint bundles (to control the number
of Quartz DB accesses):

  The CamelJob class gets uninstalled when we undeploy 1 route bundle. The
rest of the quartz route bundles also stop firing, once we have undeployed 1
camel-quartz2 bundle:

'Caused by: java.lang.ClassNotFoundException: Unable to load class
org.apache.camel.component.quartz2.CamelJob by any known loaders.'

This is not a blocker, but a performance issue.
Appreciate any help in resolving the above issue, as well.

Thanks,
Lakshmi



--
View this message in context: 
http://camel.465427.n5.nabble.com/Quartz-job-data-deletion-in-clustered-quartz2-tp5757508p5758277.html
Sent from the Camel - Users mailing list archive at Nabble.com.


I cant throw the correct HTTP status codes from camel.

2014-10-29 Thread Frankiboy
I cant throw the correct HTTP status codes from camel.


I have a route like this:


 from("direct:channel2").onException(Exception.class).process(new
LogError(HubConstants.CHANNEL2.getValue())).end().recipientList()
.method(Util.class, "getEndpoint");


The endpoint is down, and i would like to set a responce code 522 back to
the client.


My Exception class is setting the response code like  this:

exchange.getOut().setFault(true);
exchange.getOut().setHeader(org.apache.cxf.message.Message.RESPONSE_CODE,
new Integer(522));


But my client "SOAPUI", still get: 500 back 


HTTP/1.1 500 Internal Server Error
Content-Type: text/xml; charset=UTF-8
Content-Language: da-DK
Transfer-Encoding: chunked
Connection: Close
Date: Wed, 29 Oct 2014 08:29:06 GMT
Server: WebSphere Application Server/7.0

Hlp, any good ideas out there ? 



--
View this message in context: 
http://camel.465427.n5.nabble.com/I-cant-throw-the-correct-HTTP-status-codes-from-camel-tp5758282.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Possible issue with FileLockExclusiveReadLockStrategy leaves orphaned .camelLock file.

2014-10-29 Thread Claus Ibsen
Hi

Yeah good catch. You are welcome to log a JIRA ticket and work on a patch.
http://camel.apache.org/contributing.html

On Mon, Oct 27, 2014 at 11:23 PM, David R. Hoffman  wrote:
> I am trying to understand this block of code in the catch clause of the
> FileLockExclusiveReadLockStrategy acquireExclusiveReadLock() method:
>
> } catch (IOException e) {
> // must handle IOException as some apps on Windows etc. will
> still somehow hold a lock to a file
> // such as AntiVirus or MS Office that has special locks for
> it's supported files
> if (timeout == 0) {
> // if not using timeout, then we cant retry, so rethrow
> throw e;
> }
> LOG.debug("Cannot acquire read lock. Will try again.", e);
> boolean interrupted = sleep();
> if (interrupted) {
> // we were interrupted while sleeping, we are likely being
> shutdown so return false
> return false;
> }
> }
>
> This code is outside while loop that controls the timeout to acquire an
> "exclusive lock".  Assuming there is a timeout it calls sleep() which asks
> the thread to sleep for the checkInterval number of millis.  If sleep is not
> interrupted then finally is called to close the RandomAccessFile and
> FileChannel if they have been instantiated and the
> acquireExclusiveReadLock() returns true, indicating that it succeeded in
> acquiring an "exclusive lock."
>
> The begin() method of the GenericFileProcessStrategySupport is called from
> the processExchange() method of GenericFileConsumer and passes the result of
> acquireExclusiveReadLock() back to the processExchange() in the
> GenericFileConsumer which then would try process the file without really
> acquiring an "exclusive lock", and there is no code that I can find that
> would support the log message: "Cannot acquire read lock. Will try again."
>
> When the begin() method is called from the GenericFileProcessStrategySupport
> subclass GenericFileRenameProcessStrategy, as with "preMove", the begin()
> method of GenericFileRenameProcessStrategy will try to rename the file.
> using in our case renameUsingCopy,and this will fail with a
> FileNotFoundException from the FileInputStream constructor in the copyFile()
> method of the FileUtil class if there is actually a file system lock on the
> file.
>
> It seems to me that the catch clause should simply return false allowing the
> GenericFileConsumer to call the GenericFileProcessStrategySupport abort()
> method and in turn the FileLockExclusiveReadLockStrategy and superclass
> MarkerFileExclusiveReadLockStrategy releaseExclusiveReadLock() methods.  By
> failing to call abort with end up with an orphaned .camelLock file, and the
> target file will not be eligible to process again on the next poll.
>
> I am also not sure why we check timeout == 0 in the catch clause and
> re-throw the IOException when true, because this also leads to an orphaned
> .camelLock file.
>
> A similar issue exists using the FileChangedExclusiveReadLockStrategy where
> the FileUtil.copyFile() method throws a FileNotFoundException because there
> is still a file system lock on the file.
>
> I came across the questionable code in the FileLockExclusiveReadLockStrategy
> catch block while trying to combine the FileChangedExclusiveReadLockStrategy
> with the FileLockExclusiveReadLockStrategy after we ran into the issue where
> the FileChangedExclusiveReadLockStrategy acquireExclusiveReadLock() method
> returned true but there was still a file system lock on the file.
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Possible-issue-with-FileLockExclusiveReadLockStrategy-leaves-orphaned-camelLock-file-tp5758142.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/


Re: Aggregate up to N "ASAP"

2014-10-29 Thread bacar
I understand how they work. These proposals don't resolve the problem. I only
want to take /whatever is already available on the SEDA/. I recognize that
this will take longer than 0ms, but the point is that I do not want to wait
for /any more/ messages to arrive once I've grabbed whatever is available on
the SEDA. Any waiting is redundant here, and only wastes capacity. I'd find
it surprising if nobody else has a requirement to just process whatever has
arrived and not wait for any more. Both completionTimeout and
completionInterval will force worst-case scenarios where I have to wait.

To elucidate further: if I were writing it myself against eg JMS (instead of
using camel against a SEDA), I would have something a little like:







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


Re: Aggregate up to N "ASAP"

2014-10-29 Thread akoufoudakis
Then, you could try to write your own completionPredicate. Some additional
info can be found here: http://camel.apache.org/aggregator2.html.



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


Bundle using camel-spring-ws failes to deploy in Karaf

2014-10-29 Thread rsteppac2
Hi all,

I have a small test project that uses camel-spring-ws (2.14.0). It runs just
fine in a Spring context and the WS client calls are acted on by my routes.
Now I want to convert it to blueprints to deploy it in Karaf (3.0.2).
However, the deployment of the bundle fails with:

   waiting for namespace handlers
[http://www.springframework.org/schema/web-services]

Can anyone tell me which bundle/feature is supposed to contribute this
namespace handler? The feature descriptor I am using to deploy the bundle
("pas-webservice-hp") looks like this:

http://karaf.apache.org/xmlns/features/v1.2.1";
name="ams-feature">

camel-core
camel-spring
camel-blueprint
camel-spring-ws
mvn:ch.vivates.ams/base/3.0.0-SNAPSHOT
mvn:ch.vivates.ams/pas-webservice-hp/3.0.0-SNAPSHOT



The offending part of the blueprints descriptor is this:



which is required by this:





Might be I am going about it the wrong way altogether... In the Spring
context descriptor I used the JDK HTTP server as described  here

  
to avoid having to run a servlet container. I copied the same configuration
over to the blueprint descriptor to get started. Is this approach going to
work at all when deploying to Karaf?
The WsdlDefinitionHttpHandler is specific to using the embedded HTTP server,
but using the dispatcher servlet in a container still requires me to provide
the WSDL I want to expose with a  tag.


Thanks for your help!
Ralf 

PS.: This is a resend with slightly modified subject because the first
message was rejected due to a too high spam score. If both make it to the
list, my apologies!



--
View this message in context: 
http://camel.465427.n5.nabble.com/Bundle-using-camel-spring-ws-failes-to-deploy-in-Karaf-tp5758291.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Using named query parameters

2014-10-29 Thread Henryk Konsek
Hi,

> I'm still not sure if the way I'm trying to access the java.util.Map
> resultset with :#Position is the right way. It seems that nobody is using
> this feature at all (at least I cannot find any other samples on the
> internet).

If it is documented, then it is supposed to work. :) If you can
reproduce the issue, then it is a good candidate to bug report.

Cheers.

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com


How to pick multiple file in same route

2014-10-29 Thread dkum003
Hi,

Currently we are picking one files and corresponding .md5 file from 
ftp/sftp  server.
The file name has some naming convention.
For this we are using PollingConsumerPollStrategy and
AntPathMatcherGenericFileFilter.

Now I want to process multiple file based on some condition, what we have to
do?

Any help will be appreciated.

Regards,
Dhananjay



--
View this message in context: 
http://camel.465427.n5.nabble.com/How-to-pick-multiple-file-in-same-route-tp5758294.html
Sent from the Camel - Users mailing list archive at Nabble.com.


MQTT Request/Reply

2014-10-29 Thread Router
Hi,

I'm trying to figure out the best practice for the communication between a
client and a broker over mqtt. I assume n different clients sending data to
my broker expecting to send a custom response for every received message in
return.

My current understanding is that every client must publish to a topic (e.g.
TargetTopic) configured in my broker. To be able to get any response the
client must also subscribe a topic where the response is queued (e.g.
ResponseTopic).

To be able to identify which response is for a certain client I need to
create a unique response topic for each client (ResponseTopic.client1
;ResponseTopic.client2 etc.) 

*Is that right?*

Due to the fact that I don't know how many clients will be there in future,
I'm afraid to maintain thousands of response topics in my broker. 

*Thus, would it be also possible to send a custom response back to a certain
client without a unique response topic for this client? *

Thanks for your experience ;)



--
View this message in context: 
http://camel.465427.n5.nabble.com/MQTT-Request-Reply-tp5758293.html
Sent from the Camel - Users mailing list archive at Nabble.com.


CircuitBreaker possible issue with async processor

2014-10-29 Thread Matteo Pavesi
Hi all, 

I'm very keen to integrate the circuit breaker EIP in an application, but I
noticed a misbehaviour when I use it with async processors, which is a
common case.

The problem is that the exception in the exchange seems to be populated
after the "hasFailed" method invocation.

To reproduce the error in the junit, I slightly changed the testing route
from:

from("direct:start").loadBalance()
.circuitBreaker(2, 1000L, MyCustomException.class)
.to("mock:result")

to

from("direct:start").loadBalance()
.circuitBreaker(2, 1000L, MyCustomException.class)
.threads(1).to("mock:result")

I raised an issue and attached a patch with a proposed fix:
https://issues.apache.org/jira/browse/CAMEL-7973

Matteo



--
View this message in context: 
http://camel.465427.n5.nabble.com/CircuitBreaker-possible-issue-with-async-processor-tp5758295.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: MQTT Request/Reply

2014-10-29 Thread Henryk Konsek
Hi,

> My current understanding is that every client must publish to a topic (e.g.
> TargetTopic) configured in my broker.

Yeah, I believe that exclusive reply topic is the best (only?) option
for MQTT to achieve In/Out communication.

> Due to the fact that I don't know how many clients will be there in future,
> I'm afraid to maintain thousands of response topics in my broker.

This is really a better question for the ActiveMQ mailing list, as
this is broker specific issue. In AMQ for example you can control the
eviction policy [1] of the topics, so you don't have to worry about
leaking topics.

Cheers.

[1] http://activemq.apache.org/delete-inactive-destinations.html

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com


Camel rest-dsl sending 400 Status codes

2014-10-29 Thread leo prince
Hello Camel Users,
I am developing REST services using camel REST-DSL[
http://camel.apache.org/rest-dsl.html]component.I am successful in sending
JSON request for happy path and get the response on the same using
(Rest-DSL and camel servlet) combination. Now as we move forward the client
may sent Rest Service request with not enough values or invalid valid
request ,now I am looking for ways to send 400 Responses from REST DSL in
case where request is not valid,Please advise on the way to achieve this.

I have added the same question in,
http://stackoverflow.com/questions/26631697/camel-rest-dsl-sending-400-status-codes


Thanks!


Re: MQTT Request/Reply

2014-10-29 Thread Router
Thanks for your answer!

Indeed, my concern to manage all exclusive topics might be a question for
the ActiveMQ mailing list. I was hoping to get around exclusive topics
sending the response directly after the camel route like in this description
(didn't work for me): 

Reference:
http://camel.465427.n5.nabble.com/Understanding-Request-Reply-EIP-in-Spring-DSL-td5662809.html

Response config:

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


*
  OK
*
  




--
View this message in context: 
http://camel.465427.n5.nabble.com/MQTT-Request-Reply-tp5758293p5758298.html
Sent from the Camel - Users mailing list archive at Nabble.com.


CXF Inteceptor Error handling with Camel-CXF, JMS and ActiveMQ

2014-10-29 Thread g8torPaul
I have an inbound CXF webservice that consumes a SOAP message off a JMS
queue.
The endpoint is configured via Camel Spring using the
org.apache.cxf.transport.jms.JMSConfigFeature.
The JMS Configuration is setup to consume off an ActiveMQ JMS queue and it
is transactional.
The CXF endpoint has a inbound interceptor for WSSecurity.
If a user sends in a SOAP message with invalid Security headers the CXF
endpoint interceptor will throw an exception.
The exception gets processed by the internal Spring DMLC used by the CXF
JMSConfigFeature and a rollback is initiated. 
Since our ActiveMQ is setup with a redelivery policy to continuously
redeliver the message, the message gets rolled back to the queue and gets
redelivered.

The problem is that the message gets another exception upon redelivery and
repeats the cycle infinitely which results in blocking the JMS queue (which
only has one a consumer).

I am trying to figure out how to handle this special case of WSSecurity
exceptions such that I can dump the message to a log and remove the message
from the queue for redelivery.
Camel Exception handling (errorHandler, onException) does not help in this
case because the message never makes it into the route (the exception occurs
in an interceptor).

Does anyone know a way to handle this?

Thanks,

g8torPaul



--
View this message in context: 
http://camel.465427.n5.nabble.com/CXF-Inteceptor-Error-handling-with-Camel-CXF-JMS-and-ActiveMQ-tp5758297.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel use case with Akka

2014-10-29 Thread gmh
Great testimonials!
However, I am trying to understand when it is appropriate to use Akka within
the context of a Camel application? Maybe something along the line of the
following:
if your requirements are xyz then akka would/not be appropriate...

Assuming large steaming data coming from 1 websocket and each json received
will have to be operated on in an atomic fashion (single unit of work).

Gordon



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


Configuring a servlet with camel-jetty

2014-10-29 Thread jack atwork
Hi,

I'm trying to configure a servlet using the camel-jetty component but I'm
struggling and hoping somebody might be able to point out what I'm doing
wrong.

I expected to be able to register a new Handler and reference it in the
endpoint uri .

ServletContextHandler handler = new ServletContextHandler();
handler.addServlet(new ServletHolder(myServlet), "/*");

Then adding a route to my routeBuilder:


Re: Configuring a servlet with camel-jetty

2014-10-29 Thread jack atwork
apologies, hit send by a bit early!

Hi,

I'm trying to configure a servlet using the camel-jetty component but I'm
struggling and hoping somebody might be able to point out what I'm doing
wrong.

I expected to be able to register a new Handler and reference it in the
endpoint uri.

ServletContextHandler handler = new ServletContextHandler();
handler.addServlet(new ServletHolder(myServlet), "/*");

Then adding a route to my routeBuilder:

from("jetty:
http://localhost:8080/?matchOnUriPrefix=true&handlers=#MyContextHandler";)
.to("log:foo");

I can see my servlet gets initialised but it is never invoked on any
requests. Can anyone tell me what's missing?

Thanks,

Jack


On 29 October 2014 15:06, jack atwork  wrote:

> Hi,
>
> I'm trying to configure a servlet using the camel-jetty component but I'm
> struggling and hoping somebody might be able to point out what I'm doing
> wrong.
>
> I expected to be able to register a new Handler and reference it in the
> endpoint uri .
>
> ServletContextHandler handler = new ServletContextHandler();
> handler.addServlet(new ServletHolder(myServlet), "/*");
>
> Then adding a route to my routeBuilder:
>
>
>
>
>


Re: Configuring a servlet with camel-jetty

2014-10-29 Thread Andrew Block
Jack,

Have you added the handler to the Camel Registry with the name 
MyContextHandler? In your example, you are referencing the “MyContetHandler” in 
your route, but never show it being added to the Camel registry.

- Andy

-- 
Andrew Block


On October 29, 2014 at 10:14:21 AM, jack atwork (jrmpatw...@gmail.com) wrote:

apologies, hit send by a bit early!  

Hi,  

I'm trying to configure a servlet using the camel-jetty component but I'm  
struggling and hoping somebody might be able to point out what I'm doing  
wrong.  

I expected to be able to register a new Handler and reference it in the  
endpoint uri.  

ServletContextHandler handler = new ServletContextHandler();  
handler.addServlet(new ServletHolder(myServlet), "/*");  

Then adding a route to my routeBuilder:  

from("jetty:  
http://localhost:8080/?matchOnUriPrefix=true&handlers=#MyContextHandler";)  
.to("log:foo");  

I can see my servlet gets initialised but it is never invoked on any  
requests. Can anyone tell me what's missing?  

Thanks,  

Jack  


On 29 October 2014 15:06, jack atwork  wrote:  

> Hi,  
>  
> I'm trying to configure a servlet using the camel-jetty component but I'm  
> struggling and hoping somebody might be able to point out what I'm doing  
> wrong.  
>  
> I expected to be able to register a new Handler and reference it in the  
> endpoint uri .  
>  
> ServletContextHandler handler = new ServletContextHandler();  
> handler.addServlet(new ServletHolder(myServlet), "/*");  
>  
> Then adding a route to my routeBuilder:  
>  
>  
>  
>  
>  


Re: Problems configuring FileIdempotentRepository

2014-10-29 Thread Henryk Konsek
> The underlying problem is that if the idempotent repository file doesn't
> exist Camel doesn't seem to create it.

If you can reproduce the issue with the Maven example, you could
create a Jira issue with bug report.

Cheers.


-- 
Henryk Konsek
http://henryk-konsek.blogspot.com


Re: I cant throw the correct HTTP status codes from camel.

2014-10-29 Thread Henryk Konsek
Hi,

>  from("direct:channel2").onException(Exception.class).process(new
> LogError(HubConstants.CHANNEL2.getValue())).end().recipientList()
> .method(Util.class, "getEndpoint");

Can you share the consumer part of the route with us? :)

Cheers.

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com


Re: Aggregate up to N "ASAP"

2014-10-29 Thread Henryk Konsek
> Any waiting is redundant here, and only wastes capacity. I'd find
> it surprising if nobody else has a requirement to just process whatever has
> arrived and not wait for any more.

Time frames or message count (or the other predicate) are required to
define "whatever" in "whatever has arrived" :) .

Messages are collected one by one. It indicates that your completion
predicate would complete as soon as aggregator collected one message.
That's why it makes no sense.

Laters!

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com


Re: CircuitBreaker possible issue with async processor

2014-10-29 Thread Matteo Pavesi
I modified the issue, adding another problem that I discovered and that I
believe my patch fixes.

The second problem addressed is that, after the opening of the circuit, the
RejectedExecutionException raised by the circuit breaker is set in the
Exchange, but it doesn't return. This cause the processor will receive the
Exchange even if the circuit is open. In this case also, if the
CircuitBreaker is instructed to react only to specific Exception, it will
close the circuit after the following request, because the raised exception
would be a RejectedExecutionException instead of the one specified in the
configuration.



--
View this message in context: 
http://camel.465427.n5.nabble.com/CircuitBreaker-possible-issue-with-async-processor-tp5758295p5758310.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Aggregate up to N "ASAP"

2014-10-29 Thread bacar
Thanks. I'm not sure on whether the current design of the aggregator actually
allows for this though? I think the current design is "push" based: an
upstream processor "pushes" exchanges into the aggregator; the aggregator's
completion mechanism then decides whether to submit or not, yet.

I think my end goal would require a "pull" mechanism (analagous to the
receiveNoWait() call from my code sample). Basically I'd need a way to say
"dearest upstream exchange deliverer, do you have anything available that I
could consume at this point in time? If not I'm going to press ahead, but if
you do, I'd like it please".

Perhaps something like this does exist, but I've missed it?



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


Re: Aggregate up to N "ASAP"

2014-10-29 Thread bacar
Henryk, that sounds like a limitation in the design of aggregators in Camel,
rather than a necessarily desirable end goal.



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


Aggregator race condition in recovery task?

2014-10-29 Thread Archis.Kulkarni
Hi,

We’re using the camel 2.12.3 library for aggregation in one of our 
applications. The JdbcAggregationRepository is used to maintain the state. The 
aggregator is supposed to function based on time interval i.e. every ‘n’ ms it 
should send out the aggregated output.
We’re seeing duplicate messages being generated from the recovery task on a 
frequent basis. The recovery task is supposed to run every 5 sec.

By enabling the debug logs, and on further investigation I see the following 
sequence of events in the logs

1.[AggregateTimeoutChecker thread] - AggregateProcessor.run()  : 
Completion interval triggered for correlation key

2.   [AggregateTimeoutChecker thread] - 
JdbcAggregationRepository.doInTransactionWithoutResult()  : Removing key

3.   [AggregateRecoverChecker thread] - AggregateProcessor.run()  : 
Starting recover check

4.   [AggregateRecoverChecker thread] - JdbcAggregationRepository.mapRow()  
: getKey

5.   [AggregateTimeoutChecker thread] - 
AggregateProcessor.onSubmitCompletion() : Aggregation complete for correlation 
key

6.   [AggregateRecoverChecker thread] - AggregateProcessor.run() : Loading 
aggregated exchange with id

7.   [AggregateTimeoutChecker thread] - AggregateProcessor.run() : 
Processing aggregated exchange

8.   [AggregateRecoverChecker thread] - JdbcAggregationRepository.recover() 
- Recovering exchangeId

9.   [AggregateRecoverChecker thread] - AggregateProcessor.run() - Delivery 
attempt: 1 to recover aggregated exchange with id

10.   [AggregateRecoverChecker thread] - 
AggregateProcessor.onSubmitCompletion() - Aggregation complete for correlation 
key


In short, in the timeout checker, it removes the exchange from XXX table and 
adds it to XXX_completed table. Then a little later in the processing, it adds 
the exchange to the “inProgressCompleteExchanges” structure.
In the recover task, it scans the XXX_completed table and then checks if they 
are present in “inProgressCompleteExchanges” before attempting to recover.

This usage of “inProgressCompleteExchanges” looks dodgy to me as I don’t see 
any explicit locking for it in the recover task while the timeout task may be 
updating it simultaneously.
This is how the set is created in AggregateProcessor.
private final Set inProgressCompleteExchanges = 
Collections.newSetFromMap(new ConcurrentHashMap());

How does it ensure synchronization in this case?
Is there something I’m missing in this analysis? I don’t understand how add and 
contains methods on this set called from different threads will be synchronized 
in this case? Any help in this regards will be much appreciated.

Thanks,
Archis



PLEASE READ: This message is for the named person's use only. It may contain 
confidential, proprietary or legally privileged information. No confidentiality 
or privilege is waived or lost by any mistransmission. If you receive this 
message in error, please delete it and all copies from your system, destroy any 
hard copies and notify the sender. You must not, directly or indirectly, use, 
disclose, distribute, print, or copy any part of this message if you are not 
the intended recipient. Nomura Holding America Inc., Nomura Securities 
International, Inc, and their respective subsidiaries each reserve the right to 
monitor all e-mail communications through its networks. Any views expressed in 
this message are those of the individual sender, except where the message 
states otherwise and the sender is authorized to state the views of such 
entity. Unless otherwise stated, any pricing information in this message is 
indicative only, is subject to change and does not constitute an offer to deal 
at any price quoted. Any reference to the terms of executed transactions should 
be treated as preliminary only and subject to our formal written confirmation.



Re: HTTP Basic Authentication

2014-10-29 Thread sharathbabuk
The preemptive authentication with HTTPS does not seem to work with
"Camel-Http"
It works only with "camel-http4" 

But I have a limitation on my container ( websphere application server 7.x )
so cannot use "camel-http4" - does anyone know if this should work with
"camel-http" ??

== here is my camel XML DSL ==









POST


application/json


http://camel.465427.n5.nabble.com/HTTP-Basic-Authentication-tp5742229p5758314.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: How to pick multiple file in same route

2014-10-29 Thread Christian Müller
http://camel.apache.org/aggregator2.html

Best,

Christian
-

Software Integration Specialist

Apache Member
V.P. Apache Camel | Apache Camel PMC Member | Apache Camel committer
Apache Incubator PMC Member

https://www.linkedin.com/pub/christian-mueller/11/551/642

On Wed, Oct 29, 2014 at 1:07 PM, dkum003 
wrote:

> Hi,
>
> Currently we are picking one files and corresponding .md5 file from
> ftp/sftp  server.
> The file name has some naming convention.
> For this we are using PollingConsumerPollStrategy and
> AntPathMatcherGenericFileFilter.
>
> Now I want to process multiple file based on some condition, what we have
> to
> do?
>
> Any help will be appreciated.
>
> Regards,
> Dhananjay
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/How-to-pick-multiple-file-in-same-route-tp5758294.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


AutoMocking not working with Blueprint?

2014-10-29 Thread wjmcdonald
I get the following error in the testMockAllEndpoints test, but the other two
work fine:

java.lang.AssertionError: mock://seda:result Received message count.
Expected: <1> but was: <0>
at
org.apache.camel.component.mock.MockEndpoint.fail(MockEndpoint.java:1318)
at
org.apache.camel.component.mock.MockEndpoint.assertEquals(MockEndpoint.java:1300)
at
org.apache.camel.component.mock.MockEndpoint.doAssertIsSatisfied(MockEndpoint.java:372)
at
org.apache.camel.component.mock.MockEndpoint.assertIsSatisfied(MockEndpoint.java:351)
at
org.apache.camel.component.mock.MockEndpoint.assertIsSatisfied(MockEndpoint.java:339)
at
org.apache.camel.component.mock.MockEndpoint.assertIsSatisfied(MockEndpoint.java:177)
at
org.apache.camel.test.junit4.CamelTestSupport.assertMockEndpointsSatisfied(CamelTestSupport.java:626)
at
automocking.IsMockEndpointsJUnit4Test.testMockAllEndpoints(IsMockEndpointsJUnit4Test.java:38)
...

However, the regular mock works in the first route, and the second route
works with a regular mock, demonstrating that the message is getting to the
seda:result component.  Although the mocks seem to be getting created
because of the isMockEndpoints() method, they don't seem to be getting the
exchange for some reason.  Can you provide a blueprint example that works
that I can try out? IsMockEndpointsJUnit4Test.java

  
IsMockEndpoints.xml
  



--
View this message in context: 
http://camel.465427.n5.nabble.com/AutoMocking-not-working-with-Blueprint-tp5758319.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: camel-jms 2.14.0 option validation on startup from an expression

2014-10-29 Thread sandp
Hi,
I'm using the recipientList to pass *timetoLive *option dynamically. The
issue I'm facing is that the consumer does send a replyTo, if I use a
recipientList . If I use a static URL, it sends back a replyTo the queue.
How do I get around this?

*The route below does not  produce a replyTo*
=Producer==
from("direct:ctsJMSProducerRoute").id("c
tsJMSProducerRoute")

.recipientList(simple("jms:queue:ctsCamelQueue?replyTo=ctsReplyQueue&replyToType=Shared&concurrentConsumers=10&requestTimeout=5&timeToLive=${in.headers."+JMSConstants.TIME_TO_LIVE+"}")).setExchangePattern(ExchangePattern.InOnly)
.end();


*The route below produces a replyTo without recipientList*
= Producer==
from("direct:ctsJMSProducerRoute").id("ctsJMSProducerRoute")

.to(ExchangePattern.InOnly,"jms:queue:ctsCamelQueue?replyTo=ctsReplyQueue&replyToType=Shared&concurrentConsumers=10&requestTimeout=5&timetoLive
=3")
.end();


=Consumer
from("jms:queue:ctsCamelQueue?replyTo=ctsReplyQueue&replyToType=Shared&transacted=false&requestTimeout=6").setExchangePattern(ExchangePattern.InOut)



--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-jms-2-14-0-option-validation-on-startup-from-an-expression-tp5757289p5758317.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Camel rest-dsl sending 400(Client Error) Status code's

2014-10-29 Thread leofprince
Hello Camel Users,
I am developing REST services using camel
REST-DSL[http://camel.apache.org/rest-dsl.html]component.I am successful in
sending JSON request for happy path and get the response on the same using
(Rest-DSL and camel servlet) combination. Now as we move forward the client
may sent Rest Service request with not enough values or invalid valid
request ,now I am looking for ways to send 400 Responses from REST DSL in
case where request is not valid,Please advise on the way to achieve this.

I have added the same question in,
http://stackoverflow.com/questions/26631697/camel-rest-dsl-sending-400-status-codes


Thanks!



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-rest-dsl-sending-400-Client-Error-Status-code-s-tp5758320.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: AutoMocking not working with Blueprint?

2014-10-29 Thread Willem Jiang
Which version of Camel are you using?
I just run the test in camel master branch, all the tests passed.


--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On October 30, 2014 at 6:32:31 AM, wjmcdonald 
(william.mcdon...@transcentra.com) wrote:
> I get the following error in the testMockAllEndpoints test, but the other two
> work fine:
>  
> java.lang.AssertionError: mock://seda:result Received message count.
> Expected: <1> but was: <0>
> at
> org.apache.camel.component.mock.MockEndpoint.fail(MockEndpoint.java:1318)  
> at
> org.apache.camel.component.mock.MockEndpoint.assertEquals(MockEndpoint.java:1300)
>   
> at
> org.apache.camel.component.mock.MockEndpoint.doAssertIsSatisfied(MockEndpoint.java:372)
>   
> at
> org.apache.camel.component.mock.MockEndpoint.assertIsSatisfied(MockEndpoint.java:351)
>   
> at
> org.apache.camel.component.mock.MockEndpoint.assertIsSatisfied(MockEndpoint.java:339)
>   
> at
> org.apache.camel.component.mock.MockEndpoint.assertIsSatisfied(MockEndpoint.java:177)
>   
> at
> org.apache.camel.test.junit4.CamelTestSupport.assertMockEndpointsSatisfied(CamelTestSupport.java:626)
>   
> at
> automocking.IsMockEndpointsJUnit4Test.testMockAllEndpoints(IsMockEndpointsJUnit4Test.java:38)
>   
> ...
>  
> However, the regular mock works in the first route, and the second route
> works with a regular mock, demonstrating that the message is getting to the
> seda:result component. Although the mocks seem to be getting created
> because of the isMockEndpoints() method, they don't seem to be getting the
> exchange for some reason. Can you provide a blueprint example that works
> that I can try out? IsMockEndpointsJUnit4Test.java
>  
> IsMockEndpoints.xml
>  
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/AutoMocking-not-working-with-Blueprint-tp5758319.html
>   
> Sent from the Camel - Users mailing list archive at Nabble.com.
>  



Re: HTTP Basic Authentication

2014-10-29 Thread Willem Jiang
Please setup the option of httpClient.authenticationPreemptive to be true.
You can find more information here[1] by searching authenticationPreemptive.

[1]https://camel.apache.org/http

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On October 30, 2014 at 2:52:55 AM, sharathbabuk (sharathba...@hotmail.com) 
wrote:
> The preemptive authentication with HTTPS does not seem to work with
> "Camel-Http"
> It works only with "camel-http4"
>  
> But I have a limitation on my container ( websphere application server 7.x )
> so cannot use "camel-http4" - does anyone know if this should work with
> "camel-http" ??
>  
> == here is my camel XML DSL ==
>  
>  
>  
>  
> > password="{{ssl.store.pass}}" />
>  
>  
>  
>  
> POST
>  
>  
> application/json
>  
>  
> > uri="https:{{host}}{{auditWs.url}}?sslContextParameters=sslContextParameters%26authUsername={{auditWsAuthUsername}}%26authPassword={{auditWsAuthPassword}}%26authenticationPreemptive=true%26bridgeEndpoint=true%26throwExceptionOnFailure=false"
> >   
>  
> ===
> I get a 401 ERROR when I use "camel-http"
>  
>  
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/HTTP-Basic-Authentication-tp5742229p5758314.html
>   
> Sent from the Camel - Users mailing list archive at Nabble.com.
>  



Re: Zookeeper component RoutePolicy

2014-10-29 Thread Henryk Konsek
> What I want is to know if it is possible to when message 1 arrives
> the consumer A consumes it, when message 2 arrives the consumer B consumes
> it, when message 3 arrives the consumer A consumes it, and so on.

What about load balancer [1] then?

Laters!

[1] http://camel.apache.org/load-balancer.html

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com


Re: Camel rest-dsl sending 400(Client Error) Status code's

2014-10-29 Thread Dewitte P-Alban
Hi,

I am assuming you are doing your check in a custom processor or something
similiar. If you want to send your an HTTP Error code just add the header
Exchange.HTTP_RESPONSE_CODE.

For example : exchange.getIn().setHeader(Exchange.HTTP_RESPONSE_CODE, 204);

Best regards

Pierre-Alban DEWITTE
@__pad__



On Thu, Oct 30, 2014 at 1:50 AM, leofprince  wrote:

> Hello Camel Users,
> I am developing REST services using camel
> REST-DSL[http://camel.apache.org/rest-dsl.html]component.I am successful
> in
> sending JSON request for happy path and get the response on the same using
> (Rest-DSL and camel servlet) combination. Now as we move forward the client
> may sent Rest Service request with not enough values or invalid valid
> request ,now I am looking for ways to send 400 Responses from REST DSL in
> case where request is not valid,Please advise on the way to achieve this.
>
> I have added the same question in,
>
> http://stackoverflow.com/questions/26631697/camel-rest-dsl-sending-400-status-codes
>
>
> Thanks!
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-rest-dsl-sending-400-Client-Error-Status-code-s-tp5758320.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


Re: I cant throw the correct HTTP status codes from camel.

2014-10-29 Thread Dewitte P-Alban
Hi,

Did you tried with exchange.getOut().setHeader(
Exchange.HTTP_RESPONSE_CODE,
new Integer(522));

Best regard

Pierre-Alban DEWITTE
@__pad__

On Wed, Oct 29, 2014 at 5:01 PM, Henryk Konsek  wrote:

> Hi,
>
> >  from("direct:channel2").onException(Exception.class).process(new
> > LogError(HubConstants.CHANNEL2.getValue())).end().recipientList()
> > .method(Util.class, "getEndpoint");
>
> Can you share the consumer part of the route with us? :)
>
> Cheers.
>
> --
> Henryk Konsek
> http://henryk-konsek.blogspot.com
>